Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How do I combine SPLIT with trimming white space

by Fletch (Bishop)
on Aug 11, 2009 at 16:58 UTC ( [id://787702]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $entry ( split( /;/, $file_data ) ) {
      do { s/^\s+//; s/\s+$//; } for $entry;
      push @email_list, $entry;
    }
    
  2. or download this
    print join( "\n", sort map { (my $t=$_)=~s/^\s+//;$t=~s/\s+$//;$t } sp
    +lit( /;/, $file_data ) ), "\n";
    
  3. or download this
    my @email_list = sort map ... split( /;/, $file_data );
    print join( "\n", @email_list ), "\n";
    

Log In?
Username:
Password:

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

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

    No recent polls found