$newsfeed = $ARGV and a path to config file as: my $cfgFile = "/hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/config/$newsfeed"; then I wanted to run the whole script from html: well, all this did not work. What have I done wrong? the original code was: use strict; [1][edited by: jatar_k at 1:22 am (utc) on Sep. 17, 2005]
http://www.example.com/cgi-bin/pullrss/pullrss.cgi?soundtrack.cfg
where "soundtrack.cfg" would be a name of a config file.
use HTTP::Request;
use LWP::UserAgent;
use XML::Parser;
use XML::RSS;
use HTML::Template;
use URI::URL ();
# Variables defined in external file
use vars qw($externalRSS
$localRSS
@siteDomains
$hTemplate
$outfile
$siteId
$ADMIN_EMAIL
$numheadlines
$redirectServer);
# Retrieve configuration file/parameters
my $cfgFile = "/hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cfg";
$cfgFile = $ARGV[0] if ($ARGV[0]);
die "Specified Config file ($cfgFile) doesn't exist.\n" unless (-e $cfgFile);
require $cfgFile or die "Can't retrieve configuration file: $!\n";
# Agent name for external file pulls
my $AGENT_NAME="pullrss/1.0";
# grab and format headlines from the RSS file
my $topHeadlines = &pullRSS($externalRSS,$localRSS,$numheadlines,\@siteDomains,$hTemplate);
Global symbol "$newsfeed" requires explicit package name at /hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cgi line 48.
syntax error at /hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cgi line 49, near "my "
Global symbol "$cfgFile" requires explicit package name at /hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cgi line 49.
Global symbol "$newsfeed" requires explicit package name at /hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cgi line 49.
Global symbol "$cfgFile" requires explicit package name at /hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cgi line 53.
[edited by: coopster at 11:01 pm (utc) on Sep. 16, 2005]
[edit reason] generalized url [/edit]
syntax error at /hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/pullrss.cgi line 49, near "my "
needs to be fixed first. Try and determine what the syntax error is (missing quotes, missing semi-colon, etc etc etc). If you can't figure it out, post the code if it's not too long and someone will take a look.
[edited by: coopster at 11:02 pm (utc) on Sep. 16, 2005]
[edit reason] generalized url from original poster [/edit]
my $cfgFile = '/hsphere/local/home/abelkorz/example.com/cgi-bin/pullrss/'.$ARGV[0];
and remove your url and site name (read TOS ;) And own security is not a penny cost too ;)
And all the messages means the script is running 'use strict' Specify all variables as private (my) or strict pragma should be disabled.
[edited by: coopster at 11:02 pm (utc) on Sep. 16, 2005]
[edit reason] generalized url from original poster [/edit]