Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to call a function on each item after a split?

by Lotus1 (Chaplain)
on Oct 08, 2012 at 15:55 UTC ( #997843=note: print w/ replies, xml ) Need Help??


in reply to How to call a function on each item after a split?

The split function can get rid of the white space also.

#!/usr/bin/perl use strict; use warnings; my $str = "item1 | item2| item3 |item4| "; print ">$_<\n" foreach split /\s*\|\s*/, $str;


Comment on Re: How to call a function on each item after a split?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2014-09-19 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (144 votes), past polls