That's very wrong. You should only bless references. This piece of code here is bound to fail.package tom; sub new { my $self = "This is tom"; bless ($self, $class); }
I have tried creating a .pl file and the keyword "package" throws errors.Are you sure you're not trying to run it with perl4?
In reply to Re: Can I do single-file, Object oriented perl?
by bart
in thread Can I do single-file, Object oriented perl?
by FatDog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |