|
Posted by J. Gleixner on February 22, 2008, 11:55 am
Please log in for more thread options
daz9643 wrote:
> 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"
^^^^^^^^^^^^^^^^^^^^^^
Does that look at all like it's valid syntax?
> 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.
|