script works from prompt but not through telnet

Discussion in 'Perl Misc' started by Eric Lewton, Nov 25, 2003.

  1. Eric Lewton

    Eric Lewton Guest

    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
    Eric Lewton, Nov 25, 2003
    #1
    1. Advertising

  2. 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.
    Simon Andrews, Nov 25, 2003
    #2
    1. Advertising

  3. Eric Lewton

    Eric Lewton Guest

    Great, that was it exactly, thanks guys.

    There are some pretty weird shenanigans going on.
    Eric Lewton, Nov 26, 2003
    #3
  4. Eric Lewton

    Eric Lewton Guest

    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
    Eric Lewton, Dec 1, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gregory Bloom
    Replies:
    4
    Views:
    348
    Steve Holden
    Apr 28, 2007
  2. Carcarius
    Replies:
    0
    Views:
    275
    Carcarius
    Dec 6, 2007
  3. Replies:
    0
    Views:
    75
  4. Replies:
    4
    Views:
    222
  5. Bill H

    Works in telnet but not in perl?

    Bill H, Sep 6, 2007, in forum: Perl Misc
    Replies:
    4
    Views:
    172
    Benoit Lefebvre
    Sep 6, 2007
Loading...

Share This Page