geektron has asked for the wisdom of the Perl Monks concerning the following question:
the counter would increment, but the print never occurred.my $counter; foreach my $elem ( keys %users ) { $counter++ and print "found $users{$elem} if ( $users{$elem}{sales +} - $users{$elem}{payments} > 0; }
return status of print is always 1, and the return value of $counter++ should have been 1, because the counter was incremented ( as evident after the loop. so why would i get a counter increment and not a print?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: idiom question
by Paladin (Vicar) on Jan 17, 2004 at 19:03 UTC | |
by geektron (Curate) on Jan 18, 2004 at 07:22 UTC | |
|
Re: idiom question
by Roger (Parson) on Jan 18, 2004 at 01:35 UTC | |
by geektron (Curate) on Jan 18, 2004 at 07:26 UTC | |
|
Re: idiom question
by davido (Cardinal) on Jan 18, 2004 at 05:30 UTC | |
|
Re: idiom question
by dd-b (Pilgrim) on Jan 17, 2004 at 18:53 UTC | |
by geektron (Curate) on Jan 18, 2004 at 07:21 UTC | |
|
Re: idiom question
by thor (Priest) on Jan 18, 2004 at 16:17 UTC | |
by geektron (Curate) on Jan 18, 2004 at 20:18 UTC |