in reply to wise ones, your help is needed

It would appear $text gets undef in it. To stop that, you can do:
$text = '' if not defined $text;


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: wise ones, your help is needed
by esolm (Acolyte) on May 02, 2001 at 21:14 UTC
    works like a charm
    while (( my $id1, my $text) = $sqlquery3->fetchrow_array) { $text = '' if not defined $text; push @list3, "$id1\t$text\n"; }
      The "more standard" (?) way of writing that would be:
      while (my ($id1, $text) = ...) { ... }
      That is, declaring both variables at the same time. It looks nicer that way, I feel.

      japhy -- Perl and Regex Hacker
Re: Re: wise ones, your help is needed
by damian1301 (Curate) on May 02, 2001 at 23:26 UTC
    Why use negation when there is always the handy-dandy unless loop? This works as well.

    $text = '' unless defined $text;
    And it is much clearer to read (at least to me) :)

    Tiptoeing up to a Perl hacker.
    Dave AKA damian

      I didn't use "unless" there, since "if not" is the same length, and it didn't hinder comprehension. (Not to mention 'unless' becomes 'if not' at compile-time, anyway.)

      japhy -- Perl and Regex Hacker