Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Split a sentence into words

by ikegami (Patriarch)
on May 30, 2009 at 07:05 UTC ( [id://767014]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >perl -le"'abc1def2' =~ /(?:([a-z])(?{ print $^N }))+2/"
    a
    ...
    d
    e
    f
    
  2. or download this
    use strict;
    use warnings;
    ...
       or die("No solution\n");
    
    print( join('-', @list), "\n" );  # abd-a-abc
    
  3. or download this
    ...
    
    ...
    die("No solution\n") if !@list;
    
    print("$_\n") for @list;
    
  4. or download this
    abd-a-a-bc
    abd-a-abc
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found