Or I could just remove the $ from the call. $var1 = FOO::BAR::sub1();
works fine. I was referencing it like $FOO::BAR::sub1(); Thanks for the input however On Tue, Apr 8, 2008 at 1:12 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Tue, 2008-04-08 at 12:24 -0400, Jonathan Mast wrote: > > I know this seems to be a very basic question, but I cannot figure out > how > > to access a modules subroutines. > > > > We a module named FOO::BAR in which we access some hashes using this > form: > > $FOO::BAR::hash1 > > and it works fine. > > > > When I try to access a subroutine in that same module, using this form: > > $var1 = $FOO::BAR::sub1(); > > it doesn't work! > > > > Any ideas? > > I take it that in FOO::Bar you have something like: > > sub sub1 { > ... > } > > To access this subroutine: > > $var1 = FOO::BAR::sub1(); > > If, on the other hand, FOO::BAR has: > > our $sub1 = \&foo; > > sub foo { > ... > } > > To access it: > > $var1 = &( $FOO::BAR::sub1 )(); > > > -- > Just my 0.00000002 million dollars worth, > Shawn > > 99% of you are just big dumb apes! > > +------------\ > | Shangri La \ > | 40,000 KM / > +------------/ > >