in reply to Aliases upon aliases

I like this one better:

package Printable; use overload '""'=>sub { shift->() }; package main; sub make_printer{ my ($fmt)=shift; my $args=\@_; bless sub { sprintf $fmt,@$args },'Printable'; } my ($x,$y,$z); my $formatted=make_printer("%5d %5d %f\n",$x,$y,$z); while (++$x<10) { $y=$x**2; $z=1/$x; print $formatted; }

Aliases are your friend in Perl... :-)


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi

    Flux8