$ perl -w -Mstrict nosemicolon.pl 5
{ $ARGV[0] || die "Usage: perl nosemicolon.pl NUMBER\n" } sub fib { if ($_[0] < 2) { $_[0] } else { fib($_[0] - 1) + fib($_[0] - 2) } } { print "Fibonacci numbers from 0 to $ARGV[0] are as follows:\n" } for (0 .. $ARGV[0]) { print "fib($_) = ", fib($_), "\n" } print "Thanks for using this software!\n"
In reply to Re: Programming in Perl without semicolon (strict)
by toolic
in thread Programming in Perl without semicolon
by buetow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |