How to test result of an extraction?
- From: rmalghan@xxxxxxxxx (Ravi Malghan)
- Date: Thu, 27 Apr 2006 10:52:48 -0700 (PDT)
Hi: I am extracting some value from $complete_event as
follows. What can I check to see if the extraction
returned a valid value? "if($_)" seems to be giving
incorrect values. In the following statement, $srcIp
is being set to an old extracted value if there is no
valid value following srcIP in my $complete_string
instead of 0.
$complete_event =~ /srcIp=(.+) srcPort=/;
if($_) {$srcIp = $1;}
else {$srcIp = 0;}
Thanks
Ravi
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.
- Follow-Ups:
- Re: How to test result of an extraction?
- From: D. Bolliger
- Re: How to test result of an extraction?
- References:
- Re: Chomp method
- From: Mr. Shawn H. Corey
- Re: Chomp method
- Prev by Date: Re: #$ary ??? (was: Re: problem with whitespace not splitting on split. -SOLVED - with followup)
- Next by Date: RE: How to test result of an extraction?
- Previous by thread: Re: Chomp method
- Next by thread: Re: How to test result of an extraction?
- Index(es):
Relevant Pages
|