in reply to Re: Complicated pattern match
in thread Complicated pattern match
No, that don't work. Your first line will substitue any A-Z character in $A with a pipe, which means all characters in this case since $A doesn't contain anything else. Then you split on pipes, which gets you a @values full of empty strings. Then you map in void context..
If you leave out the substitution and split on nothing, it “works”:
Except all it does is split $A into characters and print them on a line each. I have no idea how that is supposed to solve the poster's problem though, since it doesn't even look at $B. The if is superfluous as well, since every element of @values is guaranteed to contain one character from $A.my @values = split //, $A; map { if ($_ ne "" ) {print "[$_]\n";} } @values;
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Complicated pattern match
by OM_Zen (Scribe) on Jan 19, 2003 at 18:10 UTC | |
by Aristotle (Chancellor) on Jan 19, 2003 at 19:01 UTC |