TrinityInfinity has asked for the wisdom of the Perl Monks concerning the following question:
In my subscript, I have a very standard open the file, print a line to it, close it set of statements - but it will not work for the life of me! Here it is, plain vanilla:@execute = ("gettersubscript.cgi", "$var1", "$var2"); system(@execute) == 0 or die "system @execute failed: $?";
I have copied and pasted this exact code from the subscript into it's own file, which ran perfectly. And I've 777'd the text file a million times, as well as the directory it's in to make sure there are no write problems. Has anyone encountered anything similar? The only thing I'm doing differently from usual is calling a subscript with the system command - should I use something else instead? Backticks?#!/usr/bin/perl $file = "current.txt"; print "file to open is $file \n"; open (FILE, ">>$current") or die "Unable to access $file:$!\n"; print FILE "testline \n"; close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File protection in a called script
by particle (Vicar) on Nov 15, 2002 at 16:01 UTC | |
|
Re: File protection in a called script
by VSarkiss (Monsignor) on Nov 15, 2002 at 16:25 UTC | |
by TrinityInfinity (Scribe) on Nov 15, 2002 at 16:45 UTC | |
by iburrell (Chaplain) on Nov 15, 2002 at 17:23 UTC | |
|
Re: File protection in a called script
by Thelonius (Priest) on Nov 15, 2002 at 17:38 UTC | |
by TrinityInfinity (Scribe) on Nov 15, 2002 at 19:11 UTC | |
by Thelonius (Priest) on Nov 15, 2002 at 19:26 UTC |