Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: $_ and filehandles

by Ven'Tatsu (Deacon)
on Aug 29, 2005 at 02:30 UTC ( [id://487326]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    <FILE>; #discard a line (one line is read in void context)
    my $salt = <FILE>; #provide scalar context so only one line is read
    my (@post, @time);
    ($post[$#post + 1], $time[$#time + 1]) = split(/;/) while (<FILE>);
    print "@post\n@time\n";
    
  2. or download this
    my (undef, $salt, @post, @time) = (scalar(<FILE>), scalar(<FILE>)); #f
    +orce scalar context.
    ($post[$#post + 1], $time[$#time + 1]) = split(/;/) while (<FILE>);
    print "@post\n@time\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found