in reply to trouble taking reference of function
Perl's builtins aren't generally made available as subs you can take a reference to. This works though:
my $foo = sub { sin(@_) }; print $foo->(0.5), "\n";
-sam
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: trouble taking reference of function
by ikegami (Patriarch) on Mar 03, 2009 at 21:25 UTC | |
by Lawliet (Curate) on Mar 03, 2009 at 22:00 UTC | |
by kyle (Abbot) on Mar 03, 2009 at 22:17 UTC | |
by Lawliet (Curate) on Mar 03, 2009 at 22:36 UTC | |
by kyle (Abbot) on Mar 03, 2009 at 22:42 UTC |
In Section
Seekers of Perl Wisdom