The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
if statements pwanda UNIX for Advanced & Expert Users 4 11-02-2008 07:47 PM
Ubuntu costumized like OSX glitch Texasone Ubuntu 5 06-16-2008 04:22 PM
need a little kick with sed, got it almost but on glitch scarfake Shell Programming and Scripting 3 06-16-2008 12:48 PM
Perl - backticks v system in if statements gjkeenan Shell Programming and Scripting 5 07-31-2005 06:41 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-01-2009
Andrewkl Andrewkl is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 14
Perl script: use statements and system glitch

hi,

i have a perl script that runs as a cron job... Once in a while, the perl
script fails with:

Can't locate <module>.pm in @INC (@INC contains: .............)

because one of the perl modules specified in the "use" statements is
unavailable due to an NFS glitch.

Is there some code/logic i can put into my perl script to try to "use"
the module again in the event of an NFS glitch? Please provide an example.

Thanks
--Andrew

Last edited by Andrewkl; 07-01-2009 at 02:32 AM.. Reason: change title
  #2 (permalink)  
Old 07-01-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,864
The advisable solution is to localize all includes/required modules. Having said that, you could try something like this, in place of your use:
Code:
BEGIN { 
  if (-r path-to-module)  { require module; import Module; } 
}
So what will happen if the module is unavailable? the rest of your code will probably fail to compile.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0