use strict; use warnings; package MyModule; use overload q{""} => q{printObject}; sub new { ... } ... sub printObject { # print your attributes here } package main; my $obj = MyModule->new(some => q{args}); ... print qq{$obj}; ...
I'm not sure either from your post whether this is what you want but here's hoping.
Cheers,
JohnGG
In reply to Re: how to pass object to a subroutine
by johngg
in thread how to pass object to a subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |