Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: why can't I just cat the file???

by johngg (Canon)
on Feb 07, 2008 at 10:47 UTC ( [id://666770]=note: print w/replies, xml ) Need Help??


in reply to why can't I just cat the file???

print without arguments defaults to operating on $_ and you could also chomp all of your lines in one go. If you don't mind destroying the array you could do this (using defined to cope with blank lines)

chomp( my @yahoo = <DATA> ); print while defined( $_ = shift @yahoo );

I hope this is of interest.

Cheers,

JohnGG

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://666770]
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: (5)
As of 2024-03-29 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found