Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Reading Files

by kielstirling (Scribe)
on Nov 02, 2012 at 05:46 UTC ( [id://1001913]=note: print w/replies, xml ) Need Help??


in reply to Reading Files

Hi, add \s+ to your regex to split on a space
perl -MData::Dumper -e 'print Dumper split /\s+/, shift' "do cat fr"

Replies are listed 'Best First'.
Re^2: Reading Files
by perlguru22 (Acolyte) on Nov 02, 2012 at 05:50 UTC

      Yes, like that if your input is split's default arugment $_.
      Or in your case:
      my @words = split/\s+/,$word;

      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2026-01-14 02:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.