in reply to Re^7: Need help with pagination
in thread Need help with pagination

Hum, I start a new script from the begin but I got Message d'erreur: couldn't create child process: 720002: test.pl here is the code :
#!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; print "Hello World!";
Unbelievable error ..

Replies are listed 'Best First'.
Re^9: Need help with pagination
by hippo (Archbishop) on Jan 01, 2023 at 12:19 UTC
    Unbelievable error ..

    Quite so - it is indeed very hard to believe. Your code as posted works fine:

    $ cat 11149222.pl #!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; print "Hello World!"; $ perl 11149222.pl Content-type: text/html Hello World!$ perl -v | head -3 This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-li +nux-thread-multi $

    🦛

      Here the code snippet I do do now
      #!c:/xampp/perl/bin/perl.exe use warnings; use CGI; use Time::HiRes qw(gettimeofday); my $query = CGI->new; my $dir = "C:/Users/41786/OneDrive/Documents/recordz1/"; print $query->header; test(); sub test { open (FILE, "<$dir/test2.html") or die "cannot open file $dir/test +2.html"; my $content = ""; my $string .= "<a href=\"/cgi-bin/recordz.cgi?lang=FR&amp;session= +1&page=historique&amp;article=1amp;min_index=1&amp;max_index=40\" ><- +1-></a>&#160;&nbsp;"; while (<FILE>) { s/\$ARTICLE{'index'}/$string/g; $content .= $_; } print "Content-Type: text/html\n\n"; print $content; close (FILE); }
        A reply falls below the community's threshold of quality. You may see it by logging in.
Re^9: Need help with pagination
by soonix (Chancellor) on Dec 31, 2022 at 16:37 UTC
    This looks like you didn't use the correct incantation to start a Perl script.

    You didn't mention what operating system and which Perl version you use, which makes it difficult to help.

    Some subtle hints make me assume it's some Windows version and XAMPP. If that's the case, you need to look into your XAMPP configuration and documentation. And ISTR Apache can be configured to obey the shebang line under Windows, in which case it should contain something like
    #!c:/xampp/perl/bin/perl.exe
    (modify according to wherever your perl.exe is located)