Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Common Perl Idioms

by eric256 (Parson)
on Jul 23, 2004 at 18:04 UTC ( [id://376948]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Tye + Juerd in id=204874
    sub slurp {  local( *ARGV, $/ ); @ARGV = shift; <> };
    
    # slurp a bunch of files
    @files = do { local(@ARGV, $/) = @filenames; <> };
    
  2. or download this
    # get the indexes of items in an array
    @foo{ @foo } = 0 .. $#foo;
    ...
      $i++ while $_[$i] ne $target;
      return $i==$#_ ? undef : $i
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://376948]
Approved by dragonchild
Front-paged by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found