Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

POSIX.pm and Perl 5.004_02 - Compatible?

by LeeC79 (Acolyte)
on Sep 08, 2003 at 16:11 UTC ( #289802=perlquestion: print w/replies, xml ) Need Help??

LeeC79 has asked for the wisdom of the Perl Monks concerning the following question:

I was using Perl 5.8.0 from ActivePerl until just recently. I was told that the business server that my scripts are going to be running on is version 5.004_02. So I uninstalled 5.8 and installed the same version that our business server has. Here's the problem, I tested running a script that worked fine before and it no longer works. First it complained that it couldn't find POSIX.pm, so I copy it from my machine to the server. And now I'm getting this error:
Can't modify subroutine entry in scalar assignment at C:\Perl\lib/POSI +X.pm line 3, near ");" BEGIN not safe after errors--compilation aborted at C:\Perl\lib/POSIX. +pm line 5. BEGIN failed--compilation aborted at ftp_Invent.pl line 11.
I simply using the strftime function to get and print the localtime of the server.
#!/usr/local/bin/perl -w use strict; use POSIX qw(strftime); my $now_string; $now_string = strftime '%Y%m%d.%H%M%S', localtime; my $now_string2 = strftime '%Y%m%d%H%M%S', localtime;
Can anyone explain to me why I'm having this problem? Thanks in advance.

Replies are listed 'Best First'.
Re: POSIX.pm and Perl 5.004_02 - Compatible?
by PodMaster (Abbot) on Sep 08, 2003 at 16:25 UTC
    First it complained that it couldn't find POSIX.pm, so I copy it from my machine to the server
    Mistake number 1. POSIX is a XS module (requires a compiler), and you can't do that (you need to install the module proper).

    Also, POSIX has been in the CORE since perl 5.00307 and is in CORE of perl 5.004_02. So whatever kind of perl install you have on the server, it's been botched and/or purposefully cut in size (not to mention that it's fairly old).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Could you tell me how to install the module proper?
Re: POSIX.pm and Perl 5.004_02 - Compatible?
by jmcnamara (Monsignor) on Sep 08, 2003 at 16:27 UTC

    There should be a version of POSIX with 5.004. Here is the results from a standard 5.00405 installation:
    $ perl5.00405 -MPOSIX -le 'print strftime "%Y/%m/%d", localtime' 2003/09/08
    And here is the ouput from Module::CoreList's corelist:
    $ corelist POSIX POSIX was first released with perl 5.00307

    --
    John.

      I do not have a version of posix with 5.004_02. When I run that line of code you gave, this is what I get:
      Can't locate POSIX.pm in @INC (@INC contains: C:\Perl\lib\site C:\Perl +\lib c:\pe rl\lib c:\perl\lib\site c:\perl\lib\site .). BEGIN failed--compilation aborted.
      Any ideas?
        It looks that you haven't installed the POSIX module for your perl installation, or the directory where POSIX module is installed is not on your perl module search path. It's a perl installation/system admin issue.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://289802]
Approved by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2020-11-24 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?