CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
STUMPED - Perl / NetApp

 



Parker
New User

Mar 16, 2009, 3:00 PM

Post #1 of 10 (1188 views)
STUMPED - Perl / NetApp Can't Post

I just recently upgraded the version of DataOntap (NetApp's OS). Doing so, has caused our web server (Windows 2003 running IIS) to hang when trying to write to a file on the NetApp appliance via Perl scripts...which wasn't an issue before the upgrade.

I have attached a copy of the script...is there anything funny about it?

Thanks in advanced to all!
Attachments: magree_generator.pl (5.40 KB)


bichonfrise74
Novice

Mar 16, 2009, 7:05 PM

Post #2 of 10 (1182 views)
Re: [Parker] STUMPED - Perl / NetApp [In reply to] Can't Post

Have you tried to run it via the debugger?

Also, have you tried to put multiple 'print' statements in your script to figure out where it is hanging?

--bichonfrise74


--bichonfrise74


Parker
New User

Mar 16, 2009, 8:27 PM

Post #3 of 10 (1180 views)
Re: [bichonfrise74] STUMPED - Perl / NetApp [In reply to] Can't Post

Thanks for the reply. I know where it hangs....

In the perl script, look for the following line:

# Uncomment following 3 lines of code to reproduce locking issue -kp

the 3 lines that come immediately following the above are the lines of code that check for the existence of the file, and since the upgrade, the web app just hangs on this line


KevinR
Veteran


Mar 16, 2009, 9:00 PM

Post #4 of 10 (1177 views)
Re: [Parker] STUMPED - Perl / NetApp [In reply to] Can't Post

try changing this:

# Uncomment following 3 lines of code to reproduce locking issue -kp
#if (! -e $Document::Name) {
# die(WordError($Word));
#}

to:

# Uncomment following 3 lines of code to reproduce locking issue -kp
if (! -e $Document::Name) {
WordError($Word);
}
-------------------------------------------------


FishMonger
Veteran / Moderator

Mar 16, 2009, 9:09 PM

Post #5 of 10 (1176 views)
Re: [Parker] STUMPED - Perl / NetApp [In reply to] Can't Post

I'm surprised that the script actually runs.

Why do you have the warnings pragma commented out? I'm willing to bet that your script was generating warnings that you didn't want to fix.

Why are you using prototypes?

Why are you using variables like $Document::Name

Do you know how perl interprets that var?

Your method of calculating and setting $curDate is very kludgy and can be reduced to 1 simple line using the strftime function from the POSIX module, which is a core module.


Parker
New User

Mar 17, 2009, 6:06 AM

Post #6 of 10 (1157 views)
Re: [KevinR] STUMPED - Perl / NetApp [In reply to] Can't Post

Hi Kevin,

I'm assuming you aren't being sarcastic...

Those lines are only commented to show which lines hang. Normally the script is ran without the lines commented and that is when it hangs.

Any help would be appreciated!


FishMonger
Veteran / Moderator

Mar 17, 2009, 6:44 AM

Post #7 of 10 (1156 views)
Re: [Parker] STUMPED - Perl / NetApp [In reply to] Can't Post

I don't think you noticed the change that Kevin suggested.

Remove the die statement and only do the subroutine call.

I'd also remove the prototype, which means:

Delete this line:
sub WordError($);

and change:
sub WordError($) {

to:
sub WordError {


FishMonger
Veteran / Moderator

Mar 17, 2009, 7:04 AM

Post #8 of 10 (1153 views)
Re: [Parker] STUMPED - Perl / NetApp [In reply to] Can't Post

You may also want to put a close statement in the sub.


Code
sub WordError { 
my $Word = shift;
print "<br/>Unable to create mission agreement\n" ;
$Word->Close();
$Word->Quit();
exit 1;
}



Parker
New User

Mar 17, 2009, 7:13 AM

Post #9 of 10 (1150 views)
Re: [FishMonger] STUMPED - Perl / NetApp [In reply to] Can't Post

I will give all this a try! Thanks


FishMonger
Veteran / Moderator

Mar 17, 2009, 7:27 AM

Post #10 of 10 (1148 views)
Re: [FishMonger] STUMPED - Perl / NetApp [In reply to] Can't Post

It might be best not to pass the $Word object that way because that creates a copy. Either use the global object or pass by reference.


Code
sub WordError { 
print "<br/>Unable to create mission agreement\n" ;
$_[0]->Close();
$_[0]->Quit();
exit 1;
}


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives