princepawn has asked for the wisdom of the Perl Monks concerning the following question:
yieldsmy $C='((w)hite|(b)lack)'; open F, $file; my ($c) = grep /$C\s+"princepawn"/i, <F>;
but you would think that alternation would realize that only one of the alternatives would bind right? But oh well.[ 'Black', undef, 'B' ]; ### or [ 'Black', 'W', undef ];
The other thing is it is too hard to get the first character from a string in Perl. If I can push and pop arrays, why can't i push and pop strings?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string processing and regexp alternation...
by mirod (Canon) on Jan 26, 2002 at 15:27 UTC | |
|
Re: string processing and regexp alternation...
by Juerd (Abbot) on Jan 26, 2002 at 16:29 UTC | |
|
Re: string processing and regexp alternation...
by n3dst4 (Scribe) on Jan 26, 2002 at 16:45 UTC | |
|
Re: string processing and regexp alternation...
by danger (Priest) on Jan 27, 2002 at 13:17 UTC |