Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Split using multiple conditions

by kaif (Friar)
on Jun 13, 2005 at 01:56 UTC ( [id://466029]=note: print w/replies, xml ) Need Help??


in reply to Re: Split using multiple conditions
in thread Split using multiple conditions

Unfortunately, this doesn't do quite what the original poster asked for. Consider [id://bart]'s code snippet above and plug it into yours:

$_ = 'FDR [62.10060.051-F] [62.10051.381] [this includes spaces!] 0 1 +0'; ($nobrackets = $_) =~ s/(\[|\])//g; @feeder_line = split ' ', $nobrackets; $\ = "\n"; print for @feeder_line; __END__ FDR 62.10060.051-F 62.10051.381 this includes spaces! 0 1 0

N.B.: I have removed the mys because my ($nobrackets = $_) ... results in the error message Can't use global $_ in "my" at - line 1, near "= $_" (the correct syntax is (my $nobrackets = $_) ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2024-04-23 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found