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

Pages: 1-

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 8:12

>>1
>butthurt faggot

Name: Anonymous 2011-04-11 8:54

>>2
I forgot to sage, but so did you, thus your remark is legally void.

Name: Anonymous 2011-04-11 10:13

>>1
The my_shit_sub wouldn't be reachable inside your sub, and you wouldn't be able to recurse.

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.

Name: Anonymous 2011-04-11 10:29

>>5
Don't hide your spam in ``decent'' posts.

Name: Anonymous 2011-04-11 10:32

>>6
FAUCTORISMAL

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