Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Request translation into Perl

Name: Anonymous 2006-06-26 10:56

I'm testing something, and I'm stuck trying to write a Perl equivalent of this function because Perl's syntax is made of ugly, rudimentary, hack and fail. Could you please show me how to do this very simple thing in Perl?

function f($i = 1, $r = 17) {
    return --$r <= 0 ? null : array($i => f($i + 2, $r), $i + 1 => f($i + 3, $r));
}

Thanks!

Name: Anonymous 2006-06-28 10:21

>>20

You are incredibly stupid. HURR ANONYMOUS FUNCTIONS WHO USES THOSE. Maybe everyone who comes from a functional programming background. Maybe people who care about closures, maybe people who care about doing anything more complex than formatting some poor HTML. What do you think ruby is all about? Those blocks are basically anonymous functions.

Python guy: @_@ Irrelevant and pointless. This thread isn't about you. It is about how PHP users are ignorant about programming.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List