In the beginning of a Perl Romance, your skills will get better every hour you spend learning and writing perl, similar to Moore's law. So, every time you look back at your past work, you are always disappointed. The beauty and nature of Perl is so that, you will solve your problem now, and that is a beautiful thing, and you will also recognize more problems that Perl can solve and will keep coming back.

It is always best to post some compilable code here so we get an idea of the context of your question. Here are some random ways to call subroutines and I think the pitfalls become evident of bad design choice. The principles are: have very descriptive and appropriate variable names, and keep your namespace as uncluttered as possible. And, as in life, always do whatever you want. Counter example follows

#!/usr/bin/env perl package a; use strict; use warnings; use lib (','); sub double { return 2*$_[0]; } package main; use strict; use warnings; use feature 'say'; use Cowbell qw(thrice); sub double { return "$_[0]" . $_[0]; } sub twice { return a::double($_[0]); } say a::double(2); #4 say double(2); #22 say thrice(2); #6 say thrice(2) - twice(3) + double(22) + 1;
#!/usr/bin/env perl package Cowbell; use strict; use warnings; use Exporter 'import'; our @EXPORT_OK = qw (thrice); sub thrice { return 3*$_[0]; }

In reply to Re: Qualified module variables and arrays by trippledubs
in thread Qualified module variables and arrays by DarrenSol

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.