I am trying to in-place edit a bunch of text files using Perl\'s in-place edit operator $^I. I traverse through the directory using the diamond (<>) operator like this:>
I would use Iterator::Files, see http://search.cpan.org/perldoc/Iterator::Diamond for reasons why
use Iterator::Files; my $input = Iterator::Files->new( files => [ glob "*.txt" ] ); while( <$input> ){ s/((?:^|\s)-?)(0+)(?=\s|$)/$1.$2/g; print; }