in reply to Can I do single-file, Object oriented perl?
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can I do single-file, Object oriented perl?
by FatDog (Beadle) on Jul 05, 2005 at 19:27 UTC | |
by BUU (Prior) on Jul 05, 2005 at 21:28 UTC |