I am attempting to get the subscriptions.pl script to run on my system.
I am familiar with setting up cron jobs. My problem is that I cannot get the script to run in the first place.
Here's what I did:
· Installed the appropriate Perl Modules as per instructions · Edited w3tvars.pm as instructed · Edited the unshift lines in subscriptions.pl and doexpire.pl
When I issue ./subscriptions.pl, here's the output:
</font><blockquote><font size="1" face="">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">ksh: ./subscriptions.pl: No such file or directory[/code]</blockquote><font size="" face="">I then alter the header to #!/usr/bin/perl -w, and this is the output:
</font><blockquote><font size="1" face="">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">"my" variable $query masks earlier declaration in same scope at ./subscriptions.pl line 63. "my" variable $query masks earlier declaration in same scope at ./subscriptions.pl line 110. Use of uninitialized value in multiplication (*) at /var/www/htdocs/ubbthreads/cron/w3t.pm line 65. Use of uninitialized value in string eq at ./subscriptions.pl line 91. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 291. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 292. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 293. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 291. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 292. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 293. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 291. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 292. Use of uninitialized value in substitution (s///) at /var/www/htdocs/ubbthreads/cron/Mailer.pm line 293.[/code]</blockquote><font size="" face="">and so on. Any ideas? I'm no Perl monk.
I don't mean to sound snippy, but I do intend to be brusquely honest.
Maybe next time you could /read/ a post before responding to it... I know how to 'man 5 crontab'. And I believe I made this perfectly clear. To quote myself:
</font><blockquote><font size="1" face="">quote:</font><hr /><font size="" face="">I am familiar with setting up cron jobs. My problem is that I cannot get the script to run in the first place. </font><hr /></blockquote><font size="" face="">Again, I usually avoid curtness at all costs, as I find it to be a distasteful quality. I certainly don't troll, or start flamefests. However, I must call you out on this one - I am aware of the "it's just a clueless newbie - send him off to RTFM and he'll go away" tactic. I've pulled that one myself. <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" /> But never when it's blatantly obvious from the CONTEXT of the post in question that this isn't an applicable strategy, and that the problem isn't one of not properly reading the documentation.
I even illustrated that I DID read the documentation in my original post!
</font><blockquote><font size="1" face="">quote:</font><hr /><font size="" face=""> Here's what I did:
· Installed the appropriate Perl Modules as per instructions · Edited w3tvars.pm as instructed · Edited the unshift lines in subscriptions.pl and doexpire.pl </font><hr /></blockquote><font size="" face="">tsk tsk. <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />
Thank you - You indicated that you read the documentation in your post - however, you did not indicate where or how old that documentation was.
A condensed version of that documentation exists as comments in older versions of the scripts - so I pointed you to the most recent version of it.
If you would please be patient I would greatly appreciate it - CRON tasks vary from host to host - having set up only a couple of them and having to esclate them to the hosts own 'wonks' who promptly fixed them by setting them up in a way completley opposite the documentation on the website - I can say that they are sticky at best.
So - if you could let me know who your host is, and make me aware of any documentation that they may have, that would help me to better understand the error message that you have provided to me.
and they die 3 times so I presume that 3 people tried to subscribe to the posts in that forum and it failed all 3.
What version of Perl are you running on that server? Are you certain that your Perl modules were moved up in ASCII and not Binary? What FTP client are you using?
Those warnings you are seeing is because of the -w switch. That basically prints out general info warnings, but the scripts will behave properly. If you pull the -w out of the #!/usr/bin/perl line it should work as planned.
------------------- Rick Baker UBBThreads developer
Again, I apologise for my rudeness. FWIW, I had just finished a massive project - transferring ubb 5 to UNIX (and getting it to run), upgrading ubb 5 to ubb 6 (40,000+ posts), and then immediately upgrading ubb 6 to threads (5 wouldn't upgrade to threads directly). I was tired and cranky - it was quite a chore to pull off! It does work, however, sans this one thing, so all in all things are alright. <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />
</font><blockquote><font size="1" face="">quote:</font><hr /><font size="" face="">So - if you could let me know who your host is, and make me aware of any documentation that they may have, that would help me to better understand the error message that you have provided to me.</font><hr /></blockquote><font size="" face="">If I understand the question correctly, then the answer is simple - I am the host. It's my machine, on a leased connection.
Only available documentation is 'man cron'. <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />
</font><blockquote><font size="1" face="">quote:</font><hr /><font size="" face="">What version of Perl are you running on that server? Are you certain that your Perl modules were moved up in ASCII and not Binary? What FTP client are you using?</font><hr /></blockquote><font size="" face="">Perl 5.6.1 OpenBSD 3.0 NcFTP 3.0.3 Qmail 1.0.3 (tried this w/ Postfix as well - error is exactly the same) Perl modules built from ports tree (except Data-Dump, which was installed manually)
</font><blockquote><font size="1" face="">quote:</font><hr /><font size="" face=""> try this
user@machine shell: perl subscriptions.pl </font><hr /></blockquote><font size="" face="">Interesting. 'perl subscriptions.pl' works fine. './subscriptions.pl' does not. I don't get it. The perl pathname in the header is correct.
Oh, well. I'll just put 'perl /foo/bar/subscriptions.pl' in cron and be done with it!
subscriptions.pl had DOS line termination characters on each line. ksh could not understand the header #!/usr/bin/perl because it saw it as #!/usr/bin/perl^M - thus, the "no such file or directory" message when attempting to execute the script directly. The perl interpreter itself had no problem with these DOS terminators, so "perl subscriptions.pl" worked fine.
Oddly enough, so did the header #!/usr/bin/perl -w (really #!/usr/bin/perl -w^M). I guess moving that ^M over prevented the shell from trying to call the literal program "perl^M", which, of course, doesn't exist! Goofy.
I use vim 6.0 as my default text editor, and vim also does not show these DOS terminators, therefore my puzzlement as to why it didn't work! So, I opened up subscriptions.pl in plain ol' OpenBSD default vi, and voila! - a pretty little ^M at the end of every line.
Run dos2unix, strip out the ^Ms, and everything works as designed.
</font><blockquote><font size="1" face="">quote:</font><hr /><font size="" face="">wow, you use ksh???</font><hr /></blockquote><font size="" face="">Well, not out of some elitist preference, mind you. <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />
Actually, as any joeuser I use good ol' bash, tab completion and all. <img border="0" title="" alt="[Cool]" src="images/icons/cool.gif" /> However, OpenBSD sets up ksh as default for root, and since I put /usr/local on its own partition, I thought it wise to only use a shell for root that is accessible directly from /bin (in case of emergency repair). OpenBSD ports puts bash, zsh, and friends in /usr/local/bin.
So, that's the story, and I'm stickin' to it. Thanks again!