* Mike Friedman <[EMAIL PROTECTED]> [2006-10-31 05:45]:
> You have to turn strict references off to do that, of course.
> (You _DO_ have strict on, right? :) )
Yes, I just didn’t add it to this oneliner because I haven’t
found a good way to turn strict off *only* for the dereference.
Something like this won’t work:
do { no strict "refs"; *$_ } = sub { ... };
`do` blocks aren’t lvalues. Closest I can seem to get is this:
my $glob = do { no strict "refs"; \*$_ };
*$glob = sub { ... };
The temporary seems unavoidable; apparently Perl’s grammar rules
(or even its semantics) are non-orthogonal here, in that it won’t
permit this:
*{ do { no strict "refs"; \*$_ } } = sub { ... };
That just throws an unspecified complaint about `{ no strict `.
Sigh.
--
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}
&Just->another->Perl->hacker;
#Aristotle
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/