Thread View: be.comp.programming
3 messages
3 total messages
Started by R.G
Fri, 30 Aug 2002 01:31
2 perl problemen
Author: R.G
Date: Fri, 30 Aug 2002 01:31
Date: Fri, 30 Aug 2002 01:31
36 lines
2314 bytes
2314 bytes
Hallo,
1) Waarom geeft de interpreter in Perl dit:
***************************************************
Unquoted string "file" may clash with future reserved word at
C:\webppliance\conf\domains\kmskdeinze\Inetpub\wwwroot\cgi-bin\guestbook2\gu
estbook2.pl line 30.
Unquoted string "file" may clash with future reserved word at
C:\webppliance\conf\domains\kmskdeinze\Inetpub\wwwroot\cgi-bin\guestbook2\gu
estbook2.pl line 31.
Unquoted string "file" may clash with future reserved word at
C:\webppliance\conf\domains\kmskdeinze\Inetpub\wwwroot\cgi-bin\guestbook2\gu
estbook2.pl line 32.
***************************************************
Dit is mijn code waar het om gaat:
open (file, ">>$openFile");
print file "blablabla";
close file;
Ik kan toch moeilijk quotes rond file zetten ?
2) Wat moest ik nu weeral doen bij de functie require om procedures op te
halen uit een ander bestand ?
require 'procedures.pl';
dit heb ik staan, maar dan zoekt hij zeker in de dir's van de perl
interpreter achter de procedure ?
Kan iemand me helpen ?
Alvast bedankt
Re: 2 perl problemen
Author: Daniel Tryba
Date: Fri, 30 Aug 2002 03:14
Date: Fri, 30 Aug 2002 03:14
35 lines
2400 bytes
2400 bytes
In nl.internet.www.server-side R.G <rg@nee.com> wrote: > 1) Waarom geeft de interpreter in Perl dit: > > *************************************************** > Unquoted string "file" may clash with future reserved word at > C:\webppliance\conf\domains\kmskdeinze\Inetpub\wwwroot\cgi-bin\guestbook2\gu > estbook2.pl line 30. > *************************************************** > > Dit is mijn code waar het om gaat: > > open (file, ">>$openFile"); > print file "blablabla"; > close file; > > Ik kan toch moeilijk quotes rond file zetten ? Men wil je duidelijk maken dat de variabele file geen goede keuze is als variabele naam omdat er wellicht plannen zijn om bv een functie file() te implementeren. Vervang file dus door iets anders. > 2) Wat moest ik nu weeral doen bij de functie require om procedures op te > halen uit een ander bestand ? > > require 'procedures.pl'; > > dit heb ik staan, maar dan zoekt hij zeker in de dir's van de perl > interpreter achter de procedure ? Ik heb geen idee wat je probleem is, maar lees http://www.perldoc.com/perl5.8.0/pod/func/require.html eens. -- Daniel Tryba
Re: 2 perl problemen
Author: frank
Date: Fri, 30 Aug 2002 09:54
Date: Fri, 30 Aug 2002 09:54
35 lines
2064 bytes
2064 bytes
In be.comp.programming R.G <rg@nee.com> wrote: > 1) Waarom geeft de interpreter in Perl dit: > *************************************************** > Unquoted string "file" may clash with future reserved word at > C:\webppliance\conf\domains\kmskdeinze\Inetpub\wwwroot\cgi-bin\guestbook2\gu > estbook2.pl line 30. > Dit is mijn code waar het om gaat: > open (file, ">>$openFile"); > print file "blablabla"; > close file; > Ik kan toch moeilijk quotes rond file zetten ? Neen, maar per conventie zijn file descriptors in HOOFDLETTERS. > 2) Wat moest ik nu weeral doen bij de functie require om procedures op te > halen uit een ander bestand ? > require 'procedures.pl'; > dit heb ik staan, maar dan zoekt hij zeker in de dir's van de perl > interpreter achter de procedure ? normaal ook in eigen dir. Anders uitdrukkelijk './procedures.pl' van maken of zo. Vriendelijke groeten, Frank Louwers -- Openminds bvba www.openminds.be Tweebruggenstraat 16 - 9000 Gent - Belgium
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads