develooper Front page | perl.beginners | Postings from January 2002

split to hash?

Thread Next
January 30, 2002 01:21
split to hash?
Message ID:
is there a better way of building a hash from a file than this?

  while (<FILE>){
     ($mt,$te) = split /;/,<FILE>;		
    $tt{$mt} = $te;

I tried:
($mt,$te{$mt}) = split /;/,<FILE>;

even though I expected it to fail; the use of @_ seems to fail too.

Any hint is appreciated

thanks,  Stefan
Die sicherste Form der Kommunikation: E-Mails verschl├╝sseln, Spam-Filter, 
Adressverifizierung, digitale Unterschrift:
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About