LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-20-2002, 09:22 PM   #1
sykkn
Member
 
Registered: Apr 2001
Location: Texas
Distribution: Mandrake 8.0, RedHat 7.1
Posts: 48

Rep: Reputation: 15
Perl Subroutine problem


I have a perl script that I am using to upload files to multiple servers. I wanted to move the subroutines out to a different file so I could use them in multiple scripts ( so i have script.pl and script.pm ), but this subroutine is not working whenever I call if from the outside file ( script.pm ) via require. If I leave the subroutine in the script file it works fine. Seems like it could have something to do with the array reference.

Code:
sub ivrSendVox($$$\@) {  
  ($ftp,$lang,$ivr,$rvoxlist) = @_;
  $ftp->cwd("$voxdir");  
  foreach $vox (@$rvoxlist) {
    if($ftp->ls($vox)) {
      renameVox($ivr,$vox);
      $mail = 1;
    } else {
      $ftp->put("$vox");
      $mail = 0;
    }
  }
  $ftp->quit;
  return $mail;
}
And I call the subroutine like this:


Code:
ivrSendVox($ftp,$lang,$ivr,@voxlist);
Thanks for any help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl subroutine call shifty_eyes Programming 2 10-01-2005 08:43 PM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 05:37 PM
Perl undefined subroutine /can't locate object method cobien Programming 1 11-17-2003 10:47 AM
Simple subroutine being passed an array WorldBuilder Programming 4 11-04-2003 12:02 AM
Need Perl/CGI help! Undefined Subroutine CragStar Programming 4 03-05-2002 07:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration