Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Suppose in the example,#!/usr/bin/perl my %text = map { $_ => 1 } ('&','”','&ldquo','''); while($line = <DATA>){ $line =~ s/(&(\w+?;)*)(\w+)(&(\w+?;)*)/exists $text{$1} ? $1 : defined + ($2)/eg; print $3; chomp; } __DATA__ ” How big are & the Brothers? ” “ One day hiere last wee +k, not knowing the cause, some floors of Rockefeller Center were evacuated when the floor shaking and screams of the lads' fans during a TV
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: check in an array for variable
by moritz (Cardinal) on Aug 13, 2009 at 07:32 UTC | |
by Anonymous Monk on Aug 13, 2009 at 08:32 UTC | |
|
Re: check in an array for variable
by baxy77bax (Deacon) on Aug 13, 2009 at 08:33 UTC | |
by Anonymous Monk on Aug 13, 2009 at 09:11 UTC | |
by moritz (Cardinal) on Aug 13, 2009 at 10:52 UTC | |
|
Re: check in an array for variable
by ikegami (Patriarch) on Aug 13, 2009 at 13:35 UTC |