in reply to why doesn't this foreach loop work?

foreach is a statement, not an expression. It cannot be used as an operand of && or any other operator. Try this instead:
if (defined $debug) { foreach my $key (sort keys %option) { print __LINE__ . ": $key = $option{$key}\n" if defined($option{$key}); } }

Replies are listed 'Best First'.
Re: Re: why doesn't this foreach loop work?
by blueflashlight (Pilgrim) on Jan 07, 2001 at 23:02 UTC
    thank you and bless you. that works. :-)