[12953] in Perl-Users-Digest
Perl-Users Digest, Issue: 363 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 4 11:07:20 1999
Date: Wed, 4 Aug 1999 08:05:11 -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, 4 Aug 1999 Volume: 9 Number: 363
Today's topics:
Re: << Print Command Won't Work (Larry Rosler)
[OFFTOPIC} Trapping SIGKILL <sariq@texas.net>
Re: [OFFTOPIC} Trapping SIGKILL <gellyfish@gellyfish.com>
Chat with me (ChatTiAmo)
developing search engines <newsreply@mpguy.freeserve.co.uk>
Re: developing search engines <alex@kawo2.rwth-aachen.de>
Help with form input to ouput in another frame? hads6307@my-deja.com
Invalid cross link error message <gnielson@charlotte.infi.net>
Re: Invalid cross link error message (Malcolm Ray)
low memory (Steve Barrera)
manServer.pl (man page to html converter) <rolf@insect.demon.co.uk>
Re: mySql & Perl -> Something simple (Larry Rosler)
Re: Newbie Q: How to check if invoked as CGI program <gellyfish@gellyfish.com>
Re: Newbie Q: Removing files from a folder (Larry Rosler)
Please Help with regex <p.brouwer@prevalent.nl>
Re: Please Help with regex <alex@kawo2.rwth-aachen.de>
Re: Problem: extracting terminology from text (Abigail)
Question for Perl gurus <amigo21@pacific.net.sg>
Re: Read the FAQs: CGI/Perl question (Jim Hutchison)
Repetition in RE substitutions (Don Blaheta)
SELECT MULTI (Perl FORM data parsing) <elvis@fallenones.org>
Re: SELECT MULTI (Perl FORM data parsing) <alex@kawo2.rwth-aachen.de>
Re: thanks for nothing everybody (Abigail)
Re: thanks for nothing everybody <gellyfish@gellyfish.com>
Re: thanks for nothing everybody (brian d foy)
truncating decimals <paulm@dirigo.com>
Re: truncating decimals (Andreas Fehr)
Re: truncating decimals <Allan@due.net>
Re: Whitespace (Larry Rosler)
Re: Why is it.... (Abigail)
Re: Why is it.... (Andreas Fehr)
Re: Why is it.... <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 4 Aug 1999 07:52:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: << Print Command Won't Work
Message-Id: <MPG.1211f37e4f804758989db6@nntp.hpl.hp.com>
In article <MPG.1212a38291ed2ebc989bdb@news-server> on Wed, 4 Aug 1999
18:23:23 +1000, elephant <elephant@squirrelgroup.com> says...
> Larry Rosler writes ..
> >Look for the following under Quirks in the ActivePerl FAQ:
> >
> >Why do I get an error using Perl's here-doc syntax (<<), that says
> >"Can't find string terminator anywhere before EOF"?
>
> sure that question isn't in perlwin32faq8 (Programming) ? .. because it
> is in my documentation
Right. s/Quirks/Programming/;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 04 Aug 1999 09:31:36 -0500
From: Tom Briles <sariq@texas.net>
Subject: [OFFTOPIC} Trapping SIGKILL
Message-Id: <37A84EC8.840A7EF3@texas.net>
Jonathan Stowe wrote:
>
> Alternatively write your program in Informix 4GL on SCO unix ;-{ (If you
> dont believe me I'll post the 'script' output ).
>
I'd be interested in seeing that...what versions of SCO and Informix?
- Tom
------------------------------
Date: 4 Aug 1999 16:01:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: [OFFTOPIC} Trapping SIGKILL
Message-Id: <37a855d1_2@newsread3.dircon.co.uk>
Tom Briles <sariq@texas.net> wrote:
> Jonathan Stowe wrote:
>>
>> Alternatively write your program in Informix 4GL on SCO unix ;-{ (If you
>> dont believe me I'll post the 'script' output ).
>>
>
> I'd be interested in seeing that...what versions of SCO and Informix?
>
Bah. You just missed such an episode. Anyhow:
tom.dircon.net# uname -X
System = SCO_SV
Node = tom
Release = 3.2v5.0.2
KernelID = 96/01/23
Machine = Pentium
BusType = ISA
Serial = 4DF011417
Users = 67-user
OEM# = 0
Origin# = 1
NumCPU = 1
sys0001 [figment] $ c4gl -V
INFORMIX-4GL Version 4.00.UH2
Software Serial Number LEX#F192187
/J\
--
"It's times like this I wish I had a penis" - Duckman
------------------------------
Date: 4 Aug 1999 14:22:12 GMT
From: staff@chattiamo.com (ChatTiAmo)
Subject: Chat with me
Message-Id: <8E18A4E96ChatTiAmo@news.iunet.it>
If you like the chat world then you must try ChatTiAmo.
It's a simply program, it's FREEWARE!
It's anonymous, never show your email address and/or your IP address.
But at the same time you can contact people on/offline, chat, sending mail
or transfer files.
Go to http://www.chattiamo.com and download the software.
If you don't have the time to download the software than try immediately
the Chat OnLine with your
browser.
Go to http://151.4.99.20:8000/
Translate this message in your language and forward it to your friends to
create a new community
on the Net!
I'm waiting you.
------------------------------
Date: Wed, 4 Aug 1999 15:34:55 +0100
From: "llew" <newsreply@mpguy.freeserve.co.uk>
Subject: developing search engines
Message-Id: <37a84f2b@news.intensive.net>
Hi, I am quite new to perl but I have a background in C++/Java programming,
I have a question.
I want to be able to scan all HTML documents in a specific folder for
keywords, then produce a results page with links to desired pages, I have
written some CGI scripts that scan through a specific text file, but not one
that can scan through all files in a given directory.
Can anyone point me in the right direction on how to go about this task?
many thanks
Matthew
------------------------------
Date: Wed, 04 Aug 1999 16:42:40 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: llew <newsreply@mpguy.freeserve.co.uk>
Subject: Re: developing search engines
Message-Id: <37A85160.667C1C53@kawo2.rwth-aachen.de>
Hi Matthew,
llew wrote:
> I want to be able to scan all HTML documents in a specific folder for
> keywords, then produce a results page with links to desired pages, I have
> written some CGI scripts that scan through a specific text file, but not one
> that can scan through all files in a given directory.
please run "perldoc -tf readdir" and check out
an article about File::Find at the Perlmonth magazine:
http://www.perlmonth.com/columns/modules/modules.html?issue=2&id=933777875
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: Wed, 04 Aug 1999 14:52:31 GMT
From: hads6307@my-deja.com
Subject: Help with form input to ouput in another frame?
Message-Id: <7o9k39$fgb$1@nnrp1.deja.com>
Can somebody help me with this problem? I need to take input from a
single textbox in a form and output the data into another frame. Can
somebody help with the framework below.
Mike
#!/usr/bin/perl
# load CGI library
use CGI qw(:standard);
#Create header
#Capture form input and save into scalar variable
if ( $method eq 'POST' )
{
print "HI THERE";
read(STDIN, $_, $ENV{'CONTENT_LENGTH'});
}
# set condition so that if input is not equal to "" print "You are
thinking <input>"
#else print out ""
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 04 Aug 1999 09:12:45 -0400
From: Gary Nielson <gnielson@charlotte.infi.net>
Subject: Invalid cross link error message
Message-Id: <37A83C4C.8ACD77A5@charlotte.infi.net>
Trying to figure out a problem with a perl script I am writing.
Basically, it seems to work fine when I run it from the command line but
when run as a cron job I get the error message:
Invalid cross-device link at line 109.
Here is the subroutine where the problem is:
sub testquestion
{
if (-z $TheOneJustDownloaded) {
## the file test operator -z returns true if file has zero size.
&upload;
open(LOGFILE, ">>$Logfile") or die "Cannot open $Logfile.";
print LOGFILE "Replaced zero byte file $curr_time\n";
close (LOGFILE);
}
else
{
system(`/bin/rm $LastGoodOneStored`);
use File::Copy;
move($TheOneJustDownloaded, $LastGoodOneStored) || warn $!;
open(LOGFILE, ">>$Logfile") or die "Cannot open $Logfile.";
print LOGFILE "No need to replace file $curr_time\n";
close (LOGFILE);
Line 109 producing the error is the move($TheOneJustDownloaded,
$LastGoodOneStored) line.
I can't understand why this would work from the command line but not as
a cron job run by the same user. Using version 5.004_01
on a Linux box.
Any help appreciated. Please email reply as well.
Gary
Charlotte NC
------------------------------
Date: 4 Aug 1999 14:40:38 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Invalid cross link error message
Message-Id: <slrn7qgk76.3t8.M.Ray@carlova.ulcc.ac.uk>
On Wed, 04 Aug 1999 09:12:45 -0400, Gary Nielson <gnielson@charlotte.infi.net>
wrote:
>Trying to figure out a problem with a perl script I am writing.
>Basically, it seems to work fine when I run it from the command line but
>when run as a cron job I get the error message:
>
>Invalid cross-device link at line 109.
That means that the source and destination files of the move are on
different filesystems. Add some debugging code to display
$TheOneJustDownloaded and $LastGoodOneStored immediately before the
move, and probably all will become clear.
I have to comment on this line:
> system(`/bin/rm $LastGoodOneStored`);
You really need to read up on the use of system and backticks:
perldoc -f system
perldoc perlop
The line above does not mean what I think you think it means. In any case,
it would be better to do:
unlink($LastGoodOneStored)
or warn "Error removing $LastGoodOneStored: $!";
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: Wed, 4 Aug 1999 13:36:20 GMT
From: stbarr.wnt.sas.com (Steve Barrera)
Subject: low memory
Message-Id: <37a840fe.405600692@newshost.unx.sas.com>
I am using ActivePerl 5 on Win NT and trying to force a low memory
situation for a test.
I can't seem to find any help on setting the heap/stack using
ActivePerl, or find any memory utilities...
I know PerlMongers aren't supposed to care about memory, but what
happens when you suddenly do?
Steve Barrera
stbarr@wnt.sas.com
------------------------------
Date: Wed, 04 Aug 1999 15:13:37 +0100
From: Rolf Howarth <rolf@insect.demon.co.uk>
Subject: manServer.pl (man page to html converter)
Message-Id: <37A84A91.948868BB@insect.demon.co.uk>
A new version of manServer, a Perl CGI script to convert Unix manual
pages to HTML on the fly, is available at
http://www.squarebox.co.uk/download/
Other convertors depend on nroff and just stick <PRE> tags around the
output, but this produces very ugly results. Instead, manServer
implements a basic troff-to-HTML interpreter, including support for
tables and equations (though features are rather limited by what it's
possible to render in HTML). The manServer documentation page itself
demonstrates the type of output that is generated.
-Rolf
------------------------------
Date: Wed, 4 Aug 1999 07:30:47 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: mySql & Perl -> Something simple
Message-Id: <MPG.1211ee7610bd9f74989db5@nntp.hpl.hp.com>
In article <37a7df64.114952317@news.tor.metronet.ca> on Wed, 04 Aug 1999
08:34:15 GMT, Steve MacLellan <maclell@col.ca> says...
> On Tue, 3 Aug 1999 18:27:23 -0700, lr@hpl.hp.com (Larry Rosler) wrote:
>
> >This is off-topic, but the </TD>, </TH>, and </TR> tags are all
> >optional. So the </TD> there is just HTML noise.
>
> Yes, optional if you only want it to dsiplay in MSIE. If you want it
> to display in Netscape you have to close Table elements.
Getting further off-topic, so I'll keep it brief.
NO!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 4 Aug 1999 15:43:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie Q: How to check if invoked as CGI program
Message-Id: <37a851a4_2@newsread3.dircon.co.uk>
Steve van der Burg <steve.vanderburg@lhsc.on.ca> wrote:
> rhrh@hotmail.com (Richard H) wrote in
> <37A54D97.39A1EDAF@hotmail.com>:
>
>>Andrew Fry wrote:
>>>
>>> In article <7nqsf2$oo06@news.cyber.net.pk>, Faisal Nasim
>>> <swiftkid@bigfoot.com> writes
>>> >: The question is ... is there a foolproof way of being able to
>>> >: detect how the program was invoked ? ... and thus determine the
>>> >: appropriate mode to adopt.
>>> >
>>> >Check out the contents of %ENV in both cases.
>>>
>>> And what would I expect to find ?
>>>
> [ snip ]
>>
>>youd expect to find HTTP_REFERRER variable and others relating to
>>http that would give you an idea of how it was called.
>>
>>Richard H
>
> Actually, checking HTTP_REFERER isn't such a great idea, since it's
> set by the web browser.
Not precisely:
In addition to these, the header lines received from the client, if
any, are placed into the environment with the prefix HTTP_ followed by
the header name. Any - characters in the header name are changed to _
characters. The server may exclude any headers which it has already
processed, such as Authorization, Content-type, and Content-length. If
necessary, the server may choose to exclude any or all of these headers
if including them would exceed any system environment limits.
/J\
--
"They're called Virgin Trains because they don't go all the way" -
Simon Hoggart, The Guardian
------------------------------
Date: Wed, 4 Aug 1999 07:21:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie Q: Removing files from a folder
Message-Id: <MPG.1211ec36109ffd83989db4@nntp.hpl.hp.com>
In article <x4ezLDAic+p3EwJB@beausys.freeserve.co.uk> on Wed, 4 Aug 1999
08:09:22 +0100, Andrew Fry <andrewf@beausys.freeserve.co.uk> says...
...
> According to Win95 Windows Help,...
> "Folders -
> Your documents and programs are stored in folders, which you can see in
> My Computer and Windows Explorer. In previous versions of Windows,
> folders were called directories."
I think the 'folders' notion was stolen by Micro$oft, along with so much
else, from the Apple office-desktop metaphor -- 'folder' == 'file
folder'. That in turn may have been stolen by Apple from Xerox PARC,
whose work is lost in obscurity (and failed lawsuits) by now.
Folders may contain other folders, and may themselves reside in 'file
cabinets', which must be the origin of their .cab files for archives.
Whatever 'works', I guess -- and it certainly has worked for Micro$oft.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 4 Aug 1999 16:07:18 +0200
From: "Pieter Brouwer" <p.brouwer@prevalent.nl>
To: comp.lang.perl.misc
Subject: Please Help with regex
Message-Id: <PRVL304011EEFC@prevalent.nl>
L.S.
I'm trying to strip a piece of text out of a string. The text that need to
be stripped from the string should start with "/*" and ends with "*/". This
can be nested and spanning multiple lines.
So I want to say something like:
Find "/*" plus anything after that, that doesn't have "/*" up and until you
find "*/".
(do I make sense, my English isn't what I would like it to be)
I tried something like this:
# $bestand is filled with the contents of a file
while ( $bestand =~ s {/\*([^(/\*)]*)\*/} {$1}sm ) {
...
}
But this obviously doesn't take care of all cases since it trips over "*"
inbetween the "/*" and "*/". It comes rather close to what I want though.
In the while-block I try to keep the new-line-characters in the original
string so I can do a correct line-count lateron.
Is it at all possible or should I write some code that walks through the
string one character at a time (looks like a very un-pearlish thing to do)?
Can anybody out there lend me a helping hand?
TIA
--
-Pieter-
"Baldrick, you wouldn't know a subtle plan if it painted itself purple
and danced naked on a harpsichord singing 'Subtle Plans are Here
Again'."
--- Blackadder Christmas Special
P.J. Brouwer [mailto:p.brouwer@prevalent.nl]
Systems Developer
PreValent Informatiesystemen
Doesburgweg 7
NL-2803 PL Gouda
Tel: +31 (0)182 69 18 88
Fax: +31 (0)182 53 63 04
http:\\www.prevalent.nl
------------------------------
Date: Wed, 04 Aug 1999 16:34:52 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: Pieter Brouwer <p.brouwer@prevalent.nl>
Subject: Re: Please Help with regex
Message-Id: <37A84F8C.BF006978@kawo2.rwth-aachen.de>
Hi Pieter,
Pieter Brouwer wrote:
> I'm trying to strip a piece of text out of a string. The text that need to
> be stripped from the string should start with "/*" and ends with "*/". This
> can be nested and spanning multiple lines.
have you also considered quotes? Like:
char array[] = "/*"; /* comment */
Maybe you should use Text::ParseWords Perl module then...
> while ( $bestand =~ s {/\*([^(/\*)]*)\*/} {$1}sm ) {
[^(/\*)] is probably not what you think. It is a negative character
class: not a (, ), /, \ (should be escaped) and * (no need to escape).
My quick suggestion would be:
while ( $bestand =~ s { /\* ( (?: (?! \*/). )* ) \*/ } {$1}smx
or:
while ( $bestand =~ s { /\* ( .*? ) \*/ } {$1}smx
please read "perldoc perlre" on look-ahead and non-greedy
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: 4 Aug 1999 09:15:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Problem: extracting terminology from text
Message-Id: <slrn7qgim2.t9b.abigail@alexandra.delanet.com>
Denis Pleic (dpleic@close.open.hr) wrote on MMCLXIV September MCMXCIII in
<URL:news:37A81136.557F3C2@close.open.hr>:
~~
~~ I know such a thing can be done with Perl, but I was wondering
~~ about speed issue. For example, if the standard "dictionary" has
~~ about 10,000 words, comparing a new text of about 20,000 words
~~ against it would take quite some time, right?
~~
~~ So, if the text to filter has 20,000 words, and the dictionary has
~~ 10,000 words, that would mean 20,000 individual comparison
~~ operations against a 10,000 word list... Quite time-consuming, right?
Only if you have stupid code. Any person calling him/herself a programmer
would preprocess that 10,000 word list. One could use a tree, a sorted
array, or, in the case of Perl, a hash.
One can make any program as slow as you want it to be, but you don't
have to!
~~ I'd also like to hear any ideas regarding how to set about doing
~~ this (the original text should be split into lexical units - words,
~~ for comparing them with the dictionary)...
Use split or //g, depending on your definition of a word.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 4 Aug 1999 22:14:02 +0800
From: "Mr Amigo21" <amigo21@pacific.net.sg>
Subject: Question for Perl gurus
Message-Id: <7o9i2q$5qi$1@nobel2.pacific.net.sg>
Dear Gurus,
I'm new to the language perl and have tried writing a few CGI
scripts in perl but I would like to know how we can open an external program
via the Perl-CGI script to run on the server?
Thanks.
newbie
------------------------------
Date: Wed, 04 Aug 1999 14:16:26 GMT
From: jimhutchison@metronet.ca (Jim Hutchison)
Subject: Re: Read the FAQs: CGI/Perl question
Message-Id: <37a84a0f.669829033@news1.cal.metronet.ca>
On Wed, 04 Aug 1999 00:19:38 GMT, mgjv@comdyn.com.au (Martien
Verbruggen) wrote:
>In article <37a772e1.614743824@news1.cal.metronet.ca>,
> jimhutchison@metronet.ca (Jim Hutchison) writes:
>> I've a perl script that grabs data from a very large file, and parses
>> it for GD graphing as well as text presentation. The beginning of the
>> script has some text telling the user to wait till the report is
>> generated, however nothing displays till the entire script is
>> finished.
>
>buffering.. Look up the variable $| in the perlvar documentation.
That DID it! Thanks for your help.
I bought a great Perl book which explains why it acts this way. I now
understand that in an effort to optimize i/o, perl waits till all
output is buffered, then sends it to output. They recommend using the
$| variable in cgi scripts.
>
>> My korn shell version of this job is much slower, but it DOES
>> initially display the comfort message right away, then continues to
>> execute the other instructions.
>
>scripts buffer differently.
>
>> Any ideas? I'm running this on Apache.
>
>Ah. Is this a CGI script? Even though your subject mentiones CGI, you
>should really say so in the body of your message.
Will do next time...
------------------------------
Date: 4 Aug 1999 15:00:06 GMT
From: dpb@cs.brown.edu (Don Blaheta)
Subject: Repetition in RE substitutions
Message-Id: <7o9khm$9ku@cocoa.brown.edu>
I've run into something of a difficulty with s///g matches: how exactly
do I replace things that are repetitions (*, +, or {m,n}) in the
pattern?
Here's an example. Say I have a lot of text, in which occur serial
numbers of the form \d+(-\d+)* . I need to go through and remove the
hyphens from these numbers, without removing the hyphens from the rest
of the text. Conceptually, what I want is something like
s/(\d+)(?:-(\d+))*/$1($2)*/g
but of course that won't work. My first thought was to do something
along the lines of
while (m/\d+(-\d+)*/g) {
$& =~ s/-//g;
}
but $& is read-only. Now I'm working on coming up with something like
s/(\d+(-\d+)*)/ $1=~s{\-}{}g /eg
but nothing quite seems to work (and it's messy, too).
It seems like this should be a common situation, but I couldn't find
anything about it in the FAQ. Any ideas?
--
-=-Don Blaheta-=-=-blahedo@brown.edu-=-=-<http://www.cs.brown.edu/~dpb/>-=-
"To vacillate or not to vacillate, that is the question ... or is it?"
------------------------------
Date: Wed, 4 Aug 1999 09:50:29 -0400
From: "Elvis" <elvis@fallenones.org>
Subject: SELECT MULTI (Perl FORM data parsing)
Message-Id: <FyXp3.32$nI1.3367@iad-read.news.verio.net>
If I create an HTML file that passes form data...from a multi select form
<select name=user size=5 multiple>
<option>User1
<option>User2
etc
If I read in the data via Perl:
my @name = param ;
my @value ;
my $max = @name ;
for (0..--$max) {
$value[$_] = param($name[$_]);
}
If I select more than one of those options I only get one value, instead of
all.
I assume due to the fact that the <SELECT has only one name, that would
explain that.
So I tried
<SELECT SIZE=5 MULTIPLE>
<option name=User1>User1
<option name=User2>User2
etc
but then no data came out.
I must be readnig in the form data incorrectly but cannot find an example on
how to do this correctly.
Any pointing in the right direction would be appreciated.
Thanks.
Bill
------------------------------
Date: Wed, 04 Aug 1999 16:20:12 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: Elvis <elvis@fallenones.org>
Subject: Re: SELECT MULTI (Perl FORM data parsing)
Message-Id: <37A84C1C.CFC1F1E6@kawo2.rwth-aachen.de>
Hi Bill,
Elvis wrote:
> <select name=user size=5 multiple>
> <option>User1
> <option>User2
> etc
>
> If I read in the data via Perl:
> my @name = param ;
shouldn't it be
my @name = param ('user'); # read "perldoc CGI"
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: 4 Aug 1999 09:07:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: thanks for nothing everybody
Message-Id: <slrn7qgi8i.t9b.abigail@alexandra.delanet.com>
Diane (tech1@magicnet.net) wrote on MMCLXIV September MCMXCIII in
<URL:news:rqgap5i4132ncq6@corp.supernews.com>:
'' Gee thanks for your help NOT!!
''
'' All I wanted was a brief interpretation of some of the lines of code that
'' were NOT related to HTML, and all you people could come up with are
'' critiques of the code. I did not want or need that. Its NOT a cgi class,
'' just touches on it and I just wanted to explain some of the code, but
'' apparantly none of you are capable of doing that. I must say this is my
'' first time being treated so badly and getting such useless info from a
'' newsgroup. Most groups are most helpful and willing to share knowledge..
'' guess you folks are not. Sorry I wasted my time and hoped for some help
Then go elsewhere. I believe the people in comp.lang.tcl will be
thrilled to meet someone whose going to teach bad tcl to people.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Aug 1999 15:18:08 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: thanks for nothing everybody
Message-Id: <37a84ba0_2@newsread3.dircon.co.uk>
Diane <tech1@magicnet.net> wrote:
> Gee thanks for your help NOT!!
>
> All I wanted was a brief interpretation of some of the lines of code that
> were NOT related to HTML, and all you people could come up with are
> critiques of the code. I did not want or need that.
But you *did* need that. You might think that but the code that you showed
us is not the code that we would have you teach to people who might not
know any better.
> Its NOT a cgi class,
> just touches on it and I just wanted to explain some of the code, but
> apparantly none of you are capable of doing that.
But if you dont know what it is doing why the hell are you even trying to
explain it to someone else - in the first instance you didnt know enough
to know that the code you had was not fit to be shown to students. Fine.
> I must say this is my
> first time being treated so badly and getting such useless info from a
> newsgroup.
But you have got useful info - you have been shown the flaws in the program
that made it unfit to be shown to students and present with examples which
are far more in keeping with the current state of the Perl art - examples
which did exactly what your original code was supposed to but 'properly'
by the standards of most professional programmers that use Perl. And please
dont come back and say that you are not teaching programming so all this is
not important - if you are not teaching programming then you should not
be showing people this stuff.
If you must have *your* code explained perhaps you ought to ask the
person who wrote it ?
If you need to know more about CGI you might start by looking at the
'home of CGI' <http://hoohoo.ncsa.uiuc.edu/cgi>
> Most groups are most helpful and willing to share knowledge..
> guess you folks are not. Sorry I wasted my time and hoped for some help
>
What is going on with all you people this week ?
/J\
--
"If I was going to wear a wig I'd choose something a lot better than this"
- Barry Norman
------------------------------
Date: Wed, 04 Aug 1999 10:31:20 -0400
From: brian@pm.org (brian d foy)
Subject: Re: thanks for nothing everybody
Message-Id: <brian-0408991032050001@rtp-cr45-dhcp-147.cisco.com>
In article <37a84ba0_2@newsread3.dircon.co.uk>, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:
>Diane <tech1@magicnet.net> wrote:
>> Gee thanks for your help NOT!!
>>
>> All I wanted was a brief interpretation of some of the lines of code that
>> were NOT related to HTML, and all you people could come up with are
>> critiques of the code. I did not want or need that.
>
>But you *did* need that. You might think that but the code that you showed
>us is not the code that we would have you teach to people who might not
>know any better.
good programmers know to make the small scripts to test the parts that
they don't understand or want to learn. if you include more than that,
expect other programmers to comment on them.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Wed, 04 Aug 1999 14:12:13 GMT
From: Stone Cold <paulm@dirigo.com>
Subject: truncating decimals
Message-Id: <7o9hnj$dnk$1@nnrp1.deja.com>
I have a perl script that's outputting dollar figures to the web. The
script contains equations calculations. The problems I'm encountering
is that the calculated dollar figures are coming out as follows:
$4514.76578492
This is probably because my equations are generating these numbers
(division and sum equations).
The data is being pulled from an Access database. Is there any way,
via perl, to only include 2 decimal places in the output?
--
Paul R. Mesker
System Engineer
Dirigo Inc.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 04 Aug 1999 14:31:37 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: truncating decimals
Message-Id: <37a84e95.33000872@news.uniplus.ch>
On Wed, 04 Aug 1999 14:12:13 GMT, Stone Cold <paulm@dirigo.com> wrote:
>I have a perl script that's outputting dollar figures to the web. The
>script contains equations calculations. The problems I'm encountering
>is that the calculated dollar figures are coming out as follows:
>
> $4514.76578492
>
>This is probably because my equations are generating these numbers
>(division and sum equations).
Yes, could be.
>The data is being pulled from an Access database. Is there any way,
>via perl, to only include 2 decimal places in the output?
perldoc -q decimal
Andreas
------------------------------
Date: Wed, 4 Aug 1999 10:36:56 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: truncating decimals
Message-Id: <7o9jfa$e5k$1@nntp9.atl.mindspring.net>
Stone Cold wrote in message <7o9hnj$dnk$1@nnrp1.deja.com>...
[snip]
:The data is being pulled from an Access database. Is there any way,
:via perl, to only include 2 decimal places in the output?
Please see Perlfaq4:
Why am I getting long decimals (eg, 19.9499999999999) instead of the
numbers I should be getting (eg, 19.95)?
which concludes with: "To get rid of the superfluous digits, just use a
format (eg, printf("%.2f", 19.95)) to get the required precision. See
perlop. "
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
Empiricism is dead, it seems...
- Sean McAfee (responding in cplm to a classic what would happen if...
question)
------------------------------
Date: Wed, 4 Aug 1999 07:09:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Whitespace
Message-Id: <MPG.1211e97d82664760989db3@nntp.hpl.hp.com>
In article <7o8k0c$74b$1@ocean.cup.hp.com> on Wed, 4 Aug 1999 15:36:47
+1000, Ron Savage <ron_savage@non-hp-australia-om5.om.hp.com> says...
> Count the whitespace characters. 0 is good. > 0 is bad. Tested code:
>
> #!perl -w
>
> use integer;
Unnecessary -- no arithmetic done here.
> use strict;
>
> my($string) = "A\t\n \r\fZ";
> my($count) = $string =~ tr/ \f\n\r\t/ \f\n\r\t/;
That is a cool approach, which would be much faster than a regex in
situations where that mattered.
Just for the record, you don't need to repeat the characters on the
right-hand side if all you're doing is counting them. That is obviously
less error-prone, and improves your golf score.
my $count = $string =~ tr/ \f\n\r\t//;
You could try to improve it more by using '\s' instead of enumerating
the characters. Unfortunately, that doesnt work -- yet???
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 4 Aug 1999 09:19:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why is it....
Message-Id: <slrn7qgito.t9b.abigail@alexandra.delanet.com>
Chris Goodwin (archer7@mindspring.com) wrote on MMCLXIV September
MCMXCIII in <URL:news:37A84008.E00E9A72@mindspring.com>:
\\ why is it that I, who have only been hacking Perl for ~3 days, can read
\\ through the documentation and the previous newsgroup postings (7000+ of them
\\ on my server) and write up a 122-line program that does what I want it to do
\\ (which is turn my text into my HTML -- not *entirely* finished yet, but the
\\ rest is details -- I've gotten over my hurdles), all *without* having to ask
\\ anyone for help, while other people around here, who apparently have been
\\ hacking Perl for longer than I, have to come in and ask the same questions
\\ over and over?
Hmmm, could it be your brand of coffee? Your airnikes? The weekly visits
to KFC? Dark chocolate? Your cat?
Abigail
--
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 04 Aug 1999 14:21:15 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: Why is it....
Message-Id: <37a84b82.32214251@news.uniplus.ch>
On Wed, 04 Aug 1999 09:28:40 -0400, Chris Goodwin
<archer7@mindspring.com> wrote:
>(which is turn my text into my HTML -- not *entirely* finished yet, but the
Turning plain ascii into HTML is easy, the hard stuff is: reading the
documentation, deleting files, reading the documentation, balancing
{}, open files, reading the documentation, die, read STDIN, write to
STDOUT, reading the documentation, etc... :)
But boy, 122 lines, I bet you get a lot of replies with about 10
lines.
Andreas
------------------------------
Date: 4 Aug 1999 15:27:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Why is it....
Message-Id: <37a84dd4_2@newsread3.dircon.co.uk>
Chris Goodwin <archer7@mindspring.com> wrote:
> why is it that I, who have only been hacking Perl for ~3 days, can read
> through the documentation and the previous newsgroup postings (7000+ of them
> on my server) and write up a 122-line program that does what I want it to do
> (which is turn my text into my HTML -- not *entirely* finished yet, but the
> rest is details -- I've gotten over my hurdles), all *without* having to ask
> anyone for help, while other people around here, who apparently have been
> hacking Perl for longer than I, have to come in and ask the same questions
> over and over?
>
Because you are the sort of person who sees it more noble to read the
documentation and the other available resources than to ask for help which
you could have provided yourself.
/J\
--
"Nourishes at the root and penetrates right to the tip" - Pantene
Advertisement
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.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 V9 Issue 363
*************************************