use statements and system glitch


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting use statements and system glitch
# 1  
Old 07-01-2009
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 03:32 AM.. Reason: change title
# 2  
Old 07-01-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Conditional delete -- New glitch

Hi Please dont consider this as duplicated post.. I am using below pattern to find delete files to bringdown disc size.. however how i can make sure ist going to correct folder and searching for files... while print "echo rm " LastFile correctly print files names for deletion, but when i... (7 Replies)
Discussion started by: onenessboy
7 Replies

2. AIX

Cloning a system via mksysb backup from one system and restore to new system

Hello All, I am trying to clone an entire AIX virtual machine to a new virtual machine including all partitions and OS.Can anyone help me on the procedure to follow? I am not really sure on how it can be done.Thanks in advance. Please use CODE tags for sample input, sample output, and for code... (4 Replies)
Discussion started by: gull05
4 Replies

3. UNIX for Dummies Questions & Answers

Help with For Statements

Hi, I am trying to write a for statement that will allow for the ps, who, finger, and date commands to run. Can anyone help? I use Putty. (22 Replies)
Discussion started by: lexydoll87
22 Replies

4. Ubuntu

Ubuntu costumized like OSX glitch

I have a laptop running Ubuntu Gusty. I have recently used applications such as AWN, Emerald, etc... to create a Mac OS X Leopard like environment. It works almost perfectly except for one little glitch. When I open most of my apps/windows, they all open with the top bar(with includes close,... (5 Replies)
Discussion started by: Texasone
5 Replies

5. Shell Programming and Scripting

need a little kick with sed, got it almost but on glitch

hi friends. yo i have a textfile with urlīs in it sometimes middle in text, sometimes one url alone is a line i append a string right behind the domain name so that http://unix.com becomes http://unix.com.APPENDTHIS on all occasions. i use this sed-line to achieve this: sed -i... (3 Replies)
Discussion started by: scarfake
3 Replies

6. Shell Programming and Scripting

Please help on IF statements.

I had different problem scenarios with IF statement. Can any expert please enlighten me on the difference with these scenarios. Thank you. 1st Scenario: testdate=`date +%Y%m` test=`cat /var/log/database0.$testdate*.log | grep "Errors found during processing" | tail -10` if then ... (4 Replies)
Discussion started by: filthymonk
4 Replies

7. UNIX for Dummies Questions & Answers

Else in If Statements

Sorry to be a pain, but how does the else work in the if statements? Ive been making scripts with if statements but i cant get the else statements working. Can you help? (8 Replies)
Discussion started by: chapmana
8 Replies

8. Shell Programming and Scripting

Perl - backticks v system in if statements

Can someone explain the difference between backticks and system when evaluated in these if statements: sub getDate { print "start date\n"; if ( system("/bin/date") ) { print "can't get date\n"; exit(2); } print "finish date\n"; } Returns the following: start date Thu... (5 Replies)
Discussion started by: gjkeenan
5 Replies

9. Shell Programming and Scripting

or statements?

how do i do an or in an if-then statement? i tried: if ; then bleh fi how???? (1 Reply)
Discussion started by: Blip
1 Replies
Login or Register to Ask a Question