Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: a method to get words from a file into an array

by Juerd (Abbot)
on Aug 08, 2002 at 21:16 UTC ( [id://188741]=note: print w/replies, xml ) Need Help??


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.
      

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188741]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-26 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found