Re: retrieving info from file
From: Sam Holden (sholden_at_flexal.cs.usyd.edu.au)
Date: 10/20/03
- Next message: Peter: "Re: retrieving info from file"
- Previous message: sdfgsd: "Rookie: Constructing a large SQL INSERT statement"
- In reply to: Peter: "Re: retrieving info from file"
- Next in thread: Tad McClellan: "Re: retrieving info from file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 20 Oct 2003 01:50:45 GMT
On Sun, 19 Oct 2003 21:42:15 -0400, Peter <feurry@hotmail.com> wrote:
> i used the following
> $probe =~ m/\(-vop crop\=(\d+):(\d+):(\d+):(\d+)/;
> print "$1, $2, $3, $4\n";
> and it worked perfectly. Thanks a lot for your help!
if ($probe =~ m/\(-vop crop\=(\d+):(\d+):(\d+):(\d+)/) {
print "$1, $2, $3, $4\n";
} else {
warn "Couldn't extract data from: $_";
}
or something to that effect.
Always check if the regex matched, otherwise old values of $1, etc. will
be used and hard to find bugs will result.
Yes, always.
And you don't need to escape '=', it's just a plain old character.
-- Sam Holden
- Next message: Peter: "Re: retrieving info from file"
- Previous message: sdfgsd: "Rookie: Constructing a large SQL INSERT statement"
- In reply to: Peter: "Re: retrieving info from file"
- Next in thread: Tad McClellan: "Re: retrieving info from file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|