in reply to Opere Citato Japh

It doesn't work here - it simply prints out "perl5" for each. $^X is /usr/bin/perl5.8.7, so m;.+[/\\]([^\.]+); sets $1 to perl5. When I change it to m;.+[/\\]([^\d.]+);, it works; very nice.