perlquestion
Melly
<p>Hi Monkees</p>
<p>I have a perl program that I'm rewriting to accommodate the growing list of requirements.</p>
<p>One thing I want/need to do is to have 3 different packages containing subroutines with, potentially, the same names (not a problem).</p>
<p>I will have a global package, GP, a local package, LP, and a file package, FP, so that people can call GP::format_date, or LP::format_date, etc.</p>
<p>My problem is the FP package. GP and LP are loaded at run-time, but FP needs to have its routines reloaded during the program's duration (basically, everytime I switch to a new file, I want to initialise and repopulate FP with routines defined in <i>filename</i>.lib</p>
<p>Any suggestions?</p>
<p>Another nice feature (although not essential) would be to allow the user NOT to specify the package name, and have the program default to FP::<i>routine</i> if it exists, then LP::<i>routine</i> if it exists, before finally defaulting to GP::<i>routine</i> (and returning an error if the routine doesn't exist in any package). I would also need the user to be able to over-ride this by explicitly specifying the package...</p>
<p>As I said, the last requirement is not essential - I can always require the users to specify the package, but it would be nice.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-66612">
<code>
map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2
-$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
</code>
Tom Melly, pm (at) cursingmaggot (stop) co (stop) uk
</div></div>