perlidiot123 has asked for the wisdom of the Perl Monks concerning the following question:
This is a very simple version of my current code... How to eliminate the second step with declared vars... and third step, passing the sql return values directly to the $Tobj, instead of using declared variables first? Thanks folks! PS: I've been on an intense learning curve with OO perl, as well as developing all new code using my own developed modules, (basically taking a bunch of variables and keeping them in their own name space, passing the object handle from sub to sub)... been away from development for a few years since my last post here https://perlmonks.org/?node_id=1129157 <- the response I got was amazing. Thanks to all that helped me out, and gave me very important guidance on how to proceed at the time in 2015. The folks here are fantastic! They need to add a tip jar here as I would love to donate a few bucks to everyone that responded then.# First Step my $query=qq~select name,text from pages where uid='1'~; # Second Step my($name,$text)=&sthqf($query); # Sub that handles all single row quer +ies # Third Step $Tobj->name($name); $Tobj->text($text); undef ($name,$text,$query); &display_data($Tobj);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple OO question...
by holli (Abbot) on Apr 30, 2019 at 02:28 UTC | |
by perlidiot123 (Acolyte) on Apr 30, 2019 at 03:49 UTC | |
by Your Mother (Archbishop) on Apr 30, 2019 at 04:23 UTC | |
|
Re: Simple OO question...
by LanX (Saint) on Apr 30, 2019 at 10:44 UTC | |
by perlidiot123 (Acolyte) on Apr 30, 2019 at 13:38 UTC | |
by poj (Abbot) on Apr 30, 2019 at 19:05 UTC | |
|
Re: Simple OO question...
by trippledubs (Deacon) on May 01, 2019 at 03:20 UTC | |
|
Re: Simple OO question...
by shmem (Chancellor) on Apr 30, 2019 at 15:56 UTC |