in reply to Can I do single-file, Object oriented perl?
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can I do single-file, Object oriented perl?
by gellyfish (Monsignor) on Jul 05, 2005 at 16:43 UTC |