Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    print "\$main_object is of type (", ref $main_object, ")\n";
    $main_object->{blah} = 'blah';
    $main_object->get_session();
    
  2. 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)
    
  3. or download this
    my $object = bless( {}, 'My::Object' );
    
  4. or download this
    sub new {
       my ( $item ) = @_;
       my $class = ref $item || $item;
       return bless( {}, $class );
    }