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

split to hash?

Thread Next
From:
stefan.kredler
Date:
January 30, 2002 01:21
Subject:
split to hash?
Message ID:
200201300915.g0U9F1C12881@mailgate5.cinetic.de
is there a better way of building a hash from a file than this?

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

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: http://freemail.web.de
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About