in reply to Re: vars going out of scope!
in thread vars going out of scope!

thanks for your quick post....maybe i should have used original code, which at moment i don't have access to as it's on a customer site with dial-up and someone else is in there at moment. the original code, which i re-wrote to use arrays. the jist of the original code was:
# no strict or warnings $bla = "this and that"; $file = "c:\filea"; system("echo $bla > $file"); # this works if (1==1) #not the actual test, but it goes in this test { system("echo $bla > $file"); #this never occurs #if run by an exe that calls Perl -U this_script #and passes output to IIS #it does work from cmd prompt }
is this a perl install issue? stacks? weird stuff!

Chris

Replies are listed 'Best First'.
Re: Re: Re: vars going out of scope!
by JamesNC (Chaplain) on Apr 23, 2003 at 02:33 UTC
    This is an IIS issue. Your installation of Perl is OK. You have to remember that IIS is running as a different account. If your script doesn't have permissions to accomplish the task, usually your script will just not run that part. When you make system calls w/in your Perl scripts that are run via IIS, you have to remember to set your environment just as if you were running it from the same cmd.exe environment. The easiest way (not the safest) is to use IIS admin tool to set your script up to run as you and then restart the server. If it runs as expected, that means you have to think about the security issues of running it that way, but it gets it working in the short term. This was a problem for Net::Ping users that developed IIS apps to use it... their scripts had to be run as Admin... yuch. Win32::PingICMP uses a dll which is the same that Win uses to allow anonymous ping. Hope that helps :) (been there too) JamesNC :0)
      thanks a lot...will look into it from that angle in the morning at work. Chris