I am wondering what the proper behavior of binding to a sub's return
value should be

sub some_routine {
    my $foo = 42;
    return $foo;
}
my $rv := some_routine();

Should $rv be bound to $foo or to a copy of $foo?  I ask because with
state() and closures, it makes a difference since the value can
change.

sub some_rourtine {
    state $foo = 42;
    return $foo++;
}

My apologies if this has been previously discussed or is documented
somewhere.  I am still playing catch up.  Ok, ok - it's true - I am
looking for a little instant gratification.

Cheers,
Joshua Gatcomb
a.k.a. L~R

Reply via email to