in reply to Re: reading from a file and splitting
in thread reading from a file and splitting

Since the use of these three variables causes such a huge program-wide performance hit, I would definately shy away from using them in a situation like this where split is so ideal.



Code is (almost) always untested.
http://www.justicepoetic.net/
  • Comment on Re: Re: reading from a file and splitting

Replies are listed 'Best First'.
Re: Re: Re: reading from a file and splitting
by Eva (Initiate) on Jan 18, 2004 at 00:01 UTC
    thank you, this is what i ended up with:
    open (file, "<file.txt"); @file = <file>; close (file); foreach $line(@file){ ($var1, $var2) = split(/\=\=/, $line); if($chat =~ /\b$var1\b/i){ #the item i was looking for print "$var2"; }