<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1036558" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1036558</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-oo-containment-confusion#comment-1210378</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;StuPeas;210376 wrote:&lt;/strong&gt; Thanks alot Abhishek.  One more question; what if the two packages were in the same file, would &#039;use&#039; need to be used then ?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;That&#039;ll work too -- no need for &lt;strong&gt;use&lt;/strong&gt; if they&#039;re in the same file.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Whether you should group multiple packages/classes in a file is an interesting question.  Some people dislike the Java tradition of putting every class in its own file.  In this case, they might prefer to group Person and Fullname.  For others, it may make more sense to separate them.  Naturally, Perl accepts both approaches.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Personally, I&#039;d separate them because I prefer to put each package in its own file, though not each class.  I really don&#039;t like how packages are classes in Perl.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Nov 2006 10:59:04 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1210378 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-oo-containment-confusion#comment-1210376</link>
    <description> &lt;p&gt;Thanks alot Abhishek.  One more question; what if the two packages were in the same file, would &#039;use&#039; need to be used then ?&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Nov 2006 09:48:19 +0000</pubDate>
 <dc:creator>StuPeas</dc:creator>
 <guid isPermaLink="false">comment 1210376 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-oo-containment-confusion#comment-1210370</link>
    <description> &lt;p&gt;1.  Why do you think the Fullname object should be blessed into Person?  When bless is called in the Person constructor, $self refers to the hash containing FULLNAME and AGE, not the Fullname object itself.&lt;/p&gt;
&lt;p&gt;2.  You&#039;re right.  Person.pm must call &lt;strong&gt;use Fullname;&lt;/strong&gt;.  If Perl tries compiling that without the use call, it should report an error about stuff not being found.  The perltoot docs don&#039;t provide complete code.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;3.  %s represents a substitution flag.  How it works is each %s is replaced by subsequent arguments to printf in order.  E.g. &lt;strong&gt;printf &quot;%s%s&quot;, &quot;foo&quot;, &quot;bar&quot;&lt;/strong&gt; will print &lt;strong&gt;foobar&lt;/strong&gt;.  In the test script, &lt;strong&gt;$him-&amp;gt;name&lt;/strong&gt; is evaluated and substituted at the first %s, and &lt;strong&gt;$him-&amp;gt;fullname-&amp;gt;as_string&lt;/strong&gt; at the second %s.&lt;/p&gt;
&lt;p&gt;It&#039;s effectively like &lt;strong&gt;printf $him-&amp;gt;name . &quot; is really &quot; . $him-&amp;gt;fullname-&amp;gt;as_string . &quot;. \n&quot;;&lt;/strong&gt; if that&#039;s what you&#039;re used to.  See the printf doc for more.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Nov 2006 05:43:45 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1210370 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
