It's good practice to seperate the input from the output. It makes it easy to change the output format in the future. For example,
my @primes = qw( 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 ); local $, = ", "; local $\ = "\n"; print @primes;
;)
In reply to Re^2: Easiest way to list prime numbers 1 to 100 (one-liner)
by ikegami
in thread Easy way to list prime numbers 1 to 100
by l.frankline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |