Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

(tye)Re: Splitting each word in a string

by tye (Sage)
on Jun 27, 2001 at 03:40 UTC ( #91784=note: print w/replies, xml ) Need Help??


in reply to Re: Splitting each word in a string
in thread Splitting each word in a string

trailing empty fields are removed - just like in awk. Which doesn't happen if you use /\s+/ as first argument

No, the default case is different from /\s+/ in that a leading empty field is ignored. The only way to get Perl to not strip trailing empty fields is to pass a 3rd argument to split, usually -1.

I won't complain about you having wasted my time by getting this wrong. This isn't comp.lang.perl.* and most of us like it that way. If you want to complain about people wasting your time, then comp.lang.perl.* is probably a better forum for you.

We're all here to have fun and there are plenty of us to answer questions quite correctly as well as incorrectly (and lots of shades of grey in between) and then discuss the results. Many of us end up learning a lot of Perl in the process, but such isn't the only purpose.

Sure, checking your answers before you post is prudent and polite, but so is not grousing at people when they make a mistake.

Have the appropriate amount of fun...

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Splitting each word in a string

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-01-25 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (66 votes). Check out past polls.

    Notices?