in reply to Split and the tears it caused me.

The second argument to split should be a scalar value, not an array. An array in a scalar context returns the number of elements in the array, in this case 2. $req then gets assigned 2.

In short, no need to split, just assign ($req, $ccode) = @data;

YuckFoo

Replies are listed 'Best First'.
Re: Re: Split and the tears it caused me.
by impossiblerobot (Deacon) on Feb 28, 2002 at 22:51 UTC
    Or, if you don't need the array for anything else (and those are the only two values returned/needed), skip the extra variable and do:
    while ( ($req, $ccode) = $sth->fetchrow_array() )

    Impossible Robot