Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Printing all lines of a file using a perl one liner

by Util (Priest)
on Sep 28, 2011 at 21:56 UTC ( #928435=note: print w/replies, xml ) Need Help??


in reply to Printing all lines of a file using a perl one liner

Add the -w flag to turn on warnings (-wne instead of -ne).
This might help you see that you are using $a1 $a2 $a3 where you probably meant to use $a[1] $a[2] $a[3].

Update: I see that I misread your post, because you did not put your code into < code >...</ code > tags. This is making $a[1], etc display incorrectly in our browsers.

Update2: I give you points for trying for code tags, even though it went awry. The "preview" button is your friend! (and I need to read more slowly )

Replies are listed 'Best First'.
Re^2: Printing all lines of a file using a perl one liner
by la (Novice) on Sep 28, 2011 at 22:29 UTC
    thanks for the tips!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-05-28 22:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (166 votes). Check out past polls.

    Notices?