in reply to a method to get words from a file into an array

words separated by a comma and a space.

sub readthingy { local @ARGV = @_; local $/ = ', '; return <>; # ref to array might be faster }

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: a method to get words from a file into an array
by sauoq (Abbot) on Aug 08, 2002 at 22:56 UTC
    sub readthingy { local @ARGV = @_; local $/ = ', '; return <>; # ref to array might be faster }

    This is not equivalent to the original. Ask yourself, "what happens to newlines?"

    -sauoq
    "My two cents aren't worth a dime.";
    

      This is not equivalent to the original. Ask yourself, "what happens to newlines?"

      Did I ever claim it was? Besides, if it were equivalent, there would be no point in posting it.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.