Bastian Angerstein [BA], on Tuesday, March 8, 2005 at 12:19 (+0100) wrote: BA> use strict; use warnings; BA> my $a="i.like.donuts.but.only.with.tea"; BA> $a=~s/\.\w+$//; # <---- maybe w+ not d+??? BA> print $a, "\n";
correct code is: use strict; use warnings; my $a = 'i.like.donuts.but.only.with.tea'; $a =~ s/\.[^.]+$//; print $a, "\n"; if you use this for domains don't forget about .co.uk and so on:) -- ...m8s, cu l8r, Brano. [OS/2 means 2x as OutStanding as Windows] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>