Ciao,
vedi http://work.lauralemay.com/samples/perl.html
sezione "Patterns and Variables"
dovrebbe fare al caso tuo