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

This just means that you still have the lone < somewhere above the line you show us.

Again, my suggestion is to first make a backup copy, and then start ripping out the parts above that line until you have found the line that makes Perl think you want to use a <...> operator. Alternatively, you can start with a line containing a > and slowly move that upwards to find the line where the lone < is. Most likely, the offending line is some malformed/badly quoted HTML.

As your file has at least 144 lines, I will not invite you to post it here. Reducing the script by removing irrelevant lines is your first task.

Replies are listed 'Best First'.
Re^8: Need help with pagination
by *alexandre* (Scribe) on Dec 31, 2022 at 13:20 UTC
    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 ..
      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.
      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)