|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: testing values in returned rows
Date: Feb 9 2000 10:12PM
Louis Proyect writes:
> In the example below, @$row is never printed, but if I omit the if-test it
> does print "Feb 9, 2000". I have a feeling that this has something to do
> with the complexities of Object Perl that I have not yet mastered. In the
> meantime, any answers would be greatly appreciated.
> {if (@$row =~ /Feb/)
You are using @$row (an array) in a scalar context. This evaluates to
the number of elements in the array, not the contents of each element.
Your test should be written:
if(join(' ', @$row) =~ /Feb/) {
...
}
or something similar.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|