On Mon, Feb 20, 2012 at 9:33 AM, Dov Levenglick <[email protected]>wrote:
> Why isn't $a incrementing in this one-liner: > perl -ibak -pe "$a=1; $a++ if (s/ ADDR_RESET_PAIR/ $a > ADDR_RESET_PAIR/);" file.txt > -p is line based. Perhaps $a is getting initialized every time. If it doesn't maintain the scope, there is no way it will work.
_______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
