Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Separating substrings from a main string

by blue_cowdawg (Monsignor)
on Jan 24, 2013 at 14:55 UTC ( #1015183=note: print w/replies, xml ) Need Help??

in reply to Re^2: Separating substrings from a main string
in thread Separating substrings from a main string

I gave you a template. If you have other requirements please engage your creativity and modify the template to suit you. Here's one way:

$ cat use strict; use Data::Dumper; my $foo=qq(> abcd1234 abcd abcd >xyz123 xyz); $foo =~ s/\n//g; my @f = split(/[\>]/,$foo); $_ = '>' . $_ foreach @f; print Dumper(\@f); $ perl $VAR1 = [ '>', '> abcd1234abcd abcd ', '>xyz123 xyz' ];

Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2016-10-26 12:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (340 votes). Check out past polls.