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

Perl local *my_shit_sub = sub {}

Name: Anonymous 2011-04-11 8:10

Really, what the fuck.  Is there any point in defining subs this retarded way instead of normal-looking sub cool_sub {}?  It breaks caller and other things.  I fucking see it everywhere.

Name: Anonymous 2011-04-11 10:21

>>4
sub f1 {
        return 1 if @_[0] < 2;
        return @_[0] * f1(@_[0] - 1);
}

local *f2 = sub {
        return 1 if @_[0] < 2;
        return @_[0] * f2(@_[0] - 1);
};

# This works.
print f1(5), "\n";
# Holy shit, this works too!
print f2(5), "\n";


Inserting shit into global scope with my (like my *fartorial = sub {}, of course, doesn't work.

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