[EMAIL PROTECTED] wrote:
"Jeff Pang" <[EMAIL PROTECTED]> writes:
On Dec 3, 2007 10:12 AM, <[EMAIL PROTECTED]> wrote:
#!/usr/local/bin/perl -w
use strict;
use warnings;
my @ar = ();
for(@ar){
print "$_\n";
}
But running that script just does nothing but gleefully print a
newline.
mhh? It won't print a newline, it even won't print anything.
b/c @ar is empty, for(...) doesn't go into it, 'print' won't be happened.
Yeah your right... (what was I thinking...) but my point was that it
seems perl should say something about this. It seams at least as
significant as trying to use an undeclared var.
I would say it was more like
$total = $total + $value;
when $value was zero. Would you expect a warning then?
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/