autobox "endows Perl's core datatypes with the capabilities of first-class objects".

This is best demonstrated with an example:

#!/usr/bin/perl5.8.1-autobox -w use autobox SCALAR => 'Print'; package Print; sub print {print $_[0], "\n"}; 1; "Just Another Perl Hacker"->print(); __END__

And when you run it:

$ ./autobox.pl It's Perl Jim, but not as we know it.

Or (perhaps) the first autobox JAPH (with the above Print in a separate package):

perl5.8.1-autobox -Mautobox="SCALAR,Print" -MPrint -e '"Just Anoth +er Perl Hacker"->print()'

Or consider the following example from the pod:

my $schwartzian = [ @_ ]->map(...)->sort(...)->map(...);
Let the holy wars commence.

--
John.

Replies are listed 'Best First'.
Re: autobox
by thelenm (Vicar) on Oct 14, 2003 at 16:28 UTC

    For further reference, this was also discussed at length on perl5-porters. You can find the discussion archived here.

    -- Mike

    --
    XML::Simpler does not require XML::Parser or a SAX parser. It does require File::Slurp.
    -- grantm, perldoc XML::Simpler