Perl Subroutine |
Perl Subroutine |
SteveD |
Feb 4 2007, 06:10 PM
Post
#1
|
Newbie Group: Members Posts: 18 Joined: 16-November 06 From: Iowa Member No.: 936 |
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 |
Feb 5 2007, 10:41 AM
Post
#2
|
Serious Coder Group: Members Posts: 251 Joined: 6-January 07 From: Sherbrooke, Qc, Canada Member No.: 1,477 |
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 post has been edited by Effovex: Feb 5 2007, 10:41 AM |
Lo-Fi Version | Time is now: 21st September 2024 - 02:33 PM |