why this doesn't work (tm)? :)

N

Nicholas Dronen

MP> print $i for $i(1..3);

MP> is there a reason, or simply just doesn't work?

Use this instead:

$ perl -wle 'print for 1..3;'
1
2
3

Regards,

Nicholas
 
B

Bart Lateur

Matija said:
print $i for $i(1..3);

is there a reason, or simply just doesn't work?

This syntax only works with $_ as an implied loop variable.

print for 1 .. 3;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top