Can the following code be done without any "code blocks"?
do {print "$_\n" if($_ > 3);} for (0..5);

This doesn't work:
print "$_\n" if($_ > 3) for (0..5);

In Python, you'd do something similar to:
print "$_\n" for (0..5) if($_ > 3);
but that doesn't work either.

If there a way to loop through a list and do a single statement on a
condition without using a {} block?

Thanks!

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


Reply via email to