use strict; # look ma! no $_! ;) while (<DATA>) { s/\d\d(\d\d)\.(\d+)/$1$2/; print; } __DATA__ 1996.40637 1996.41064 1996.41199 1996.41467 1996.41882
UPDATE: ack! i see it now: you want =~, not = for your substitution lines.
Here is my above while loop with the implicit $_:
while ($_ = <DATA>) { $_ =~ s/\d\d(\d\d)\.(\d+)/$1$2/; print $_; }
UPDATE 2: re japhy
DOH! ;)
jeffa
In reply to (jeffa) Re: substr on $_
by jeffa
in thread substr on $_
by gisrob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |