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

Re: Split confusion

by perlfan (Vicar)
on Jun 03, 2020 at 15:21 UTC ( [id://11117658]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    $name = "SMITH JONES";
    @temp = split(/(-| )/,$name);
    print Data::Dumper::Dumper(\@temp);
    
  2. or download this
    $VAR1 = [
              'SMITH',
    ...
              ' ',
              'JONES'
            ];
    
  3. or download this
    my @temp = split(/(?:-| )/,$name);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-24 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found