Phoenix.pm: new CPAN modules!

Scott Walters scott at illogics.org
Mon May 17 18:19:55 CDT 2004


Hey... getting ready to upload a new version of autobox::Core
and I wanted suggestions on other things that it should wrap as
methods on primitive types. Here's the existing documentation:

http://search.cpan.org/~swalters/autobox-Core-0.1/Core.pm

What else should you be able to do with an array variable, hash
variable, or scalar?

autobox is over here:

http://search.cpan.org/~chocolate/autobox-0.11/lib/autobox.pm

I'm also working on a module - 3 day hack - that rewrites the bytecode
of Perl 5 programs to change the context rules of Perl 5 to more closely 
resemble Perl 6's rules. Arrays and hashes when used as arguments in a subroutine
or method call don't flatten but instead send a reference to the 
subroutine. When used as a scalar, they also turn into a reference
to themselves unless they're in "numeric context". Perl 5 doesn't
really have numeric context but I'm faking it by looking at the
opcode and checking it against a list of opcodes that obviously
expect a number. So 0+ at foo gives the length of @foo, but 
my $foo = @foo takes a reference. This also makes bare arrays and
hashes work correctly with autobox: @foo->each(sub { print $_[0], "\n" })
prints out each element of @foo. autobox normally requires references
except in the case of scalars.

Okey, that's my report. Eagerly awaiting autobox::Core suggestions.
Cheers,
-scott



More information about the Phoenix-pm mailing list