in reply to Re: Dereferencing code refs with & vs. ->()
in thread Dereferencing code refs with & vs. ->()
But:#!/usr/bin/perl use strict; use warnings; my $ref = sub {print "Hello, world\n"}; $ref->(); &$ref(); # Look ma, I am using strict! __END__ Hello, world Hello, world
#!/usr/bin/perl use strict; use warnings; sub hello {print "Hello, world\n"}; my $ref = "hello"; $ref->(); __END__ Can't use string ("hello") as a subroutine ref while "strict refs" in +use
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Dereferencing code refs with & vs. ->()
by demerphq (Chancellor) on Sep 23, 2005 at 10:07 UTC | |
|