in reply to using Inline Python with CGI
Here is the relevant piece of code causing the complaint (M09_marker_mismatch()) from Inline
sub read_DATA { require Socket; my ($marker, $marker_tag); my $o = shift; my ($pkg, $language_id) = @{$o->{API}}{qw(pkg language_id)}; unless ($DATA_read{$pkg}++) { no strict 'refs'; *Inline::DATA = *{$pkg . '::DATA'}; local ($/); my ($CR, $LF) = (&Socket::CR, &Socket::LF); (my $data = <Inline::DATA>) =~ s/$CR?$LF/\n/g; @{$DATA{$pkg}} = split /(?m)^[ \t]{0,}(__\S+?__\n)/, $data; shift @{$DATA{$pkg}} unless ($ {$DATA{$pkg}}[0] || '') =~ /__\ +S+?__\n/; } ($marker, $o->{API}{code}) = splice @{$DATA{$pkg}}, 0, 2; croak M08_no_DATA_source_code($language_id) unless defined $marker; ($marker_tag = $marker) =~ s/__(\S+?)__\n/$1/; croak M09_marker_mismatch($marker, $language_id) unless $marker_tag eq $language_id; }
first line below asks the system what is CR and what is LF and then replaces code-line endings with a \n and then splits the code to lines. If you are willing to add debugging lines in Inline.pm in the section with the above sub, or start by making sure your system's CR and LF are some valid characters.
my ($CR, $LF) = (&Socket::CR, &Socket::LF); (my $data = <Inline::DATA>) =~ s/$CR?$LF/\n/g; @{$DATA{$pkg}} = split /(?m)^[ \t]{0,}(__\S+?__\n)/, $data;
I would follow Corion's hint on CR/LF - what editor did you use to type in your perl script? what system are you on?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using Inline Python with CGI
by Anonymous Monk on Jun 14, 2019 at 06:01 UTC | |
by afoken (Chancellor) on Jun 14, 2019 at 19:58 UTC | |
by bliako (Abbot) on Jun 14, 2019 at 07:48 UTC |