$ perl -MO=Deparse { package With; my $singleton = bless \my($x), __PACKAGE__; sub new { return $singleton } sub AUTOLOAD { return $singleton } sub can { return sub { return $singleton } } } { package WithOut; my $singleton = bless \my $x , __PACKAGE__; sub new { return $singleton } sub AUTOLOAD { return $singleton } sub can { return sub { return $singleton } } } ^D { package With; my $singleton = bless(\my($x), 'With'); sub new { return $singleton; } sub AUTOLOAD { return $singleton; } sub can { return sub { return $singleton; } ; } ; } { package WithOut; my $singleton = bless(\my($x), 'WithOut'); sub new { return $singleton; } sub AUTOLOAD { return $singleton; } sub can { return sub { return $singleton; } ; } ; } - syntax OK $
In reply to Re^2: syntax question
by JavaFan
in thread syntax question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |