Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Programming in Perl without semicolon

by ambrus (Abbot)
on Feb 09, 2009 at 15:57 UTC ( [id://742468]=note: print w/replies, xml ) Need Help??


in reply to Programming in Perl without semicolon

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"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://742468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found