On Jan 8, 2004, at 10:38 AM, Dan Muey wrote: [..]
The vars to be assigned ($var1, $var2,etc...) come from a
database query so they are handled already earlier. So how
they are declared are irrelevant to the issue. (Yes they must be
initialized for a warnings safe environment and they are, just
assume that they are so the issue is not clouded by where they come from.)

I think I better see the context at this point. note, as I presume you did

        my ($var1,$var2,$var3,$var4) = ('', 'bob', '', '');
        print "($var1,$var2,$var3,$var4)\n";
         ($var1,$var2,$var3,$var4) = db_query();
        print "($var1,$var2,$var3,$var4)\n";
        #------------------------
        #
        sub db_query
        {
                my ($input) = @_;
                
                ('',$input);
                
        } # end of db_query

will explode on the second print statement - since the
little db_query() returned only two of four possible variables,
and in this case three of them are undef and thus 'resetting' the values.
[..]


hence the problem being that mere 'initialization' alone
is not going to 'save the day'.

Bob's example does this quite perfectly, thanks again Bob!\

yeah, I can see that now.



ciao drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to