Steven Manross graced perl with these words of wisdom:
> R U sure it's not the while loop.. I've never seen that incantation
> b4.. But that's not surprising.. I'm not the most traveled perler..
That while loop is how you process a file line by line.
--
Ted Schuerzinger
The way I see it, y
hey all,
Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and
other documentation creatures to no avail. I'm trying to match a pattern that's
already (must be) in a variable like so:
$var = "coyote";
while () {
if ($_ =~ /$var/i) {
print $_ . " matches\
At 04:58 PM 3/3/2004, Moulder, Glen wrote:
hey all,
Scratchin' my head on this one for a couple of hours now, looking at
camels. sheep and other documentation creatures to no avail. I'm trying
to match a pattern that's already (must be) in a variable like so:
$var = "coyote";
while () {
if (
y, March 03, 2004 2:58 PM
To: perl-win32-users
Subject: Regex matching of patterns in variables
hey all,
Scratchin' my head on this one for a couple of hours now, looking at
camels. sheep and other documentation creatures to no avail. I'm trying
to match a pattern that's alre
Works fine here - 'course the '.' in Wile E. is going to match any char
so:
Wile E. Coyote
matches
Wile Ej Coyote
matches
Wile E. Coyotexxx
matches
using quotemeta or \Q:
#my $var = "coyote";
my $var = quotemeta "Wile E. Coyote";
while () {
if ( /$var/oi) {
print $_ . " matches\n";
}
hey all,
Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and
other documentation creatures to no avail. I'm trying to match a pattern that's
already (must be) in a variable like so:
$var = "coyote";
while () {
if ($_ =~ /$var/i) {
print $_ . " matches\n