Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 27456
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: info [...] gknw.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: CGI.pm example nph-clock.cgi doesnt work on NetWare / Win32
Date: Wed, 6 Jun 2007 02:59:32 +0200
To: bug-CGI.pm [...] rt.cpan.org
From: Guenter Knauf <info [...] gknw.de>
Download (untitled) / with headers
text/plain 468b
Hi Lincoln, on NetWare / Win32 we dont have `/bin/date`; the patch below makes the sample working on these platforms: --- nph-clock.cgi.orig Tue Nov 24 13:30:42 1998 +++ nph-clock.cgi Wed Jun 06 02:55:54 2007 @@ -5,7 +5,7 @@ do_push(-next_page=>\&draw_time,-delay=>1); sub draw_time { - my $time = `/bin/date`; + my $time = localtime(); return start_html('Tick Tock'), div({-align=>CENTER}, h1('Virtual Clock'), thanks, Guenter.
Download CGI.pm.diff
text/x-diff 1.1k
########################################################################### # patch to fix CGI.pm to use binmode() on NetWare -- by G. Knauf. # ########################################################################### --- CGI.pm.orig Mon Apr 16 18:58:46 2007 +++ CGI.pm Wed Jun 06 02:45:06 2007 @@ -155,12 +155,14 @@ $OS = 'EPOC'; } elsif ($OS =~ /^cygwin/i) { $OS = 'CYGWIN'; +} elsif ($OS =~ /^NetWare/i) { + $OS = 'NETWARE'; } else { $OS = 'UNIX'; } # Some OS logic. Binary mode enabled on DOS, NT and VMS -$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN)/; +$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin|CYGWIN|NETWARE)/; # This is the default class for the CGI object to use when all else fails. $DefaultClass = 'CGI' unless defined $CGI::DefaultClass; @@ -171,7 +173,7 @@ # The path separator is a slash, backslash or semicolon, depending # on the paltform. $SL = { - UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', + UNIX => '/', OS2 => '\\', EPOC => '/', CYGWIN => '/', NETWARE => '/', WINDOWS => '\\', DOS => '\\', MACINTOSH => ':', VMS => '/' }->{$OS};
Download (untitled) / with headers
text/plain 611b
On Tue Jun 05 21:00:02 2007, info@gknw.de wrote: Show quoted text
> Hi Lincoln, > on NetWare / Win32 we dont have `/bin/date`; > the patch below makes the sample working on these platforms: > > --- nph-clock.cgi.orig Tue Nov 24 13:30:42 1998 > +++ nph-clock.cgi Wed Jun 06 02:55:54 2007 > @@ -5,7 +5,7 @@ > do_push(-next_page=>\&draw_time,-delay=>1); > > sub draw_time { > - my $time = `/bin/date`; > + my $time = localtime(); > return start_html('Tick Tock'), > div({-align=>CENTER}, > h1('Virtual Clock'),
Thanks for the patch. I recommend that it applied for the next release. Mark
Thanks, this patch has been applied in my git repo.
Subject: released, thanks.
I believe this change was released today as part of CGI.pm 3.45. Thanks for the contribution.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.