Normally when I hit reply, I will see the greater sign > on the original
post, but this time it is not there and I do not know how to set up the
outlook express. I will try to experiment with the outlook express later.
Sorry about that.

Coming to the point, put qutoes on 'i am fred     flintstone' and thats what
you want; like this :-
while ( < 'i am fred     flintstone' >)

-- results I got from your script after putting quotes ---
matched: |i am <fred     flintstone>|


--- end of msg -----

----- Original Message -----
From: "Egor Brandt" <[EMAIL PROTECTED]>
HI!
Studying 'Learning Perl, 3rd edition' I was stopped, suddenly, by C. 8's
Exercise 1, using the pattern_test program.
the following works fine:
#!/usr/bin/perl -w

while (< alfred >) {
if (/fred/) {
print "matched: |$`<$&>$'|\n";
} else {
print "no match.\n";
}
}
but when I try the following:
#!/usr/bin/perl -w
while ( < i am fred     flintstone >) {
if (/\b(fred|wilma)\s+flintstone\b/) {
print "matched: |$`<$&>$'|\n";
} else {
print "no match.\n";
}
}

i get:
no match.
no match.
no match.
no match.

Im on Windows ME, MS-DOS box. Thank you for your time!





_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to