[12329] in Perl-Users-Digest
Perl-Users Digest, Issue: 5929 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 9 10:07:19 1999
Date: Wed, 9 Jun 99 07:00:21 -0700
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, 9 Jun 1999 Volume: 8 Number: 5929
Today's topics:
Binary File Uploading - Part 2 <dfs@thegrid.net>
Re: Calling an applet from perl (Kenny A. Chaffin)
Re: Calling an applet from perl (Scott McMahan)
Re: Confused by configuraton file and 'use strict' <jdf@pobox.com>
Re: connection and X25 communication (Charlie Stross)
Re: E-mailing with perl is driving me crazy! (Stuart Wright)
Re: E-mailing with perl is driving me crazy! (Malcolm Ray)
Re: E-mailing with perl is driving me crazy! <gellyfish@gellyfish.com>
Re: encoding an N bit two's complement value as hex. <sb@sdm.de>
Re: fork for DNS lookup - help (Malcolm Ray)
Re: fork for DNS lookup - help <delete.the.nospam.kayec@gov.ns.ca>
Re: fork for DNS lookup - help <delete.the.nospam.kayec@gov.ns.ca>
Re: Get Date in Perl (I R A Aggie)
Re: HELP:Hash mapping of subroutines with params <jdf@pobox.com>
How connect to a remote Oracle database in your perl pr <chongsun@krdl.org.sg>
how to connect oracle 8 thru perl on NT <chetan_gautam@hotmail.com>
Re: how to connect oracle 8 thru perl on NT (Lars Reineke)
Re: how to connect oracle 8 thru perl on NT <gellyfish@gellyfish.com>
How to use lwp-request with proxy and with different po <nacis@se.bel.alcatel.be>
HTML::FromText 1.004 <garethr@cre.canon.co.uk>
Re: Intersection of several lists <gellyfish@gellyfish.com>
Re: Net::FTP and IP-adress <hal9000@fetchmail.com>
Newbie simple question regarding graphics/charts displa monsri@my-deja.com
Re: Perl "constructors" <jdporter@min.net>
Re: Perl on win32 <sb@sdm.de>
Re: Problems sorting. I'm stupid and I'll die (Michel Dalle)
Re: quotemeta (Tad McClellan)
Re: Regular Expresion <tlynch@cisco.com>
Re: Search a list for an element <jdf@pobox.com>
Re: Will future releases of Perl be rewritten in C++? (Scott McMahan)
Re: Writing a program to control the CD-ROM in U*IX? <cschmitz@stud.informatik.uni-trier.de>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 09 Jun 1999 10:39:25 GMT
From: "Ryan" <dfs@thegrid.net>
Subject: Binary File Uploading - Part 2
Message-Id: <01beb265$2fc60460$f031a2d1@ryano-ke>
Ok, I thought I had it worked out with the help of Will Smith (Thanks for
your time Will!)
I am trying to get a web based binary (.jpg) file upload script to work.
Unfortunately, I do not have access to the server logs. I am receiving a
500 internal error and I am hoping someone can look at these two snips and
see what is wrong..
Snip #1 (Getting the data) BTW: Using CGI.pm
sub get_info{
$name = $query->param('name'); #name entered on form
$file_name = $query->param('file_entered'); #file name
entered on form
@parts = split(/\\/, $file_name); #split file name path at the backslash
$newname = $parts[$#parts]; #gets the last value of the parts array
}
The above works fine..I suspect the problem to be in the output
subroutine...
code snip #2
sub print_results{
open (NEWPIC,">../submits/$newname") || #creates the file on
the server
die "Unable to create or open file $!"; #or die
while ($bytesread=read($file_name,$buffer,1024)) {
print NEWPIC $buffer;
}
close(NEWPIC);
}
I have followed the CGI.pm docs with no luck. The file is created on my
server in the submits directory nicely split down to say 8.jpg from
c:\the\path\to\8.jpg but the file is 0kb. Nothing is read into the file and
the script terminates with a 500 Internal error....
The only thing I could think of, was I needed a print
header('image/gif'); before the open call but that didn't work either.
If it makes a difference, &get_info is called before &print_results
Humbly spoken...Help!? <G>
Thanks for your time
Ryan
------------------------------
Date: Wed, 9 Jun 1999 04:27:20 -0600
From: kenny@kacweb.com (Kenny A. Chaffin)
Subject: Re: Calling an applet from perl
Message-Id: <MPG.11c7ef71c9686bce98adc5@news.dimensional.com>
In article <01beb211$185d2be0$8a867dc2@goyra>, David@spamoff.byrden.com
says...
> Gerardo <greynaga@yahoo.com> wrote in article
> <7jj8mv$lts$1@nnrp1.deja.com>...
>
>
> > Hi there,
> >
> > I'm trying to call an applet from a perl script. I keep getting:
> > "Applet Files class Files could not be loaded"
> > This message doesn't tell me much, but I think that is not finding the
> > applet.
> >
> > This is the way I'm calling it:
> > .....
> > print '<applet codebase="cgi-bin/test" code="Files.class"
> > archive="gfiles.jar" width=600 height=250>';
> > print '</applet>';
> > .....
> >
> > I've tried putting absolute path in codebase, I have the .class and .jar
> > files in cgi-bin/test.
>
>
> Does your web server allow
> browsers to read files from the cgi-bin/test
> directory?
>
>
> David
>
And can you run the applet directly from a static web page?
KAC
--
KAC Website Design
Custom Programming, Web Design, and Graphics
kenny@kacweb.com - http://www.kacweb.com
------------------------------
Date: 9 Jun 1999 12:46:47 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Calling an applet from perl
Message-Id: <375e6237.0@news.new-era.net>
Gerardo (greynaga@yahoo.com) wrote:
> I'm trying to call an applet from a perl script. I keep getting:
> "Applet Files class Files could not be loaded"
But your program is a CGI program, and its document base is
different from regular web pages. Could it be that you need
to give the complete URL to the class files?
Scott
------------------------------
Date: 09 Jun 1999 09:39:32 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: J.Olsen@btinternet.com
Subject: Re: Confused by configuraton file and 'use strict'
Message-Id: <m34skhcx2j.fsf@joshua.panix.com>
John Olsen <J.Olsen@btinternet.com> writes:
> use strict ;
> do 'config.cfg' ;
> print "varx is $varx\n" ;
>
> and in the 'config' file I have
>
> $varx = '$value_x' ;
>
> With 'use strict' in operation I get 'requires explicit package
> name'
You might try the vars pragma, which would have the additional benefit
of documenting what you expect to be found in the configuration file.
use vars qw( $varx $vary );
do 'config.cfg';
perldoc vars for more information.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Wed, 09 Jun 1999 11:59:52 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: connection and X25 communication
Message-Id: <slrn7lslpp.75t.charlie@charlie.ed.datacash.com>
Stoned koala bears drooled eucalyptus spittle in awe
as <pbm@iotp.demon.co.uk> declared:
> I need to write some software which connects to a freephone
>number in the UK and then receives and transmits data using the X25
>protocol. Is this possible in Perl? Or would another language be better?
I'm not clear on this. Are you trying to dial into a publicly-accessible
PAD, such as one used by a UK bank for performing credit card
authorisations? If so, you may be able to just print text messages to
the PAD and read whatever comes back off the X.25 network connection
as plain text.
(You can do this in Perl; examine the Expect module, but be advised
it's probably not a beginner-level problem. You may find it easier to
use expect instead.)
> Ideally, I'd like to call a cgi-script which could make the
>connection and communicate, however my website is hosted on a third-
>party server so I can't really see how it's possible. Any help
>whatsoever appreciated.
Firstly, depends what your web space provider is willing to put up
with -- will they install a modem on their server that you can use to
dial out, for example. (If you've got a colocation service rather than
just <x> megabytes of space on someone else's box, this may be possible.)
Secondly, you're going to have fun handling the possible timeout
situations -- if, say, the number you're dialing is busy, or there's no
response, or whatever. Again: not trivial.
(To put it in perspective, I've written an application which does pretty
much what you want, except that instead of placing a phone call to an
X.25 pad it connects to one via TCP/IP. Getting this to work reliably
probably took two or three weeks programming and debugging work, never
mind the applications layered on top of it.)
-- Charlie
------------------------------
Date: Wed, 09 Jun 1999 10:14:02 GMT
From: stuw@dial.pipex.com.remove.everything.after.com (Stuart Wright)
Subject: Re: E-mailing with perl is driving me crazy!
Message-Id: <375e3d50.2982158@news.demon.co.uk>
On Wed, 9 Jun 1999 21:06:28 +1200, "Christopher Fairbairn"
<lgcl01@es.co.nz> wrote:
ripped from Matt Wright's FORMMAIL script.
$mailprog = '/usr/sbin/sendmail'; # or whatever
$recipient = 'blah';
$email = 'blah';
$realname = 'blah';
$subject = 'blah';
open(MAIL,"|$mailprog -t");
print MAIL "To: $CONFIG{'recipient'}\n";
print MAIL "From: $CONFIG{'email'} ($CONFIG{'realname'})\n";
print MAIL "Subject: $CONFIG{'subject'}\n\n";
print MAIL "your message\n";
close (MAIL);
hope this helps.
--
Stuart Wright stu-w@usa.net.remove.everything.after.net
Software Developer,
Web author for the Hi-Fi and Home Cinema Industries,
MIDI sequencer, Drummer and Motorcyclist.
Visit my web site http://ds.dial.pipex.com/town/road/xmk67/
------------------------------
Date: 9 Jun 1999 10:27:44 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: E-mailing with perl is driving me crazy!
Message-Id: <slrn7lsgd0.90f.M.Ray@carlova.ulcc.ac.uk>
On Wed, 09 Jun 1999 10:14:02 GMT, Stuart Wright
<stuw@dial.pipex.com.remove.everything.after.com> wrote:
>On Wed, 9 Jun 1999 21:06:28 +1200, "Christopher Fairbairn"
><lgcl01@es.co.nz> wrote:
>
>
>
>ripped from Matt Wright's FORMMAIL script.
Gah. Rarely a good idea.
>$mailprog = '/usr/sbin/sendmail'; # or whatever
>$recipient = 'blah';
>$email = 'blah';
>$realname = 'blah';
>$subject = 'blah';
>
>open(MAIL,"|$mailprog -t");
Doesn't check for failure of open.
>print MAIL "To: $CONFIG{'recipient'}\n";
>print MAIL "From: $CONFIG{'email'} ($CONFIG{'realname'})\n";
>print MAIL "Subject: $CONFIG{'subject'}\n\n";
>print MAIL "your message\n";
>close (MAIL);
Doesn't check for failure of close.
You should *always* check the return status of an open. In the case
of pipe opens (as above), you should also check the corresponding
close. See perlipc for an explanation.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: 9 Jun 1999 11:34:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: E-mailing with perl is driving me crazy!
Message-Id: <375e4326@newsread3.dircon.co.uk>
Christopher Fairbairn <lgcl01@es.co.nz> wrote:
> Hi,
>
> I have a small question.
>
> Why does the following peice of perl code fail:
>
<snip code>
>
> It looks fine to me and both of those email accounts work properly. The
> problem is that with this program there is never ever any email sent to
> lgcl01@ihug.co.nz
>
> Why is it that if I send an email with this simple perl / sendmail I get it
> if I send it to lgcl01@es.co.nz but not if the perl / sendmail program
> thinks it is being sent to lgcl01@ihug.co.nz ?
>
If it works for one address and not for the other then the problem is almost
certainly not to do with Perl but with mail. You ought to read the section
in perlfaq9 that discusses the sending of mail.
That address works fine for me BTW:
lgcl01@ihug.co.nz... Connecting to mx1.ihug.co.nz. via smtp...
220 mx1.ihug.co.nz ESMTP Sendmail 8.9.3/8.9.3; Wed, 9 Jun 1999 22:29:57 +1200
>>> EHLO pigment.dircon.net
250-mx1.ihug.co.nz Hello pigment.dircon.net [194.112.33.17], pleased to meet you
250-8BITMIME
250-SIZE 10000000
250-DSN
250-ONEX
250-XUSR
250 HELP
>>> MAIL From:<jns@pigment.dircon.net> SIZE=46
250 <jns@pigment.dircon.net>... Sender ok
>>> RCPT To:<lgcl01@ihug.co.nz>
250 <lgcl01@ihug.co.nz>... Recipient ok
>>> DATA
354 Enter mail, end with "." on a line by itself
>>> .
250 WAA04248 Message accepted for delivery
lgcl01@ihug.co.nz... Sent (WAA04248 Message accepted for delivery)
Closing connection to mx1.ihug.co.nz.
>>> QUIT
221 mx1.ihug.co.nz closing connection
(This is the output from sendmail with the -v switch).
I would ask a local mail expert - if you have any further difficulties
you should ask in comp.mail.sendmail
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 9 Jun 1999 11:49:09 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: encoding an N bit two's complement value as hex.
Message-Id: <7jlkbl$d52$1@solti3.sdm.de>
[Posted && Mailed]
In article <375D9EFA.4AA1903F@raytheon.com>, Robert Bell <rabell@raytheon.com> wrote:
> I am wanting to print an integer value as a two's complement
> encoded hex string.
> I have looked at sprintf and it does not give control over the
> size of the hex string. I am needing it to represent a 10 bit
> two's complement encoding (9 bits of value, 1 sign bit).
> sprintf appears to give me 31 bits of value and 1 bit of sign.
> Anyone have any ideas?
use Bit::Vector;
$vec = Bit::Vector->new(10);
$vec->Word_Store(0,$value);
print "Result: $vec\n";
Hope this helps. :-)
See my sig below for URLs where to find this module.
Regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/
http://www.engelschall.com/u/sb/download/
http://www.perl.com/CPAN/authors/id/STBEY/
http://www.oreilly.de/catalog/perlmodger/bnp/
------------------------------
Date: 9 Jun 1999 10:56:22 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: fork for DNS lookup - help
Message-Id: <slrn7lsi2m.9as.M.Ray@carlova.ulcc.ac.uk>
On Tue, 8 Jun 1999 14:51:42 -0300, kayec <delete.the.nospam.kayec@gov.ns.ca>
wrote:
>To speed up DNS lookups i've split my list of IPs into 5 different files.
>Now i want to span five PERL programs to do the lookups.
>After the lookups are done i have to do more processing so i need to know
>when the five processes are done.
>
>I think i want to use FORK for this but am not clear on the syntax....
>
>HELP PLEASE !
See perlipc, which gives a fair amount of guidance about using fork. If
you have problems, post the relevant parts of your code here with a
description of what happens (and what you want to happen).
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: Wed, 9 Jun 1999 10:21:02 -0300
From: "kayec" <delete.the.nospam.kayec@gov.ns.ca>
Subject: Re: fork for DNS lookup - help
Message-Id: <qSt73.841$aP5.35158@sapphire.mtt.net>
WOW, thanks Michael....
That is fast.
Will have to lean FORK another day.
: (
Michael Fuhr wrote in message <7jkdmi$qej@flatland.dimensional.com>...
>"kayec" <delete.the.nospam.kayec@gov.ns.ca> writes:
>
>> To speed up DNS lookups i've split my list of IPs into 5 different files.
>> Now i want to span five PERL programs to do the lookups.
>> After the lookups are done i have to do more processing so i need to know
>> when the five processes are done.
>>
>> I think i want to use FORK for this but am not clear on the syntax....
>
>For an example of fast DNS lookups without forking, see the program
>I posted a few months ago:
>
> http://www.deja.com/getdoc.xp?AN=455581292&fmt=text
>
>--
>Michael Fuhr
>http://www.fuhr.org/~mfuhr/
------------------------------
Date: Wed, 9 Jun 1999 10:50:03 -0300
From: "kayec" <delete.the.nospam.kayec@gov.ns.ca>
Subject: Re: fork for DNS lookup - help
Message-Id: <Dhu73.868$aP5.35036@sapphire.mtt.net>
Sorry... what's perlipc ?
Malcolm Ray wrote in message ...
>See perlipc, which gives a fair amount of guidance about using fork. If
>you have problems, post the relevant parts of your code here with a
>description of what happens (and what you want to happen).
>--
>Malcolm Ray University of London Computer Centre
------------------------------
Date: 9 Jun 1999 13:30:05 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Get Date in Perl
Message-Id: <slrn7lsr97.2uu.fl_aggie@thepentagon.com>
On 08 Jun 1999 23:15:44 -0400, Uri Guttman <uri@sysarch.com>, in
<x7g1425ajj.fsf@home.sysarch.com> wrote:
+ i can't blacklist you here but i am sure i can influence others to do
+ so.
You're too kind, Uri. I say let him stay here.
Just give him obtuse and poorly phrased answers so that he gets fooled
into trodding down the wrong path.
James
------------------------------
Date: 09 Jun 1999 09:45:41 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: kgentes@gentek.net
Subject: Re: HELP:Hash mapping of subroutines with params
Message-Id: <m3yahtbi7u.fsf@joshua.panix.com>
kgentes@gentek.net writes:
> I really like the above usage of hash/procedure references, but here
> is what I want to do in the call. Is this ok?
What happened when you *tried* it?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Wed, 9 Jun 1999 17:52:51 +0800
From: "Lim Chong Sun" <chongsun@krdl.org.sg>
Subject: How connect to a remote Oracle database in your perl program?
Message-Id: <7jldn2$5nf$1@godzilla.krdl.org.sg>
Assuming that you are running the perl program from a client side and the
client side do not have Oracle, so cannot configure a DSN.
------------------------------
Date: Wed, 09 Jun 1999 11:21:54 GMT
From: CHETAN <chetan_gautam@hotmail.com>
Subject: how to connect oracle 8 thru perl on NT
Message-Id: <7jliod$grn$1@nnrp1.deja.com>
hi everybody,
i have an NT server installed on which perl5 and oracle 8 is installed
i want to access oracle database thru perl but cant
please guide me ...
thanks
CG
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 13:16:44 GMT
From: reineke@kreiskrankenhaus-hameln.de (Lars Reineke)
Subject: Re: how to connect oracle 8 thru perl on NT
Message-Id: <375e68ce.15308802@172.20.200.2>
Hi!
On Wed, 09 Jun 1999 11:21:54 GMT, CHETAN <chetan_gautam@hotmail.com>
wrote:
>i have an NT server installed on which perl5 and oracle 8 is installed
>
>i want to access oracle database thru perl but cant
Why? Any script given? Error messages?
"Help me, my PC doesn't work." ;-)
--
Lars Reineke
http://www.planet-interkom.de/pinhead
mailto:reineke@kreiskrankenhaus-hameln.de
------------------------------
Date: 9 Jun 1999 14:18:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to connect oracle 8 thru perl on NT
Message-Id: <375e69bf@newsread3.dircon.co.uk>
CHETAN <chetan_gautam@hotmail.com> wrote:
>
>
> hi everybody,
>
> i have an NT server installed on which perl5 and oracle 8 is installed
>
> i want to access oracle database thru perl but cant
>
I you have a recent Activestate distribution installed -
ppm install DBD-Oracle
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 09 Jun 1999 13:52:55 +0300
From: "Naci S. Ishakbeyoglu" <nacis@se.bel.alcatel.be>
Subject: How to use lwp-request with proxy and with different port (other than 80)?
Message-Id: <375E4787.18DDB1A7@se.bel.alcatel.be>
Well, after trying a little, I finally got it. Just to share with you:
lwp-request -p http://proxy.com:1080 http://www.perl.org
Naci.
--
Naci S. Ishakbeyoglu
S12 Software Design Tel: +90-216-420 7500 Ext. 2526
Rel8 Supplementary Services mailto:nacis@se.bel.alcatel.be
Alcatel - Istanbul
------------------------------
Date: 9 Jun 1999 11:33:56 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: HTML::FromText 1.004
Message-Id: <7jljf4$t9k$1@play.inetarena.com>
NAME
HTML::FromText - mark up text as HTML
SYNOPSIS
use HTML::FromText;
print text2html($text, urls => 1, paras => 1, headings => 1);
DESCRIPTION
The text2html function marks up plain text as HTML. By
default it converts HTML metacharacters into the
corresponding entities. More sophisticated transformations,
such as splitting the text into paragraphs or marking up
bulleted lists, can be carried out by setting the
appropriate options.
URL
http://www.cpan.org/authors/id/G/GD/GDR/HTML-FromText-1.004.tar.gz
NEW FEATURES
1.004 New options 'blockparas' (mark up block quotes as ordinary
paragraphs) and 'blockcode' (mark up block quotes in
fixed-width font while preserving line breaks and spaces).
Tabs are expanded throughout the text (it was a bug not to
do so in earlier versions because alignment could be lost,
block quotes not recognised, etc).
New option 'tables'.
--
Gareth Rees
------------------------------
Date: 9 Jun 1999 11:38:23 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Intersection of several lists
Message-Id: <375e441f@newsread3.dircon.co.uk>
Thomas Weholt <u970130@studbo.hit.no> wrote:
> Hi,
>
> I got several ( 3 - 15) lists that I need to put into one, containing
> only the items that are in all the lists ( intersection ).
>
C:\WINDOWS\Desktop>perldoc -q intersection
Found in C:\PERL\lib/pod/perlfaq4.pod
How do I compute the difference of two arrays?
How do I compute the intersection of two arrays?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 09 Jun 1999 12:15:09 +0200
From: hal9000 <hal9000@fetchmail.com>
Subject: Re: Net::FTP and IP-adress
Message-Id: <375E3EAD.C18CD9D@fetchmail.com>
I had a second look at it, and I think I will answer my own
question :-) I was confused by the error messages...
If there is no FTP-server listening on $host then Net::FTP
gives the error-message 'Unknown error'. If there is then
everything works fine.
If $host is set to a non-existing hostname or an IP-adress
with [ and ] around it, perl will give the error-message
'Bad hostname'. Never put [ and ] around the IP-adress!
I (and the users of my script) would like more userfriendly
error-messages. I have looked at $! $@ $? $^E but they are a
bit strange, are there others I should check out? Will I
have to make my own error-messages?
Sorry about the confusion.
hal9000 wrote:
>
> I have a working script (perl 5.00503), using Net::FTP, that
> contains the line:
> $ftp = Net::FTP->new($host);
> This is OK if $host is a hostname, but if I set
> $host = '10.20.30.40';
> I get the error-message 'Unknown error'. I have tried:
> $host = '[10.20.30.40]';
> It will not work either. Error message 'Bad hostname'...
>
> How can I make the script connect to an IP-adress?
>
> TIA
> --
> ~hal9000
--
~hal9000
------------------------------
Date: Wed, 09 Jun 1999 12:39:50 GMT
From: monsri@my-deja.com
Subject: Newbie simple question regarding graphics/charts display on an HTML page
Message-Id: <7jlnak$iao$1@nnrp1.deja.com>
Hi here,
I'm a beginner in CGI, and I'd just like to know whether it's
easily possible to generate graphics, pie-charts and that
kind of stuff on an HTML page, thru the means of Perl or
JavaScript. I know nothing about Java, and I wonder if it's
possible to do it with Perl and/or JavaScript _ONLY_.
I'll have to run CGI-generated queries against a database,
and display the statistical results they'll return as charts.
Thanks for any help !!
Regards,
Seb
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 09 Jun 1999 12:46:36 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7jlnn9$ig3$1@nnrp1.deja.com>
In article <7jl9m9$ec9$1@nnrp1.deja.com>,
armchair@my-deja.com wrote:
> In article <7jjl5o$rkg$1@nnrp1.deja.com>,
> John Porter <jdporter@min.net> wrote:
> > I don't think there's *anything* you can do in only 4 lines
> > of assembly! :-)
>
> And yet your persist in calling C, merely "portable assembly".
Right, because it is. What takes one line of C may take 1, 4, or
100 lines of assembly; but the transformation is predictable,
comprehensible, and easy to automate. I'm not sure why you have
such a problem with this; this is what drove the whole design of
the C language.
> > The issue was not whether the languages are "equal", but really
> > whether they're Turing-equivalent; and they are, of course.
>
> No, the issue was whether they were equal, or equivalent.
Then the comparison must be "True", because the languages are
"equal or equivalent".
> I don't know what Turing-equivalent is,
Why does that not surprise me.
> but I believe you have finally admitted that
> assembly is not equal or equivalent to C.
Where have I admitted that? C is equivalent to asm, therefore
C is "equivalent or equal to" asm. If you don't understand that,
then you need to take a remedial logic course.
--
John Porter
Put it on a plate, son. You'll enjoy it more.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 9 Jun 1999 10:25:40 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Perl on win32
Message-Id: <7jlff4$bme$1@solti3.sdm.de>
In article <7jjtcv$v68$1@nnrp1.deja.com>, RoLm <rolm@my-deja.com> wrote:
> try the following:
> 1. Start->Settings->Control Panel->System
> 2. Click the Environment tab
> 3. in the Variable field, type PATHEXT
> 4. in the Value field, type .COM;.EXE;.BAT;.CMD;.plx
> 5. Click Set, then Apply, then OK
> 6. Enjoy!
This works great!
But is there another way, apart from a "$dummy = <STDIN>;" statement at
the end of the script, to avoid the automatic closing of the MSDOS window
after the script terminated (on Windows NT 4.0)?
Thanks for any hints!
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/
http://www.engelschall.com/u/sb/download/
http://www.perl.com/CPAN/authors/id/STBEY/
http://www.oreilly.de/catalog/perlmodger/bnp/
------------------------------
Date: Wed, 09 Jun 1999 13:50:27 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Problems sorting. I'm stupid and I'll die
Message-Id: <7jlrg7$bkg$1@news.mch.sbs.de>
In article <375e2d3a.4121716@news.demon.co.uk>, stuw@dial.pipex.com.remove.everything.after.com (Stuart Wright) wrote:
>I have some script which I copied from a resource somewhere and it doesn't
>work because the version of Perl on my host's server doesn't like the '->'
>syntax.
>I have an array @record which contains about 500 records, each made up of
>$manufacturer,$model,$rating,$date
>I need to do a case insensitive sort by $rating.
>I have read the Perl documentation and I simply don't understand it. I'm
>sorry - I'm stupid and I'll die.
>In the brief spell before I expire, could someone please give me the script
>to sort my array?
>like @records = (sort {uc($rating{a}) cmp uc($rating{b})} @records) type
>stuff. Nice and simple.
Assuming @records looks a bit like this :
@records = (
[ 'man1', 'mod2', 'rat3', '1999/06/10' ],
[ 'man2', 'mod3', 'rat4', '1999/06/09' ],
[ 'man3', 'mod4', 'rat5', '1999/06/08' ],
[ 'man4', 'mod5', 'rat1', '1999/06/07' ],
[ 'man5', 'mod1', 'rat2', '1999/06/06' ],
);
you could try :
@records = (sort {$$a[2] cmp $$b[2]} @records);
See, no '->' symbols :-)
The Schwartzian transform I showed you a few days ago may not
work on (very) old Perl versions, but this one should.
Have a look at perllol to see how to access and print the resulting
@records.
Michel.
------------------------------
Date: Wed, 9 Jun 1999 03:52:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: quotemeta
Message-Id: <cg6lj7.1j.ln@magna.metronet.com>
dalehend@flash.net wrote:
: I have quotemeta to put the backslash before a non-alphanumeric
: character. How about taking it out? Is there a function to take the
: backslash out?
s/\\(\W)/$1/g;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 09 Jun 1999 08:29:46 -0400
From: Tom Lynch <tlynch@cisco.com>
Subject: Re: Regular Expresion
Message-Id: <375E5E3A.D9620A8@cisco.com>
Greetings:
Thanks to everyone who posted! Here's what I
came up with last night but not as elegant as
some of the answers, but works:
$_ =~ s#/#\\/#g;
$_ =~ s#(.*)\\/(\w+$)#$1/$2#;
I take two passes through the line, Wish I read
the news group earlier, making changes now to
get it looking like some of the replys.
By the way is there a news group just for regular
expressions? I didn't find anything on Deja News
that would indicate that under the *.lang.* area
there is a news group for this kind of question.
Thanks Again!
Tom
Tom Lynch wrote:
>
> Greetings:
>
> I have the line:
>
> foo/foo_bar/foobar\[15\]/foo
>
> I need the line to look like:
>
> foo\/foo_bar\/foobar\[15\]/foo
>
> Note: the tailing /foo no longer contains
> a backslash. I've tried:
>
> $_ =~ s#(/).*/.*$#\\/#;
>
> Mistakenly thinking the ancore would take
> care of the match. Does anyone have a
> regular expression which would work here?
>
> Thanks for any help in advance.
>
> Tom
> --
> #-----------------------+--------------------------+
> # Tom Lynch | Email: tlynch@cisco.com |
> # Cisco Systems | Phone: 978-244-8765 |
> # 250 Apollo Drive | FAX: 978-244-8039 |
> # Chelmsford MA 01824 | MS: CH1-2LF |
> #-----------------------+--------------------------+
--
#-----------------------+--------------------------+
# Tom Lynch | Email: tlynch@cisco.com |
# Cisco Systems | Phone: 978-244-8765 |
# 250 Apollo Drive | FAX: 978-244-8039 |
# Chelmsford MA 01824 | MS: CH1-2LF |
#-----------------------+--------------------------+
------------------------------
Date: 09 Jun 1999 09:42:36 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Aaron Ginn <rp2885@email.sps.mot.com>
Subject: Re: Search a list for an element
Message-Id: <m31zflcwxf.fsf@joshua.panix.com>
Aaron Ginn <rp2885@email.sps.mot.com> writes:
> Is there a function which will parse a list for a specific value,
> similar to how 'exists' works for hashes?
This is a FAQ, perlfaq4, "How can I tell whether a list or array
contains a certain element?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 9 Jun 1999 12:48:16 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Will future releases of Perl be rewritten in C++?
Message-Id: <375e6290.0@news.new-era.net>
Dmitry P. (dpodbori@email.msn.com) wrote:
> A question to the Perl experts:
> -- now that C++ has become a mature language and C++ complilers are stable
> and available on all platforms, wouldn't a large scale project like Perl
> benefit from strong type system, automatic initialization and clean-up, STL
> containers, etc.?
Why rewrite Perl in C++ when you could rewrite the Perl interpreter
in Perl, and have it interpret itself? Eventually, no other
source would be needed.
Scott
------------------------------
Date: 9 Jun 1999 13:44:19 GMT
From: Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de>
Subject: Re: Writing a program to control the CD-ROM in U*IX?
Message-Id: <7jlr3j$fem$1@fu-berlin.de>
R.Joseph <streaking_pyro@my-deja.com> wrote:
: I know that Perl includes the standard ioctl(2) function, and I was
: wondering if anyone knew how I would go about using ioctl to
: control '/dev/cdrom' (the CD-ROM) device in Linux. All I really want
: to do is open and close and start the motor. Any help is appreciated.
: Thanks.
Perhaps you want to have a look at /usr/src/linux/include/linux/cdrom.h.
There's a part of this file labeled "CD-ROM IOCTL commands"; you might
be able to knock up something with ioctl and the definitions from that
file.
HTH,
Christoph
--
-- Christoph Schmitz <cschmitz(at)stud.informatik.uni-trier.de> --
What is the robbing of a bank compared to the founding of a bank?
-- Bertold Brecht
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5929
**************************************