Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Removing some part of string

by trizen (Hermit)
on Nov 02, 2011 at 13:18 UTC ( #935392=note: print w/replies, xml ) Need Help??


in reply to Removing some part of string

while (defined($_ = <DATA>)) { my (@array) = split(/,/, $_, 0); if ($array[-1] =~ /^\h*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct| +Nov|Dec)\./) { splice @array, -1; } print join(',', @array) . "\n"; } __DATA__ $line = U.S. abc xyz , newyork, USA, Feb. 2-4 $line =pqr ffg , Long Beach, california, Sep. 12-14 $line = Hello , St. Louis, Missouri, Mar. 29-31 $line = hello, How are u

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935392]
help
Chatterbox?
[choroba]: For my "internal" projects, I just have a thumb drive with --bare clones of the repos

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-01-23 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (192 votes). Check out past polls.