D
daz9643
I've got 2 perl scripts, both are code for ads. One script is admob,
the other is google. The code provided has been cut and pasted without
any mods. The admob code works, the google code doesn't and i get the
error,
syntax error at googleperlcode.cgi line 9, near "sub
google_append_color "
Can't use global @_ in "my" at googleperlcode.cgi line 10, near ", $_"
syntax error at googleperlcode.cgi line 12, near "}"
Execution of googleperlcode.cgi aborted due to compilation errors.
This is the actual google code,
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
ul class="simpleblue"
sub google_append_color {
my @color_array = split(/,/, $_[0]);
return $color_array[$_[1] % @color_array];
}
Anyone know why the errors ? Both files end in .cgi and both have the
permissions set the same, i.e 755. Both are in the same directory on
the server.
the other is google. The code provided has been cut and pasted without
any mods. The admob code works, the google code doesn't and i get the
error,
syntax error at googleperlcode.cgi line 9, near "sub
google_append_color "
Can't use global @_ in "my" at googleperlcode.cgi line 10, near ", $_"
syntax error at googleperlcode.cgi line 12, near "}"
Execution of googleperlcode.cgi aborted due to compilation errors.
This is the actual google code,
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
ul class="simpleblue"
sub google_append_color {
my @color_array = split(/,/, $_[0]);
return $color_array[$_[1] % @color_array];
}
Anyone know why the errors ? Both files end in .cgi and both have the
permissions set the same, i.e 755. Both are in the same directory on
the server.