because you are setting it to 1 every line
try ...BEGIN{$a=1};a++
better yet , why not use $. ?
this is the current line
-- vish
On 20 February 2012 07:33, 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
>
> Running this on Win7 (This is perl, v5.6.1 built for
> MSWin32-x86-multi-thread)
>
> I know it's an antiquated version of Perl, but it's what the company uses.
>
>
> Best Regards,
> Dov Levenglick
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl