Hi > I have a line: > i.like.donuts.but.only.with.tea > > now I want to remove everything that follows the last "." > including the last ".". > [...]
you can use a regex for that. === Documentation (from command line:) perldoc perlre === Code: use strict; use warnings; my $a="i.like.donuts.but.only.with.tea"; $a=~s/\.\d+$//; # <---- this does the trick print $a, "\n"; # this prints: i.like.donuts.but.only.with.tea === explanation: see documentation ;-) greetings joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>