in reply to strings with options - how do I do this?
#!/usr/bin/perl -wT use strict; my $text = "my text [and maybe|and here's] more text [the end|stop]"; my @arr = parseit($text); print "$_\n" for @arr; sub parseit { my $text = shift; for ($text) { s/\[/{/g; s/\]/}/g; s/\|/,/g; } glob($text); } __END__ my text and maybe more text the end my text and maybe more text stop my text and here's more text the end my text and here's more text stop
-Blake
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: strings with options - how do I do this?
by Hofmator (Curate) on Feb 27, 2003 at 10:31 UTC | |
by blakem (Monsignor) on Feb 27, 2003 at 11:04 UTC | |
by Anonymous Monk on Feb 27, 2003 at 13:32 UTC | |
Re: Re: strings with options - how do I do this?
by danmcb (Monk) on Feb 27, 2003 at 10:27 UTC | |
Re^2: strings with options - how do I do this? (KGlob)
by tye (Sage) on Feb 27, 2003 at 18:22 UTC |
In Section
Seekers of Perl Wisdom