Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: [Perl 6] List of length 2 or...

by TimToady (Parson)
on Oct 22, 2008 at 16:24 UTC ( [id://718793]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = $fh.slurp.comb(/ ^^ (\T*) \t (\N*) /);
    
  2. or download this
    my %hash = $fh.slurp ~~ m:g/ ^^ (\T*) \t (\N*) /;
    
  3. or download this
    my %hash = ($0,$1 if / ^^ (\T*) \t (\N*) / for $fh.lines);
    
  4. or download this
    my %hash = do for $fh.lines {
        / ^^ (\T*) \t (\N*) / and $0,$1;
    }
    
  5. or download this
    my %hash = gather for $fh.lines {
        take / ^^ (\T*) \t (\N*) / || ();
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://718793]
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: (3)
As of 2024-04-26 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found