Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Programming in Perl without semicolon (strict)

by toolic (Bishop)
on Jan 30, 2009 at 22:21 UTC ( [id://740342]=note: print w/replies, xml ) Need Help??


in reply to Programming in Perl without semicolon

To use the strictures, change $n to $ARGV[0] :)
$ 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"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found