[Israel.pm] perl -i -pe question

Dov Levenglick dov.levenglick at gmail.com
Sun Feb 19 23:33:50 PST 2012

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

More information about the Perl mailing list