in reply to Dealing with split
You can still use split(), you just have to get a bit creative:
dsb
This @ISA my( $cool ) %SIG
UPDATE: Thanks to Grandfather for the heads up on interpolation of my \'s. I did this correctly in my tests, but posted it wrong...thanks again.$str = 'c:\temp\source\test\test.c@@main\com\etc c:\temp\source\test\t +est1.c@@main\com\test c:\temp\source\test\test3\test2.c@@main\com\etc +\test'; print map {"$_\n" if s/c:\\temp(.*?\.c)/$1/} split(/\s+|\@+/,$str);
SECOND UPDATE: I don't what happened between testing and posting that this code isn't working. It worked fine on my box.
THIRD AND (hopefully) FINAL UPDATE: Got it now. Thanks again to Grandfather.
dsb
This @ISA my( $cool ) %SIG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dealing with split
by GrandFather (Saint) on Feb 22, 2006 at 22:30 UTC | |
Re^2: Dealing with split
by perl_99_monk (Novice) on Feb 23, 2006 at 15:55 UTC | |
by dsb (Chaplain) on Feb 23, 2006 at 16:10 UTC |
In Section
Seekers of Perl Wisdom