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];
}