Or just let perl insert those semicolons for us.
BEGIN { use Filter::Util::Call; filter_add(sub { + my $s = filter_read(); s/$/;/mg; $s; }); } + use warnings use strict my $n = shift || 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 $n are as follows:\n" for (0 .. $n) { print "fib($_) = ", fib($_), "\n" } print "Thanks for using this software!\n"
In reply to Re: Programming in Perl without semicolon
by ambrus
in thread Programming in Perl without semicolon
by buetow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |