angie ahl <[EMAIL PROTECTED]> wrote: : : I'm trying to get the value of $1 into a var, the following : don't work and I can't figure out why : : $_ = $html_body; : my ($resrow) = m#<!-- VM: resrow -->(.*?)<!-- VM: /resrow -->#; : #print $1; : print $resrow; : : $resrow holds nothing, however if I print $1 I do have a : match : : $_ = $html_body; : m#<!-- VM: resrow -->(.*?)<!-- VM: /resrow -->#; : my $resrow = $1; : print $resrow;
Perhaps $html_body does not hold what you think it holds. Commenting one line or the other seemed to work fine for me. $_ = q|<!-- VM: resrow -->foo<!-- VM: /resrow -->|; my ($resrow) = m#<!-- VM: resrow -->(.*?)<!-- VM: /resrow -->#; print $1; print $resrow; __END__ Prints: foofoo HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes, Inc. Mobile Home Specialists 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>