Re: subroutines in .pm

2001-04-27 Thread Morbus Iff
>Does anybody know how to call a subroutine that is in a .pm file from >another .pm file. Welp, if &subroutine_1 is in Library1.pm, then within Library2.pm, you could do something like: sub subroutine_2 { require "/path/to/Library1.pm"; &subroutine_1; } Morbus Iff .sig on other

Re: subroutines in .pm

2001-04-27 Thread Michael Lamertz
Morse, Loretta ([EMAIL PROTECTED]) wrote: > > Hello, > > Does anybody know how to call a subroutine that is in a .pm file from > another .pm file. That depends: First you have to load the file via 'require' or 'use' - perldoc them. If your other .pm creates its own namespace, you need to addre

RE: subroutines in .pm

2001-04-27 Thread Morse, Loretta
is in file2.pm. Neither suggestion has worked so far, any other ideas out there? Thanks. -Original Message- From: Michael Lamertz [mailto:[EMAIL PROTECTED]] Sent: Friday, April 27, 2001 4:06 PM To: Morse, Loretta Cc: '[EMAIL PROTECTED]' Subject: Re: subroutines in .pm Morse, Loretta

RE: subroutines in .pm

2001-04-27 Thread Timothy Kimball
: I am using a WinNT system and I'm running a script that calls : a subroutine in file1.pm. Then file1.pm calls a subroutine : from file2.pm. The script can't seem to find the subroutine : that in is in file2.pm. Does your file1.pm have "use file2" in it? -- tdk

Re: subroutines in .pm

2001-04-27 Thread C.J. Collier
seem to find the subroutine > that in is in file2.pm. > > Neither suggestion has worked so far, any other ideas out there? > > Thanks. > > -Original Message- > From: Michael Lamertz [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 27, 2001 4:06 PM > To: M

Re: subroutines in .pm

2001-04-27 Thread Michael Lamertz
Morse, Loretta ([EMAIL PROTECTED]) wrote: > Thanks for the suggestions however I think I need to clarify > what I'm trying to do. > > I am using a WinNT system and I'm running a script that calls > a subroutine in file1.pm. Then file1.pm calls a subroutine > from file2.pm. The script can't seem

Re: subroutines in .pm

2001-04-27 Thread Johnathan Kupferer
Try throwing this into file2.pm: sub AUTOLOAD { print "What hath god wrought?\n" } And then call: file2->any_function_name; That is if you have a: use file2; AUTOLOAD is a catch all function, method really, but this should work considering how Perl blurs the line b

Re: subroutines in .pm

2001-04-27 Thread Paul
--- "Morse, Loretta" <[EMAIL PROTECTED]> wrote: > Hello, > > Does anybody know how to call a subroutine that is in a .pm file from > another .pm file. Given A.pm === package A; sub a { return "a!\n"; } 1; === and B.pm === package B; use A; sub b { print A::a(); } 1; ===

RE: subroutines in .pm

2001-04-30 Thread Morse, Loretta
PM To: Morse, Loretta; '[EMAIL PROTECTED]' Cc: [EMAIL PROTECTED] Subject: Re: subroutines in .pm --- "Morse, Loretta" <[EMAIL PROTECTED]> wrote: > Hello, > > Does anybody know how to call a subroutine that is in a .pm file from > another .pm file. Given A.pm