- or download this
#!/usr/bin/perl
...
print "\$main_object is of type (", ref $main_object, ")\n";
$main_object->{blah} = 'blah';
$main_object->get_session();
- or download this
Can't locate object method "get_session" via package "main" (perhaps
you forgot to load "main"?) at bless_main.pl line 8.
$main_object is of type (main)
- or download this
my $object = bless( {}, 'My::Object' );
- or download this
sub new {
my ( $item ) = @_;
my $class = ref $item || $item;
return bless( {}, $class );
}