Loading ...
Sorry, an error occurred while loading the content.

remove

Expand Messages
  • Gregory Matthews
    Message 1 of 6 , Apr 4, 2002
    • 0 Attachment
      At 07:36 AM 4/3/2002 -0600, you wrote:
      > >I don't suggest using an array to store the ENTIRE file, but your method
      > >ends up doing almost the exact same thing. You read the entire file at
      > >once.
      > >Instead of reading all of the file as a LIST of lines and then joining
      > >them together, why not read the entire file as one string?
      >
      > > open FILE, "< $file" or die "can't read $file: $!";
      > > my ($contents, @words);
      > > {
      > > local $/;
      > > $contents = lc <FILE>;
      > > }
      > > @words = $contents =~ /\w+/g; # or however you wish to get them
      > > close FILE;
      >
      >Hey, I never thought of locally changing the input line separator to
      >nothing before. And the lc at once too...neat. Thanks Japhy! Always
      >handy to see a different way of doing things.
      >
      >Jeff Eggen
      >
      >
      >
      >Unsubscribing info is here:
      >http://help.yahoo.com/help/us/groups/groups-32.html
      >
      >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.