Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > script works from prompt but not through telnet

Reply
Thread Tools

script works from prompt but not through telnet

 
 
Eric Lewton
Guest
Posts: n/a
 
      11-25-2003
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
 
Reply With Quote
 
 
 
 
Simon Andrews
Guest
Posts: n/a
 
      11-25-2003
Eric Lewton wrote:
> 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.

 
Reply With Quote
 
 
 
 
Eric Lewton
Guest
Posts: n/a
 
      11-26-2003
Great, that was it exactly, thanks guys.

There are some pretty weird shenanigans going on.
 
Reply With Quote
 
Eric Lewton
Guest
Posts: n/a
 
      12-01-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Telnet - attempting to initiate a telnet session within an established telnet session Carcarius Ruby 0 12-06-2007 03:26 AM
Works in telnet but not in perl? Bill H Perl Misc 4 09-06-2007 08:26 PM
webbrowser.open works in IDLE and cmd shell but not from cygwin prompt Gregory Bloom Python 4 04-28-2007 03:21 PM
Net::Telnet, wrong prompt, user not needed only password is requested georg.heiss@gmx.de Perl Misc 4 10-27-2006 08:01 PM
Net::Telnet, wrong prompt, user not needed only password is requested georg.heiss@gmx.de Perl Misc 0 10-27-2006 06:51 PM



Advertisments