Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling script (.pl) subroutine from package's module.

Status
Not open for further replies.

Nasernassar

Programmer
Joined
Apr 27, 2007
Messages
2
Location
US
Can we call Script subroutine from package's module?
As example:

If I have script test.pl has subroutine sub getFileName,
In the other hand I have module called testm.pm and it has pakage called callSub, from callSub how can I call getFileName in test.pl ?
 
Code:
&main::getFileName;

or

Code:
&::getFileName;

-------------
Cuvou.com | The NEW Kirsle.net
 
As Kirsle demonstrated, yes you can.

But this is not very good program design. Instead, pass this value as a parameter to the testm module, or create a secondary module for the getFileName function. Probably the former is the best method in this case.

- Miller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top