script works from prompt but not through telnet

E

Eric Lewton

Odd, I know but a script I have, which works fine when I am logged
into the computer directly, does not work through telnet or cgi-bin

If anyone has resolved a similar error, I would love to learn how.

when using telnet, it presents the folowing errors.


Use of reserved word "our" is deprecated at
/u3/maths/2006/og/lib/WWW/Mechanize.pm line 15.
Can't modify subroutine entry in scalar assignment at
/u3/maths/2006/og/lib/WWW/Mechanize.pm line 15, near ""0.66";"
BEGIN not safe after errors--compilation aborted at
/u3/maths/2006/og/lib/WWW/Mechanize.pm line 169.
BEGIN failed--compilation aborted at sms.pl line 4.


Thankyou
 
S

Simon Andrews

Eric said:
Odd, I know but a script I have, which works fine when I am logged
into the computer directly, does not work through telnet or cgi-bin

If anyone has resolved a similar error, I would love to learn how.

when using telnet, it presents the folowing errors.


Use of reserved word "our" is deprecated at
/u3/maths/2006/og/lib/WWW/Mechanize.pm line 15.

It looks like you might have two versions of perl installed and that you
are calling a different interpreter in different environments.

I assume that when your script works from a command prompt you are
calling it using:

perl scriptname.pl

rather than ./scriptname.pl , since otherwise the perl interpreter used
is defined on the first line of the script and is not influenced by the
environment.

Try running "perl -v" and "which perl" both on your direct login and
when you log in through telnet and I guess that you see something
different. Your direct login is using a more recent version of perl
(>=5.6.x) than the version you see in telnet. (I'm assuming here that
both logins are on the same machine, but you don't say that).

To fix your problem, find where the newer version of perl is installed,
then put that location on the first line of your script

#!/usr/this_is_the_new/perl

...and then call your script as ./scriptname.pl (which is probably what
your web server will also do), and you will always use the correct
interpreter.

If your two sessions are actually on different machines then you should
upgrade the older version of perl to something more recent.

Hope this helps

Simon.
 
E

Eric Lewton

Great, that was it exactly, thanks guys.

There are some pretty weird shenanigans going on.
 
E

Eric Lewton

But then it turned out that wasn't it, so if anyone has this problem,
this is what I had to do:


CODE

#!/[full address of a more modern version of perl]

use lib [full address of library directory that I created]

Then I had to use the modules own proxy settings (in manual).

Do all stuff here.

END CODE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top