[21776] in Perl-Users-Digest
Perl-Users Digest, Issue: 3980 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 16 11:06:33 2002
Date: Wed, 16 Oct 2002 08:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 16 Oct 2002 Volume: 10 Number: 3980
Today's topics:
Re: Can anyone tell me how to get GD (& GD::Graph) work (Helgi Briem)
defining subroutines on the fly in a module <novalid@email.oops>
Re: How can I display different charsets with Perl unde <uzshaf@uni-bonn.de>
icons. <spikey-wan@bigfoot.com>
Re: icons. <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: Installing Modules <invalid@pinnock.com>
Re: Installing Modules <bart.lateur@pandora.be>
Re: Internal error (code 500) on every CGI <s.patterson@freeuk.com>
Re: Internal error (code 500) on every CGI <nobody@nowhere.com>
Re: Internal error (code 500) on every CGI <stephan@wanderinghorse.net>
New JAPH <ubl@schaffhausen.de>
Re: New JAPH <pinyaj@rpi.edu>
Re: Newbie: Date comparison <anthony.heuveline@wanadoo.fr>
Re: Newbie: Date comparison <krahnj@acm.org>
Re: Newbie: Date comparison <twhu@lucent.com>
Re: Newbie: Date comparison <Hans.Grund@fja.com>
Re: Newbie: Date comparison (Tad McClellan)
Re: Newbie: Date comparison <bart.lateur@pandora.be>
Re: Newbie: Date comparison <anthony.heuveline@wanadoo.fr>
Re: Opinion on using Perl or JavaScript for Web develop <derek@wedgetail.com>
Re: Opinion on using Perl or JavaScript for Web develop <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Re: Peculiar problem with Win32::OLE (No type library m <rubberducky703@hotmail.com>
Re: Problem with Class::Date Module (gaj)
Re: Problems after update 5.0 -> 5.8 <twhu@lucent.com>
Problems with perl.org/perlmongers.org websites and ema <bart.lateur@pandora.be>
Re: Random Character Picker <flavell@mail.cern.ch>
Re: Random Character Picker <krahnj@acm.org>
Re: Random Character Picker <andrew_harton@agilent.com>
Re: Read a single character from STDIN (W98) <nikogo@nigde.net>
Re: Switching from Python to Perl <derek@wedgetail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 16 Oct 2002 10:12:32 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Can anyone tell me how to get GD (& GD::Graph) working on Win32!!
Message-Id: <3dad3a6a.24906393@news.cis.dfn.de>
On Wed, 16 Oct 2002 08:57:24 +0100, "Rubber Duck"
<rubberducky703@hotmail.com> wrote:
Why do you still top-post?
For comp.lang.perl.misc posting guidelines, see:
ttp://mail.augustmail.com/~tadmc/clpmisc.shtml
For more information about netiquette in general, see the
"Netiquette uidelines" at:
http://andrew2.andrew.cmu.edu/rfc/rfc1855.html
>> At a command prompt:
>> ppm install GD
>> followed by:
>> ppm install GDGraph
>> should do the trick. Works for me, anyway (AS build 633, Windoze 98SE).
>I've given up, couldn't get ppm to work
Why don't you read perldoc ppm then?
>prolly firewall or proxy settings)
Almost certainly. Set your environment variable
HTTP_proxy to the appropriate value (the same
as your web browser, something like
http::/proxy.domain:port).
This as an Extremely Frequently Asked and Answered
Question.
--
Regards, Helgi Briem
helgi AT decode DOT is
A: Top posting
Q: What is the most irritating thing on Usenet?
- "Gordon" on apihna
------------------------------
Date: Wed, 16 Oct 2002 09:59:51 -0500
From: "Keith A. Clay" <novalid@email.oops>
Subject: defining subroutines on the fly in a module
Message-Id: <3dad7ec5$1_4@news.teranews.com>
Folks,
I have a list of variables separated by a semicolon and are defined in
the module object ($self->{'USER_VARS'}). Is there a way in a
subroutine to define each of these with a subroutine that can be called
like $self->set_user_name.
So,
sub define_sub {
my ($self)=@_;
foreach my $tk ( split(':',$self->{'USER_VARS'}) ) {
my $sname = "set_" . lc($tk);
my $gname = "get_" . lc($tk);
<now what I need to do is define subroutines for get and set that are
object methods (i.e., $self->set_user_name)>
}
}
How do I accomplish this??
keith
------------------------------
Date: Wed, 16 Oct 2002 14:30:19 +0200
From: "Christian Kappler" <uzshaf@uni-bonn.de>
Subject: Re: How can I display different charsets with Perl under Windows
Message-Id: <aojm7q$vl0$1@f1node01.rhrz.uni-bonn.de>
Hi Benjamin and all,
>From: "Benjamin Goldberg" <
goldbb2@earthlink.net>
>Newsgroups: comp.lang.perl.misc
>Sent: Monday, October 14, 2002 11:12 PM
>Subject: Re: How can I display different charsets with Perl under Windows
>
> Christian Kappler wrote:
> [snip]
>
> Perl does not understand charsets and fonts.
>
> Perl only understands encodings.
>
> With perl5.8, you can do either:
> open( FILEHANDLE, "<:encoding(cp1252)", "file.txt" )
> or die $!;
> or:
> open( FILEHANDLE, "<", "file.txt" ) or die $!;
> binmode( FILEHANDLE, ":encoding(cp1252)" );
>
> So that when perl reads from a file in some encoding or > other, it
translates it into perl's internal character format
> (which happens to be utf8, but you don't need to know
> that). [...]
What I forgot to tell: I am currently using ActivePerl v5.6.1 and as far as
I know this is the newest version of ActivePerl. So, bfore I start to
install a completely different build of perl on my Windows machine, is there
a way to do something similiar with ActivePerl 5.6.1?
Regards,
Christian
"Benjamin Goldberg" <goldbb2@earthlink.net> schrieb im Newsbeitrag
news:3DAB332C.67ED76F8@earthlink.net...
> Christian Kappler wrote:
> [snip]
>
> Perl does not understand charsets and fonts.
>
> Perl only understands encodings.
>
> With perl5.8, you can do either:
> open( FILEHANDLE, "<:encoding(cp1252)", "file.txt" )
> or die $!;
> or:
> open( FILEHANDLE, "<", "file.txt" ) or die $!;
> binmode( FILEHANDLE, ":encoding(cp1252)" );
>
> So that when perl reads from a file in some encoding or other, it
> translates it into perl's internal character format (which happens to be
> utf8, but you don't need to know that).
>
> Similar commands allow you to write to files in such a way that perl
> will translate from it's internal character format into some external
> encoding.
>
> Your "richedit control" undoubtably expects that data be passed to it in
> some specific encoding. To translate from perl's internal character
> format to a different encoding, without writing the result to a file,
> you would do:
>
> use Encoding qw(encode);
> my $windows_encoded_octets = encode( "cp1252",
> $string_in_perls_internal_format );
>
> Find the documentation for this "richedit" thingy (I've no clue what it
> is, and don't particularly care), and learn precisely what encoding it
> expects it's input data to be in. Then, use the Encode module (or the
> ":encoding(...)" PerlIO layer, if richedit wants a file, not a string)
> to convert your data into that format.
>
> --
> my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
> ."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Wed, 16 Oct 2002 13:59:34 +0100
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: icons.
Message-Id: <aojnsu$q29$1@newshost.mot.com>
Anyone know of a good, free icon editor/creator?
Thanks.
R.
------------------------------
Date: Wed, 16 Oct 2002 13:28:24 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: icons.
Message-Id: <slrnaqqq8c.12b.bernard.el-hagin@gdndev25.lido-tech>
In article <aojnsu$q29$1@newshost.mot.com>, Richard S Beckett wrote:
> Anyone know of a good, free icon editor/creator?
Yes.
> Thanks.
Sod off.
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 16 Oct 2002 14:02:05 +0100
From: "Graeme" <invalid@pinnock.com>
Subject: Re: Installing Modules
Message-Id: <hrdr9.2915$v_5.208348@newsfep2-win.server.ntli.net>
"Ron Savage" <ron@savage.net.au> wrote in message
news:aojdd6$2on4$1@arachne.labyrinth.net.au...
> "Graeme" <invalid@pinnock.com> wrote in message
news:TwTq9.823$a32.67836@newsfep1-win.server.ntli.net...
> >
> > "Brian McCauley" <nobull@mail.com> wrote in message
> > news:u9r8esdkqw.fsf@wcl-l.bham.ac.uk...
> > > "Graeme" <invalid@pinnock.com> writes:
> > >
> > > > I downloaded SerialPort-0_19.zip from
> > > > http://members.aol.com/Bbirthisel/alpha.html but the install
> > > > instructions are a bit light on detail.
>
> There is a general guide here:
>
> http://savage.net.au/Perl-modules/html/installing-a-module.html
>
Thanks Ron,
I've unfortunately given up now.
I successfully installed the above module but have discovered that it
relies on win32::api which I don't have.
I tried to install it but I can't find a precompiled version that
works with w2000. I don't have a C compiler so can't use a source
version so I'm stuck.
--
Graeme
------------------------------
Date: Wed, 16 Oct 2002 13:22:08 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Installing Modules
Message-Id: <3npqqu4ojanetqoibht7bclpf1kn517tjt@4ax.com>
Graeme wrote:
>I successfully installed the above module but have discovered that it
>relies on win32::api which I don't have.
>I tried to install it but I can't find a precompiled version that
>works with w2000. I don't have a C compiler so can't use a source
>version so I'm stuck.
Heh, what? I think I've used Win32::API on W2K before.
You should be able to find a copy on Activestate's repository,
<http://www.activestate.com/PPMpackages/>, either under "5.6" or under
"5.6plus" or from
<http://www.activestate.com/PPMPackages/zips/6xx-builds-only/>, all if
you're using 5.6.x.
--
Bart.
------------------------------
Date: 16 Oct 2002 10:22:49 GMT
From: Stephen Patterson <s.patterson@freeuk.com>
Subject: Re: Internal error (code 500) on every CGI
Message-Id: <slrnaqqfib.pb.s.patterson@bloodnok.localdomain>
On Wed, 16 Oct 2002 11:45:15 +0200, Antoine wrote:
> Hello
> I've installed e-swish on my apche server and i try to use swish.cgi.
>
> I've configured my virtual server to use cgi but I always have a 500 error
> (internal error) ...
Check your web server's error logs, the real error message should be there.
--
Stephen Patterson http://www.lexx.uklinux.net/ /"\
steve@SPAM.lexx.uklinux.net remove SPAM to reply \ /
Linux Counter No: 142831 GPG Public key: 252B8B37 X
ASCII Ribbon Campaign against HTML mail & news / \
------------------------------
Date: Wed, 16 Oct 2002 20:18:43 +1000
From: "Gregory Toomey" <nobody@nowhere.com>
Subject: Re: Internal error (code 500) on every CGI
Message-Id: <f_ar9.54245$g9.157000@newsfeeds.bigpond.com>
Antoine wrote in message <3dad3920$0$242$626a54ce@news.free.fr>...
>#!/bin/sh
>echo "hello world !"
Looks a lot more like bash then Perl to me. Try alt.apache.configuration.
gtoomey
------------------------------
Date: Wed, 16 Oct 2002 12:25:46 +0200
From: stephan beal <stephan@wanderinghorse.net>
Subject: Re: Internal error (code 500) on every CGI
Message-Id: <aojera$cn6$2@ork.noris.net>
Antoine wrote:
> Hello
> I've installed e-swish on my apche server and i try to use swish.cgi.
>
> I've configured my virtual server to use cgi but I always have a 500 error
> (internal error) ...
>
> I've made a test with a test script (in the cgi-bin directory of my
> virtual server):
>
> #!/bin/sh
> echo "hello world !"
>
> It also give me a 500 error ...
if i recall correctly, the problem is that you're not outputing the headers
that a CGI script should output. i can't remember what they are except that
it is one line followed by two newline characters. (i last had this problem
about 5 years years ago and my memory fails me at the moment.)
Here we go:
http://www.google.com/search?q=cgi%20output%20header%20%5Cn%5Cn
http://crdlx5.yerphi.am/~nerses/doc/WWW/Help/Part3/output.html
Try this at the top of your script:
echo -e "Content-type: text/html\n\n"
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.
------------------------------
Date: Wed, 16 Oct 2002 16:36:39 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: New JAPH
Message-Id: <aok0sg$fn9$1@news.dtag.de>
Hey,
please check out my new (and first) JAPH. Is it an original idea or have
you seen something like it before?
<JAPH>
srand 108641088; print chr int rand 256 for qw<J A P H>
</JAPH>
If the srand value doesnt work for you (it's highly depended on your
perl config) you can find your own with this script:
(note: it might take a few hours to find the value. The script is thus
not very pretty but supposed to be fast. Of course, there are O(1) ways
to do this, but I guess not without knowledge of the random number
algorithm)
use strict;
use integer;
my $i = 1;
my @cur;
my $cur;
my @list = qw/J A P H/;
while (++$i) {
srand $i;
@cur = map { chr int rand 256 } @list;
if(uc $cur[0] eq "J") {
#print "First right: $i\n";
if(uc $cur[1] eq "A") {
print "Second right: $i\n";
if(uc $cur[2] eq "P") {
$cur = join "", @cur;
print "Third right: $cur = $i\n";
if(uc $cur[3] eq "H") {
print "Fourth right: $cur = $i\n";
die $i;
}
}
}
}
}
Bye,
->malte
--
srand 108641088; print chr int rand 256 for qw<J A P H>
------------------------------
Date: Wed, 16 Oct 2002 11:00:39 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: New JAPH
Message-Id: <Pine.SGI.3.96.1021016105917.40095A-100000@vcmr-64.server.rpi.edu>
[posted & mailed]
On Wed, 16 Oct 2002, Malte Ubl wrote:
> if(uc $cur[0] eq "J") {
> #print "First right: $i\n";
> if(uc $cur[1] eq "A") {
> print "Second right: $i\n";
> if(uc $cur[2] eq "P") {
> $cur = join "", @cur;
> print "Third right: $cur = $i\n";
> if(uc $cur[3] eq "H") {
> print "Fourth right: $cur = $i\n";
> die $i;
> }
> }
> }
> }
>}
Why all that work? You're not changing anything if you get a miss. I'd
say:
if ("@cur" eq "@list") { print "ok! $i\n" }
--
Jeff "japhy" Pinyan RPI Acacia Brother #734 2002 Acacia Senior Dean
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Wed, 16 Oct 2002 13:08:46 +0200
From: "Anthony" <anthony.heuveline@wanadoo.fr>
Subject: Re: Newbie: Date comparison
Message-Id: <aojh78$ct2$1@news-reader10.wanadoo.fr>
The operating system is Unix. You're right, it is not the creation date but
the date when the file was uploaded. The fact is that I already have this
date, but I don't how to compare it with the current date...
Thanks for your help.
Anthony.
"John W. Krahn" <krahnj@acm.org> a écrit dans le message news:
3DAD34B2.D870D735@acm.org...
> Anthony wrote:
> >
> > I want to compare the creation date of some files with the current
date.
> > How can I can get the number of days that separate these two dates?
>
> Which operating system? In Unix, files do not have a creation date.
>
>
> John
> --
> use Perl;
> program
> fulfillment
------------------------------
Date: Wed, 16 Oct 2002 11:19:37 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Newbie: Date comparison
Message-Id: <3DAD4B19.DD551AF6@acm.org>
Anthony wrote:
>
> "John W. Krahn" <krahnj@acm.org> a écrit dans le message news:
> 3DAD34B2.D870D735@acm.org...
> > Anthony wrote:
> > >
> > > I want to compare the creation date of some files with the current date.
> > > How can I can get the number of days that separate these two dates?
> >
> > Which operating system? In Unix, files do not have a creation date.
>
> The operating system is Unix. You're right, it is not the creation date but
> the date when the file was uploaded. The fact is that I already have this
> date, but I don't how to compare it with the current date...
Use Time::Local to convert the date to Unix time and compare it to the
results from the time() function.
perldoc Time::Local
perldoc -f time
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 16 Oct 2002 07:31:48 -0400
From: "Tulan W. Hu" <twhu@lucent.com>
Subject: Re: Newbie: Date comparison
Message-Id: <aojio1$cq8@netnews.proxy.lucent.com>
download either Date::Manip or Date::Calc from cpan.
"Anthony" <anthony.heuveline@wanadoo.fr>
> Hi,
>
> I want to compare the creation date of some files with the current
date.
> How can I can get the number of days that separate these two dates?
------------------------------
Date: Wed, 16 Oct 2002 13:44:09 +0200
From: "Hans Grund" <Hans.Grund@fja.com>
Subject: Re: Newbie: Date comparison
Message-Id: <3dad5106$0$310$6e37e724@news.dpn.de>
Use perl module Date::Manip (see www.cpan.org)!
Here is an extract of the documentation.
Hans
[snip]
2. Compare two dates
$date1=&ParseDate($string1);
$date2=&ParseDate($string2);
$flag=&Date_Cmp($date1,$date2);
if ($flag<0) {
# date1 is earlier
} elsif ($flag==0) {
# the two dates are identical
} else {
# date2 is earlier
}
[snip]
"Anthony" <anthony.heuveline@wanadoo.fr> schrieb im Newsbeitrag
news:aojh78$ct2$1@news-reader10.wanadoo.fr...
> The operating system is Unix. You're right, it is not the creation date
but
> the date when the file was uploaded. The fact is that I already have this
> date, but I don't how to compare it with the current date...
>
> Thanks for your help.
>
> Anthony.
>
> "John W. Krahn" <krahnj@acm.org> a écrit dans le message news:
> 3DAD34B2.D870D735@acm.org...
> > Anthony wrote:
> > >
> > > I want to compare the creation date of some files with the current
> date.
> > > How can I can get the number of days that separate these two dates?
> >
> > Which operating system? In Unix, files do not have a creation date.
> >
> >
> > John
> > --
> > use Perl;
> > program
> > fulfillment
>
>
------------------------------
Date: Wed, 16 Oct 2002 07:44:59 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie: Date comparison
Message-Id: <slrnaqqnqb.2hh.tadmc@magna.augustmail.com>
Anthony <anthony.heuveline@wanadoo.fr> wrote:
> I want to compare the creation date of some files with the current date.
> How can I can get the number of days that separate these two dates?
----------------------------
#!/usr/bin/perl
use warnings;
use strict;
my $filetime = (stat 'some.file')[9]; # modification time
my $nowtime = time;
my $daysdiff = ($nowtime - $filetime) / (60*60*24);
print "$daysdiff days difference\n";
----------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 16 Oct 2002 13:00:22 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Newbie: Date comparison
Message-Id: <sgoqqugmjth2uk7msu1ak7s23ilub5vq4a@4ax.com>
Anthony wrote:
>The operating system is Unix. You're right, it is not the creation date but
>the date when the file was uploaded. The fact is that I already have this
>date, but I don't how to compare it with the current date...
There's the -C operator (see `perldoc -f -X`) which can tell you the
difference between inode change time and start date of the script, in
days. Is that what you want?
Furthermore, the field with index 10 returned by stat() will return the
"inode change time" in seconds since the epoch. Subtract that from
time() and you have how long ago it was, in seconds.
--
Bart.
------------------------------
Date: Wed, 16 Oct 2002 17:00:27 +0200
From: "Anthony" <anthony.heuveline@wanadoo.fr>
Subject: Re: Newbie: Date comparison
Message-Id: <aojupl$bnt$1@news-reader11.wanadoo.fr>
Thank you all.
Good evening (in France!!!).
Anthony
"Anthony" <anthony.heuveline@wanadoo.fr> a écrit dans le message de news:
aojbic$o2i$1@news-reader10.wanadoo.fr...
> Hi,
>
> I want to compare the creation date of some files with the current
date.
> How can I can get the number of days that separate these two dates?
>
> Thank you in adavance.
>
> Anthony.
>
>
------------------------------
Date: Wed, 16 Oct 2002 11:35:57 GMT
From: Derek Thomson <derek@wedgetail.com>
Subject: Re: Opinion on using Perl or JavaScript for Web development
Message-Id: <xacr9.453$i84.53720@news.optus.net.au>
Ron Savage wrote:
> "Brian" <BChirhart@fnni.com> wrote in message news:9d13498b.0210151551.7dc7f22f@posting.google.com...
>
>>This is more of an opinion question than anything. Hopefully I will
>>go down the right track after your responses...
>>
>>I need to develop a web page. It will need to have radio buttons,
>>drop downs, and list boxes. The drop down menus need to be cascading
>>(i.e. change an option in the first menu and the values listed in the
>>second menu change).
This is all possible in Perl, as Perl just generates the HTML that is
then returned to the client's browser.
Is there any such thing as a web site that *needs* a drop down menu,
though? ;)
The few I've seen with them are quite irritating and difficult to use,
and only work properly in some browsers (if you use Javascript to
achieve this, and an almost inverse set of browsers if you do it with CSS!!)
Please, make sure the site works even if the drop-down menus are
unavailable ie. include normal, standard, links for navigation as well.
--
D.
------------------------------
Date: Wed, 16 Oct 2002 15:00:59 +0100
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: Opinion on using Perl or JavaScript for Web development
Message-Id: <aojrdo$kb6$1$8300dec7@news.demon.co.uk>
Brian,
"Brian" <BChirhart@fnni.com> wrote in message
news:9d13498b.0210151551.7dc7f22f@posting.google.com...
> This is more of an opinion question than anything. Hopefully I will
> go down the right track after your responses...
>
> I need to develop a web page. It will need to have radio buttons,
> drop downs, and list boxes. The drop down menus need to be cascading
> (i.e. change an option in the first menu and the values listed in the
> second menu change).
A possible mechanism is to have the server CGI (Perl) script encode a
complete set of permitted mappings from "options in the first menu" to
"values listed in the second menu." Then, the accompanying Javascript can
dynamically re-populate the second menu according to the latest selected
option in the first menu.
That may be quite a lot of mapping data to send out to the browser. The way
to convey it is in a hidden field. Encode it in a way that is easy for
Javascript to decode, perhaps as a multi-dimensional Object initializer.
(Javascript books and downloads from the Web will explain Object
initializers.)
> Also, the second menu has to be populated by
> reading the directory structure of a server.
Read the full directory tree, that it is safe for this web page to expose to
the user, before your CGI server script hands over to the browser. As I
said above, pass the listing in a suitable formatted hidden field.
> The list box is
> populated from the list of files that are in the directory of the
> second drop down.
> Because of that, I can not get CGI (or CGI.pm) to
> work.
Use of CGI/CGI.pm is not a reason for not being able to make this work.
Admittedly it can be a daunting task if you have not tackled this before.
But CGI.pm is tailor-made for the job. And it neatly dove-tails with
separate Javascript library modules that you may care to write, avoiding the
appalling inter-weaving of Perl, Javascript, and HTML that careless
programmers often clutter their CGI scripts with.
CGI.pm refers to Javascript modules with URLs. You can include references
to lots of Javascript modules.
It's a steep learning curve, but it can be done. The more you know about
Perl, CGI, Javascript, CGI.pm, and (least important of all) HTML, the more
likely you are to integrate the lot cleanly.
> Once the values are entered in the radio buttons and the drop
> downs, the user will need to click a button (submit or otherwise) and
> a perl script will need to run that will create a JPG or PNG file.
> Then a new web page will need to open displaying some text and the
> file.
At this point, I would make the browser send a web page back to your CGI
server script, requesting the user-selected file. The CGI server script
would then check the file exists, check the user is allowed to see it (in
case he asks to see something named like ../../../../../etc/passwd !!), and
then send it back to the browser in a suitable new web page.
>
> My problem is:
> If I use all Perl - I can not get a GUI web interface. If this is
> wrong and I can do this whole thing in Perl PLEASE TELL ME!!! I
> already have most of the code written in Perl and would really hate to
> change it.
>
> If I use CGI - I can not get cascading menus to work correctly and can
> not access the directories on the server. This is a limitation of CGI
> - correct?
>
No. See my remarks above about collecting all the data together on the
server, before passing the full shhoting match to the browser for user
selection, and dynamic re-population of menus by Javascript.
> If I use Javascript... Well - I don't know much about Javascript
You'll need to learn lots fast, if you want to do dynamic menuing with
Javascript.
As a tutorial, try David Flanagan's "Javascript - Reference Guide" - pub.
O'Reilly, ed. 4.
> and I
> thought that was going to be my answer. But then I read a bunch of
> posts where people are talking about server side/client side JS and
> basically that you should not mix perl and JS.
Mixing Perl and Javascript is bread and butter to many CGI scripts - or at
least using URLs to source Javascript modules from web pages generated by
Perl scripts.
I think you can ignore server-side Javascript, and stick with client-side
Javascript plus server-side Perl.
>
> The last option is PHP - which I know NOTHING about other than how to
> spell it.
>
> I am not against learning any of these things, but if you had my
> assignment,
Asignment - crumbs, that's a pretty tall order for a (student?) assignment.
Have you got a spare fortnight?
> what route would you take?
Read the FAQs on CGI and CGI with Perl; Idiot's Guide to CGI Programming,
including:
http://www.perl.org/CGI_MetaFAQ.html
http://www.wiley.com/legacy/compbooks/stein/
http://www.amazon.com/exec/obidos/ASIN/0596000480/qid=1034775955/sr=2-1/ref=
sr_2_1/103-3870090-0337431
Also, Perl distributions, including ActiveState.com, come with good
documentation on integrating Perl and Javascript thru CGI.pm.
>
> TIA for all your input and suggestions.
> Brian
------------------------------
Date: Wed, 16 Oct 2002 11:29:46 +0100
From: "Rubber Duck" <rubberducky703@hotmail.com>
Subject: Re: Peculiar problem with Win32::OLE (No type library matching "Microsoft Excel")
Message-Id: <aojf0l$n2nbf$1@ID-116287.news.dfncis.de>
Without installing Excel, how can i get around this??
"Sojourneer" <david.hawley@acm.org> wrote in message
news:aoj7j3$5r9$1@newsflood.tokyo.att.ne.jp...
>
>
> > I have the script up and running fine here on my localhost. However I
> have
> > transferred the same script over to a test machine and I'm getting all
> sorts
> > of errors:
> > No type library matching "Microsoft Excel" found at queries.pl line 10
>
> I would guess that Excel is not installed on the server, so Perl can't
find
> its typelib.
>
>
------------------------------
Date: 16 Oct 2002 03:14:19 -0700
From: gary@ashton-jones.com.au (gaj)
Subject: Re: Problem with Class::Date Module
Message-Id: <7c6ee5e9.0210160214.42155e12@posting.google.com>
"Bill Smith" <apobull@yahoo.com> wrote in message news:<anhetm$dvhe3$1@ID-135411.news.dfncis.de>...
> Hi,
>
> I just installed the latest version of the class::date module and ran into a
> problem with a script which is referencing it. At 12:01 AM each day I had a
> script kick off which computed the date at that time and created a file
> based on the date in dd-mm-yyyy format. I computed the current date using
> the now call. Since installing the new version use of the now call returns
> the previous day as the current date. i.e. if the script runs at 12:01 AM on
> 10-03-2002 it returns 10-02-2002 as the current date. If the script runs
> about 5 hours later the expected date is returned. I see my problem is that
> the date is returned in GMT. I need to return it in EST. What code do I need
> to add to my script in order to have the time in EST returned when the
> scripts runs at 12:01 AM and not in GMT. I took a look at the docs for the
> module but still not certain of what I should add. I'll include my script
> below for reference. It is pretty short
>
>
>
> use Class::Date qw(:errors date localdate gmdate now);
> local $Class::Date::DATE_FORMAT="%m-%d-%Y";
>
> $LOGDIR="/flow/logs";
> $BINDIR="/flow/bin";
>
> chdir $LOGDIR or die "Could not chdir to $LOGDIR $!";
>
> system("pkill fdget");
> #print ("Pkill value is $a\n");
>
> $curdate = now';
> $prevday = $curdate - '1D';
> system("$BINDIR/fdget 2001 >> $LOGDIR/$curdate &");
> system("sleep 3600");
> system("gzip -9 $prevday");
>
>
>
> Thanks,
>
> Bill
I had the same problem when I installed the latest version of
Class::Date on my development machine. My old machine with v1.0.10 has
no such problem.
The 'problem' is that the latest version uses timezone settings fully
whereas the previous version didn't.
I've installed RedHat Linux 7.3 on my dev machine and for some reason
it installed a weird timezone file in /usr/share/zoneinfo. I'm in
Sydney and the zone is EST (type 'date' on command line if using
Linux/Unix to check timezone). I resorted to removing the EST file and
linking /usr/share/zoneinfo/Australia/Sydney to
/usr/share/zoneinfo/EST. Thereafter Class::Date returned the correct
date and time for 'now'.
HTH
Gary
------------------------------
Date: Wed, 16 Oct 2002 09:58:50 -0400
From: "Tulan W. Hu" <twhu@lucent.com>
Subject: Re: Problems after update 5.0 -> 5.8
Message-Id: <aojrbo$fa8@netnews.proxy.lucent.com>
> How do I find out ALL installed perl modules in the system?
$ perldoc /...../perl/lib/5.6.0/architecture_name/perllocal.pod
I would redownload all the newer version of modules and rebuild them for
5.8.
------------------------------
Date: Wed, 16 Oct 2002 12:52:59 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Problems with perl.org/perlmongers.org websites and email addresses
Message-Id: <7vnqqukp3k9vu8hoi8nrljh1kpbadp48o9@4ax.com>
The website <http://lists.perl.org> is offline, gining me a 500 "could
not connect to server" error. I tried to warn the webmaster via
<lists@perlmongers.org> but my SMTP server refuses to send mail to that
address:
450 <lists@perlmongers.org>: Recipient address rejected: Domain
not found.
I also noticed that <http://www.perlmongers.org> and
<http://perlmongers.org> give me a DNS error.
I'm posting this here hoping somebody who can do something about it will
pick it up
.
--
Bart.
------------------------------
Date: Wed, 16 Oct 2002 12:03:16 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Random Character Picker
Message-Id: <Pine.LNX.4.40.0210161200360.8265-100000@lxplus071.cern.ch>
On Oct 16, John W. Krahn inscribed on the eternal scroll:
> > my $random_printable = chr ((rand 224) + 32);
>
> But that includes non-printable characters like 127
yes...
> and 255.
In which character coding is 255 non-printable? In iso-8859-1, for
example, it's y-diaeresis; but the whole range 128-159 is reserved
for control functions.
best regards
------------------------------
Date: Wed, 16 Oct 2002 10:54:19 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Random Character Picker
Message-Id: <3DAD452C.C73AB187@acm.org>
"Alan J. Flavell" wrote:
>
> On Oct 16, John W. Krahn inscribed on the eternal scroll:
>
> > > my $random_printable = chr ((rand 224) + 32);
> >
> > But that includes non-printable characters like 127
>
> yes...
>
> > and 255.
>
> In which character coding is 255 non-printable? In iso-8859-1, for
> example, it's y-diaeresis; but the whole range 128-159 is reserved
> for control functions.
I wasn't sure about 255 but I seem to recall that it is non-printable in
the default character set in DOS. (But that was many eons ago in an
operating system far, far away.)
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 16 Oct 2002 12:27:19 +0100
From: "Andrew Harton" <andrew_harton@agilent.com>
Subject: Re: Random Character Picker
Message-Id: <1034767493.337049@cswreg.cos.agilent.com>
John W. Krahn wrote:
> Andrew Harton wrote:
>>
>> Benjamin Goldberg wrote:
>>> John W. Krahn wrote:
>>>>
>>>> my @characters = map chr, 0 .. 255;
>>>> my $random_character = $characters[rand @characters];
>>>
>>> That's just plain silly.
>>>
>>> my $random_character = chr rand 256;
>>
>> ..but including non-printable characters is probably not what's
>> wanted.
>>
>> How about this?
>>
>> my $random_printable = chr ((rand 224) + 32);
>
> But that includes non-printable characters like 127 and 255.
>
Yes, but at least there's less of them :-)
--
$s="acehJklnoPrstu ";$_="4dbce078c32ae92a6e30152a";
split//;for(0..$#_){print substr($s,hex $_[$_],1);}
------------------------------
Date: Wed, 16 Oct 2002 13:31:40 GMT
From: "Nemo Oudeheis" <nikogo@nigde.net>
Subject: Re: Read a single character from STDIN (W98)
Message-Id: <0Tdr9.8070$1P1.648758@bgtnsc05-news.ops.worldnet.att.net>
Thanks for the tip. There are many interesting functions in this module,
including InputChar.
However, as far as I can discern, it is intended to work in the windowing
subsystem, not with the "dosbox" STDIN. At least, I don't seem to be able
to set it up to do this. I tried:
require Win32::Console;
$CONSOLE = Win32::Console->new();
$CONSOLE->Select(STD_INPUT_HANDLE);
print "Y/N?\n";
$c = $CONSOLE->InputChar(1);
printf( "You typed <%s> (i.e., 0x%0x)\n", $c, ord $c );
This looks promising, but doubtless there is just something I have
overlooked. Probably, rather than creating a new console object, I need to
be able to find the dosbox console.
This doesn't work.
~Nemo
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message
news:3DAB9BF8.94178C4A@earthlink.net...
> Nemo Oudeheis wrote:
> >
> > I am using ActivePerl on a Win98 system. I would like to read a
> > single character from STDIN to get the reply from a (Y/N) question,
> > without having to terminate the line with by hitting <ENTER>, as is
> > the default with getc and read.
>
> Maybe Win32::Console will work?
>
> --
> my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
> ."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Thu, 17 Oct 2002 00:35:24 +1000
From: Derek Thomson <derek@wedgetail.com>
Subject: Re: Switching from Python to Perl
Message-Id: <3dad7934$0$12762$afc38c87@news.optusnet.com.au>
Derek Thomson wrote:
> Benjamin Goldberg wrote:
>
>> Derek Thomson wrote:
>> [snip]
>>
>>> So, Java. Perl really can't win here, as Python has the amazing
>>> Jython.
>>
>>
>>
>> How does Jython compare to JPL, "Java Perl Lingo"?
[snip list of ways Jython beats out JPL]
I thought of one other major advantage in favor of Jython. You can
actually produce Java bytecode from your Python code, or your
Python/Java hybrid, and then ship it as you would any other Java
application.
Which means that the end user doesn't even need to know it was written
in Python in the first place, and they *definitely* do not have to link
in libperl.so to make it run (which also means *obtaining* a libperl.so
from somewhere). It just runs exactly as any other Java bytecode would
on a plain, ordinary JVM. They don't even need Jython! When you
"package" a Jython application, it automatically works out what Python
libraries you need and puts the bytecode for those in the Java "jar" file.
It's great stuff, indeed - http://jython.org. I wish there was something
like it for Perl, but that seems unlikely, given the amount of effort
involved in implementing Perl entirely in Java.
--
D.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 3980
***************************************