Help - Search - Members - Calendar
Full Version: Perl Subroutine
HTMLHelp Forums > Programming > Server-side Scripting
SteveD
I have used subroutines in Perl before, inside the same file, but I would like to create a subroutine, or a set of subroutines, stored in their own file, then called from other files.

My guess is that in the calling program I would do a - use MODULE (name); at the top, then call the subroutine as I always have.

In the file of subroutines each subroutine would be defined as I have always done in the past.

Am I close?

Thanks,
Steve
Effovex
I'm not very familiar with Perl, but the synopsis for subroutines in the perl documentation says that to import a subroutine, you have to go
QUOTE
use MODULE qw(NAME1 NAME2 NAME3);


Which points to you being right.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.