Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Process multiple input files using a one-liner

by choroba (Cardinal)
on Jan 28, 2016 at 12:35 UTC ( [id://1153845]=note: print w/replies, xml ) Need Help??


in reply to Process multiple input files using a one-liner

The problem is that $. is not reset to 1 when the diamond operator opens a new file. See eof on how to detect each file's end.
$. = 1 if eof;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Process multiple input files using a one-liner
by Discipulus (Canon) on Jan 28, 2016 at 12:39 UTC
    i think
    close ARGV if eof;
    is more adequate, me too i've resetted $. but is deprecable imho.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      Works perfectly now, thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1153845]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found