"I would also be interested in a stern talking to if the idea of global scalars for all 12 of the scalars used frequently in file1 would be considered an bad idea."
Global variables are indeed something to be avoided, but i think it is okay to break this rule as long as you understand why first. When i was an undergraduate, my classmates and myself were forced to avoid them. Relying on global variables is a bad habit theorectically, but realistically, they have been proven to be prone to producing pasta code.
Now, in your case i would turn those 12 scalars into one global array:or one global hash:# file1.pl our @angry_men = qw( Balsam Fiedler Cobb Marshall Klugman Binns Warden Fonda Sweeney Begley Voskovec Webber );
And then you need only declare that variable once in each script that needs it:our %diamond = ( 'Koh-i-Noor' => 186, Cullinan => 3106, Excelsior => 995.2, 'Star of Africa' => 520.20, 'Great Mogul' => 793, Orloff => 300, "Idol's Eye" => 70.2, Regent => 410, 'Blue Hope' => 45.52, Sancy => 55, 'Taylor-Burton' => 69.42, Hortensia => 20, );
More than likely you will want a hash (a good name is %conf), but sometimes an array makes more sense. Good luck. :)require '/full/path/to/file1.pl'; our @angry_men; our %diamond; # then later ... print $diamond{Cullinan}; $some_var = $angry_men[7];
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Sharing the scalar love?
by jeffa
in thread Sharing the scalar love?
by jcpunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |