On Mon, 08 Apr 2002 11:00:54 +0200, [EMAIL PROTECTED] (Tor Hildrum) wrote:
>On 8/4/02 9:15, "Tor Hildrum" <[EMAIL PROTECTED]> wrote: > >> Here are some of the error messages I get: >> Use of uninitialized value in concatenation (.) at script.cgi line 55. >> Use of uninitialized value in concatenation (.) at script.cgi line 55. >> Can't open : No such file or directory > >Full source for the script can be located at: >http://tortest.nuug.no/perl.txt > >The script dies on this line: >open (REGISTRER, ">>$registrerte") or die(); ## $registrerte null-value > >I don't understand why it is, because I have defined it at the start of my >script with my $registrerte = ""; >I thought that made it global? >And, it is defined in the sub registrer(). >I have also tried setting it inside the sub without luck. > >Any advice would be much appreciated. >I have re-read chapter 8 of Learning Perl, but I'm not getting any wiser. It's hard to say what the problem is, your multiple posts are kindof confusing. I tried to run your nuugmedlum.cgi, but of course I don't have the files you are trying to open. When I substitute a text file to open, the cgi program seems to run OK from the commandline. What happens when you run the program from the commandline, enter your name=value pairs, 1 pair per line, then hit control-d. Turn on warnings too. One thing to look at if your opens are failing is if you have "rights" to do it. Most of the time, a web server is running as "nobody:nogroup"; not you. So you have to make sure the directory you are opening a file in is mode 777. Since you are learning, this would be a good time to learn how to use ptkdb, the perl-tk debugger. You will be able to step thru the program and see what is happening to each variable as you move from 1 sub to another. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]