Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Recap: The Future of Perl 5

by shmem (Chancellor)
on Aug 23, 2018 at 22:29 UTC ( [id://1220964]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub fib {
      croak("…")  if @_ != 1;
    ...
      return $nth if $nth <= 1;
      return fib( $nth - 1 ) + fib( $nth - 2 );
    }
    
  2. or download this
    my $fib_die_msg = 'fib() takes one positive integer as argument, abort
    +ed';
    sub fib {
    ...
      return $nth if $nth <= 1;
      return fib( $nth - 1 ) + fib( $nth - 2 );
    }
    
  3. or download this
    sub fib {
      my($nth = shift) =~ m{^\d+$} and ! @_ or die $fib_die_msg;
      ...
    }
    
  4. or download this
    sub fib {
      my $nth = shift;
    ...
      return $nth if $nth <= 1;
      return fib( $nth - 1 ) + fib( $nth - 2 );
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found