in reply to how to change this code into perl

G'day perlnewbie012215,

You wrote (my emphasis):

"awk '...' ... can you guys help me write in perl"

Try: a2p - Awk to Perl translator

Update (additional information): As of v5.22.0, Perl no longer includes a2p (and other utilities) as part of the core distribution. See "perldelta: Utility Changes: find2perl, s2p and a2p removal". This suggests you should now use App::a2p.

— Ken

Replies are listed 'Best First'.
Re^2: how to change this code into perl
by ambrus (Abbot) on Aug 30, 2015 at 19:42 UTC

    Wow, nice! I thought this wouldn't work, but it turns out that a2p seems to handle it correctly, even with the FNR variable, and even gives not too ugly code,

    I guess I just had disappointments with s2p, which doesn't even know about the gsed extension of semicolons working as statement separators.