This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Question regarding perl and perl-libwin32 using the latest cygwin ... and an anomaly


Hi Alan,

My apologies for not sending out an announcement about this package, was
waiting for the 1.5.7 stuff to die down a bit first, but I will shortly.

>-----Original Message-----
>From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of
>Alan Miles
>Sent: Tuesday, January 20, 2004 9:26 PM
>To: cygwin@cygwin.com
>Subject: Question regarding perl and perl-libwin32 using the latest cygwin ...
>and an anomaly
>
>All,
>
>Is there a solution to the problem of having to use
>
>perl -I /usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int/
>
>when executing any examples, or use the facilities in perl-libwin32. See an
>example below:
>
>ammiles@ammiles1ws /usr/share/doc/perl-libwin32-0.191/Sound$ ./test.pl
>use: not found
[SNIP]

test.pl is not a bash script, and that tries to execute it as one since there's
no #!/usr/bin/perl line at the top. My fault for not using the appropriate
ExtUtils function for installing these, but this is a fairly minor bug so I
will fix it on next package revision, as "perl test.pl" should work
fine...unless of course it doesn't and the problem you're describing below can
be reproduced.

>
>ammiles@ammiles1ws /usr/share/doc/perl-libwin32-0.191/Sound$ perl -I
>/usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int/ test.pl
>
[SNIP]
>
>Now it doesn't (and the sound played fine).
>
>This is true of all the other examples under
>/usr/share/doc/perl-libwin32-0.191. This tells me that I must either use the
>perl -I... syntax to use the new library routines, or put this in the magic
>line (haven't tried this, so I don't know if it will work - I would assume
>it would).

Have you tried just running "perl test.pl"? Works here, this is on a fresh
Cygwin install. I can't seem to reproduce this.

Some questions for you:

Do you have the latest perl package?

When you run "perl -V", is
"/usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int" at the bottom of the
output, in the @INC array? Is archname set to
"archname=cygwin-thread-multi-64int"?

Does "which perl" give you /bin/perl ?

Does perl -MWin32::OLE -le 'print $Win32::OLE::VERSION' print "0.1502" or does
it give you an error?

>
>ammiles@ammiles1ws /usr/share/doc/perl-libwin32-0.191/Win32CORE/tests$
>$ perl -I /usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int/
>win32core.pl
>1..1
># Running under perl version 5.008002 for cygwin
># Current time local: Tue Jan 20 18:30:33 2004
># Current time GMT:   Tue Jan 20 18:30:33 2004
># Using Test.pm version 1.24
>ok 1
>
>ammiles@ammiles1ws /usr/share/doc/perl-libwin32-0.191/Win32CORE/tests$ date
>Tue Jan 20 12:31:01 CST 2004
>
>ammiles@ammiles1ws /usr/share/doc/perl-libwin32-0.191/Win32CORE/tests$
>
>The date/time stamp reported by win32core.pl doesn't make any sense - the
>GMT does, NOT the local - I am on Central US time (as reported by date).
>

It seems that there's something wrong with "localtime" in Perl. I can reproduce
this:

$ echo $TZ
PST8PDT7,M4.1.0/2,M10.5.0/2
$ date
Tue Jan 20 23:10:12 PST 2004
$ perl -MPOSIX=strftime -le 'print strftime("%x %X",gmtime)'
Wed Jan 21 2004 07:10:21
$ perl -MPOSIX=strftime -le 'print strftime("%x %X",localtime)'
Wed Jan 21 2004 07:10:26

However, when I try the newlib "localtime" function, it works fine:

$ cat localtime.c
#include <time.h>
#include <stdio.h>

int main(int argc, char** argv)
{
        char buf[1024];
        time_t cur_time = time(NULL);
        strftime(buf, sizeof(buf), "%x %X\n", localtime(&cur_time));
        printf(buf);
        return 0;
}
$ gcc localtime.c -o try.exe && ./try.exe
Tue Jan 20 2004 23:19:23
$

>_____________________________________________________
>Alan Miles
>ICQ#: 171006836
>More ways to contact me: http://wwp.icq.com/171006836
>_____________________________________________________

-- 
Rafael

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]