My latest question is kinda basic (Always learning here). I need to pass resultant vars from an sql query to the object methods directly, if it's possible. For instance:
# 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);
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.

In reply to Simple OO question... by perlidiot123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.