I need to change perl script, but I am new to perl. Script is too long
to copy here, but what I need is construct a reg ex pattern and store
in variable. I need to concatenate this from many other variables.
Then I must use this variable to do a match. Something like this:
while (<>)
{
chomp;
my $pt = "\d" . "\s" . "\d";
if ( /$pt/ )
{
print("Match also using variable\n");
}
if ( /\d\s\d/ )
{
print("Match not using variable\n");
}
}
The second match work if you give input like "1987 1988", but I
cannot get first match to work. I must be confusing perl with /$pt/
but i don't know how to fix. Can someone give some hint, please?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/