All you need to do is define the main space with package main; ... you can see an example of that here: XML::Simple + Class::MethodMaker.
Are you sure, however, that you really want to bless scalars like that? You need to bless the reference, not the scalar itself. Perhaps you meant something like this instead:
my $self = { message => "This is dick", }; bless ($self, $class);
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Can I do single-file, Object oriented perl?
by jeffa
in thread Can I do single-file, Object oriented perl?
by FatDog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |