Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Simple file to array

by waxmop (Beadle)
on Jul 08, 2002 at 20:30 UTC ( [id://180311]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    joey___joey@yahoo.com
    martha___martha@aol.com
    
  2. or download this
    open (IN, "filename.txt") or die "can't open filename.txt!";
    while ( $line = <IN> ) {
    ...
      push @addresses, $parts[1];
    }
    close IN;
    
  3. or download this
    $names[0]
    
  4. or download this
    $addresses[0]
  5. or download this
    open (IN, "filename.txt") or die "can't open filename.txt!";
    while ( $line = <IN> ) {
    ...
      $hash{$name} = $address;
    }
    close IN;
    
  6. or download this
    
    print "joey's address is ", $hash{"joey"}, ".\n";
    

Log In?
Username:
Password:

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

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

    No recent polls found