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:
Let the holy wars commence.my $schwartzian = [ @_ ]->map(...)->sort(...)->map(...);
--
John.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: autobox
by thelenm (Vicar) on Oct 14, 2003 at 16:28 UTC |