Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • What happens if you write name(5) and there is a name array that only has 4 elements but there is also a name function?

    If it automatically switches to using the function if there is no element at the requested index then you get memoize for free!

    fibonacci(n) {
            if( n < 2 ) {
                    fibonacci(n) = 1
            else {
                    fibonacci(n) = fibonacci(n-1) + fibonacci(

  • Unfortunately, that's not how it works (or at least, I've never seen that effect). It binds to the function earlier then that, so you would probably get an error about the index being out of bounds or something.

    My guess is that the name(5) will autovivify and return a value of 0. I need to test this though.

    Andrew Whitworth