in reply to Fetching data

You'll need to put parentheses around the word you want to capture if you want to save it to a variable
my $data = "this is a character array"; my($str) = $data =~ /(char.{2}ter)/;
Also you shouldn't be escaping non-meta characters as they'll be confused for something else e.g when you escaped 'a' character it was interpreted as an ASCII BEL characer (which emits a bleep on the command line when printed).
Check out the perl regex man page for more info on regular expressions.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Fetching data
by Anonymous Monk on Apr 26, 2002 at 16:39 UTC
    Thank you broquaint. Your answer helped me correct my problem!