Hi
When i run these scripts i get this error
[Mon Jan 6 2003] index.pl: Undefined subroutine &main::vote called at index.pl line 6.
Compilation failed in require at index.pl line 4.
Any idea what might cause this i have been scratching my head for ages. (both scripts are in the same folder on the server)
If i put the vote sub in the index.pl script it works fine.
this is the main script named index.pl
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
require "poll.pl";
&vote;
this script is named poll.pl
require "index.pl";
sub vote {
print "poll here";
my $poll1 = "poll.txt";
open(POLLFILE,"<$poll1"
|| &error($!,"cannot read $poll1.\n"
;
my @lines = <POLLFILE>;
close(POLLFILE);
my $poll = "@lines";
print "$poll";
}
1;
When i run these scripts i get this error
[Mon Jan 6 2003] index.pl: Undefined subroutine &main::vote called at index.pl line 6.
Compilation failed in require at index.pl line 4.
Any idea what might cause this i have been scratching my head for ages. (both scripts are in the same folder on the server)
If i put the vote sub in the index.pl script it works fine.
this is the main script named index.pl
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
require "poll.pl";
&vote;
this script is named poll.pl
require "index.pl";
sub vote {
print "poll here";
my $poll1 = "poll.txt";
open(POLLFILE,"<$poll1"
my @lines = <POLLFILE>;
close(POLLFILE);
my $poll = "@lines";
print "$poll";
}
1;