in reply to Re^2: sed command in perl
in thread sed command in perl
If you have Perl version 5.10 or later, this also works:
c:\@Work\Perl\monks>perl -wMstrict -le "use 5.010; ;; for my $s ('21112,/vol/voly,blx', '21113,/vol/eng,blz', '21114,/vol +/eng,file') { my $t = $s; $t =~ s{ .* \K , }{}xms; print qq{'$s' -> '$t'}; } " '21112,/vol/voly,blx' -> '21112,/vol/volyblx' '21113,/vol/eng,blz' -> '21113,/vol/engblz' '21114,/vol/eng,file' -> '21114,/vol/engfile'
Update: Slightly changed code example to enhance clarity.
Give a man a fish: <%-{-{-{-<
|
|---|