in reply to Simple OO question...

As a side note:

your style is very Perl4, you don't need to undef $variables or call functions() with &ampersand

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: Simple OO question...
by perlidiot123 (Acolyte) on Apr 30, 2019 at 13:38 UTC
    You're right. Understanding prototypes re Perl was never my strong suit. Old habits are hard to break.
      passing the object handle from sub to sub)
      &display_data($Tobj);

      alternatively call methods on the object

      $Tobj->display_data()

      For example

      #!/usr/bin/perl use strict; use lib './my_app'; use my_app::db; use my_app::page; my $dbh = my_app::db->connect(); my $page = my_app::page->new(); # create a page object for my $uid (1..3){ $page->init($dbh,$uid); # query database $page->display; }
      poj