This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Fix C<$pkg::$var> precedence issues with parsing of C<::> =head1 VERSION Maintainer: Nathan Wiger <[EMAIL PROTECTED]> Date: 14 Aug 2000 Last Modified: 23 Sep 2000 Mailing List: [EMAIL PROTECTED] Number: 103 Version: 3 Status: Retracted Frozen since: v2 =head1 ABSTRACT Currently, trying to dynamically assign to unnamed classes is very difficult: $pkg::$var = $val; # error ${pkg}::$var = $val; # nope ${$pkg::$var} = $val; # you wish ${${pkg}::$var} = $val; # sorry ${"${pkg}::$var"} = $val; # works, but bleeech :-) The precedence and parsing of the :: operator should be fixed to allow easy access to anonymous package operations. =head1 NOTES ON RETRACTION I don't see any easy way of getting this to work without causing potentially really hairy problems with precedence. In particular check out: http://www.mail-archive.com/perl6-language%40perl.org/msg04058.html Which is actually a reply to Schwern's post, but that appears to be gone from the mail archives forever... =head1 DESCRIPTION In a perfect world, these should work in Perl 6: $var = 'RaiseError'; $DBI::$var = 1 ; # $DBI::RaiseError = 1 $pkg = 'Class'; $var = 'DEBUG'; ${${pkg}::$var} = 1; # $Class::DEBUG = 1 $subpkg = 'Special'; $class = $pkg . '::' . $subpkg; require $class; # require Class::Special $mypkg = 'Some::Package::Name'; $ret = $mkpkg::do_stuff(@a); # is &{"${mypkg}::do_stuff"}(@a) now Currently, the precedence of :: does not allow these operations. Some of the above examples may still require additional braces, but they shouldn't require the types of contortions currently needed. =head1 IMPLEMENTATION Unfortunately, I don't have the time to think this part up yet. :-( I will gladly contribute to the precedence and parsing rules discussions that will ensue in the future if this RFC is accepted. =head1 REFERENCES Programming Perl, 2ed, for the ${"${pkg}::$var"} syntax RFC 222: Interpolation of method calls