[16664] in Perl-Users-Digest
Perl-Users Digest, Issue: 4076 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 21 06:05:45 2000
Date: Mon, 21 Aug 2000 03:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <966852316-v9-i4076@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 21 Aug 2000 Volume: 9 Number: 4076
Today's topics:
Re: cant tell is /DBD/mysql.pm is loaded correctly ?? (Colin Keith)
Re: checking a log file for updates <gellyfish@gellyfish.com>
Re: Compiling code at run-time, not compile-time (Colin Keith)
Re: cross platform newline processing <iltzu@sci.invalid>
Re: Download a file <gellyfish@gellyfish.com>
Re: driver <dale@emmons.dontspamme.com>
Re: driver <elephant@squirrelgroup.com>
finding out which program enters your script <king@sjako.demon.nl>
Re: Following Hyperlinks with cgi (Slightly Off Topic) <nickco3@yahoo.co.uk>
Re: Following Hyperlinks with cgi <gellyfish@gellyfish.com>
Re: Forking sub{}'s and selective SIG{CHLD} responses (Gwyn Judd)
Re: Forking sub{}'s and selective SIG{CHLD} responses (Martien Verbruggen)
gethostbyaddr zideon@my-deja.com
Help: Excel Automation question! ajeet@my-deja.com
Re: HELP: TEXTAREA field and newlines (David Efflandt)
Re: HELP: TEXTAREA field and newlines <webmaster@ostas.lu.se>
Re: hey, i need help, im trying to get what email = fro <gellyfish@gellyfish.com>
Re: HOWTO......(without LWP) (David Efflandt)
IE is OK but NC4 is wrong <laoxiu100@hotmail.com>
Re: IE is OK but NC4 is wrong (Robert Hallgren)
Re: join on two arrays <pilsl@goldfisch.atat.at>
Re: Modifying a text file <lincolnmarr@nospam.europem01.nt.com>
MySQL in Perl/CGI question <johnt@sparc.nic.bc.ca>
Re: MySQL in Perl/CGI question ajeet@my-deja.com
Re: MySQL in Perl/CGI question <elephant@squirrelgroup.com>
Re: Ordered set of permutations algorithm <iltzu@sci.invalid>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 21 Aug 2000 07:07:10 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: cant tell is /DBD/mysql.pm is loaded correctly ??
Message-Id: <yy4o5.165$DT4.4339066@nnrp2.clara.net>
In article <8nnl2c$d57$1@nnrp1.deja.com>, wrong planet ? <yamar420@my-deja.com> wrote:
>Does anyone know of a way to tell if you have the msql.pm installed
>correctly ? thx for any help.. yamar
make test
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 21 Aug 2000 07:53:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: checking a log file for updates
Message-Id: <8nqjlt$m1j$1@orpheus.gellyfish.com>
On Fri, 18 Aug 2000 06:22:52 -0400 Dr. Teeth wrote:
> I have the contents of a log file nicely stored in the order I want in
> an array.
>
> I want to check once every second to see if the contents of the log file
>
> have changed. If the contents are changed, I want to store the new
> lines in a new array.
>
> I thought maybe I could just store the log file into a temporary array
> every second and compare it with the first (original) array (that gets
> loaded from the log file on startup). Even if I knew how to do that, it
>
> seems like too much overhead. I've learned that there is usually an
> easier way when working in Perl.
>
> I basically am parsing '/var/log/messages' and looking for new kernel
> messages. I want to display them as they appear. Any help is greatly
> appreciated.
>
>
An alternative would be to have syslog write the kernel messages to a
FIFO and then have your program read from the same. Somewhere in the
dim recesses of my mind I seem to recall that there may be a version of
syslog that allows you to specify a program to be run and passed the
log message on STDIN rather than a file.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Mon, 21 Aug 2000 08:15:50 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Compiling code at run-time, not compile-time
Message-Id: <Wy5o5.166$DT4.4341501@nnrp2.clara.net>
In article <399FC57A.393AC51B@patriot.net>, H C <carvdawg@patriot.net> wrote:
>if ([some condition]) {
> # compile code as with 'use' statement
> # then run it normally
>}
>
>Your time and effort is greatly appreciated!
Uh huh, but in order to save my time and effort someone's done it all for me
:) Have a look at "perldoc -q require" and the relevant sections in
"perlfunc" for do, require and use.
Hope it points you in the right direction.
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 21 Aug 2000 07:22:55 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: cross platform newline processing
Message-Id: <966840069.3155@itz.pp.sci.fi>
In article <slrn8pvr0d.tj3.abigail@alexandra.foad.org>, Abigail wrote:
>Ilmari Karonen (iltzu@sci.invalid) wrote on MMDXLVI September MCMXCIII in
><URL:news:966771369.11780@itz.pp.sci.fi>:
>// In article <399B10D1.C8B1EFB5@yahoo.com>, Mark Johnson wrote:
>// > I need to read text files line by line. Problem is these text files
>// >may have been created on Mac, PC or unix. As a consequence I don't know
>// >whether the newline code is CR or LF or CR LF.
>//
>// $input =~ s/\cM\cJ?/\cJ/g;
>
>That assumes that a platform using CR LF never has a lone CR or lone LF in
>their lines. It also assumes that a platform using CR never has a LF, and
>a platform using a LF never has a CR. That's not appropriate - you wouldn't
>assume such platforms don't use the letter `a' either, would you?
You are correct. More specifically, what I am assuming is that these
"text files" match a certain narrow but commonly used definition of
plain text as lines of printable characters separated by line breaks.
Furthermore I am (or actually the original poster is) assuming that
the only possible line breaks are CR, LF and CR LF.
>Basically what you are doing is making a fourth platform, where both CR
>*and* LF terminate lines, (but a CR LF combo terminates one). It's a
>platform not compatible with either Unix, Windows or MacOS.
It is, however, compatible with all of those _given the assumption_
that the input is plain text as defined above. It is also capable of
handling files created with any combination of said three line break
conventions, with the obvious exception of the pathological case where
an empty LF-terminated line immediately follows a CR-terminated one.
>Determining on which platform a text file was created is hard, and it's
>impossible to do it always correctly. Posting solutions to problems which
>make assumptions without stating those assumptions is bad.
One could argue that all the necessary assumptions were stated by the
original poster in the first paragraph I quoted above, although there
is an ambiguity present in the definition of "text file".
I did, in my last paragraph, which you did not quote, refer to other
posts in the thread, in which these issues had already been discussed
quite thoroughly. In retrospect it would nonetheless have been better
to make the existence of those assumptions more obvious, for example
by s/a solution/$& (which may or may not be the one you want)/.
And I also apologise for forgetting binmode, which is a really stupid
mistake in code that otherwise tries to be as platform independent as
possible. Honestly, I'd been thinking about it when starting to write
the followup, but then just forgot to put it in. *smacks forehead*
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 20 Aug 2000 10:01:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Download a file
Message-Id: <8no6pt$j4g$1@orpheus.gellyfish.com>
On Sat, 19 Aug 2000 14:10:10 GMT Ken Loomis wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>
>>On Fri, 18 Aug 2000 20:12:03 GMT Ken Loomis wrote:
>>> Hello:
>>>
>>> What is the perl command to download a file from within a cgi
>>> response?
>>>
>>
>>print
>>
>
> hmm, I think I need more info than that. a simple:
>
> print "http://blah.blah.zip"
>
> didn't work.
>
> Is there more to know?
>
You either print the appropriate header to initiate a redirect to the
desired file or you print the appropriate content-type header and
then the content of the file (probably binmoded).
If you want more information on what these appropriate headers might be
you will almost certainly want to ask in the group
comp.infosystems.www.authoring.cgi as 'print' is the only Perl specific
part of this.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 20 Aug 2000 23:41:06 -0500
From: "Dale Emmons" <dale@emmons.dontspamme.com>
Subject: Re: driver
Message-Id: <sq1cdeim87v158@corp.supernews.com>
I'd suggest you buy 'Programming the Perl DBI', published by O'Reilly.
-Dale
"Troy Rasiah" <troyr@vicnet.net.au> wrote in message
news:O11o5.3628$Vb.95602@ozemail.com.au...
> Microsoft SQL Server even
>
> --
> --------------------------------------------------------------------------
--
> ----------------
> Troy Rasiah
> Database/Web Developer
> Vicnet
> troyr@vicnet.net.au
> --------------------------------------------------------------------------
--
> ----------------
> "Troy Rasiah" <troyr@vicnet.net.au> wrote in message news:...
> > does anyone know how i would connect a perl script to MSQL Database
> >
> > Is it using DBD::mSQL or DBD::ODBC
> >
> > where can i download these drivers from....
> >
> > if they are the ones?
> >
> > Thanks
> >
> > --
>
> --------------------------------------------------------------------------
> --
> > ----------------
> > Troy Rasiah
> > Database/Web Developer
> > Vicnet
> > troyr@vicnet.net.au
>
> --------------------------------------------------------------------------
> --
> > ----------------
> >
> >
>
>
------------------------------
Date: Mon, 21 Aug 2000 05:16:17 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: driver
Message-Id: <MPG.140b588e2dfde6c19896d1@localhost>
Troy Rasiah <troyr@vicnet.net.au> wrote ..
>"Troy Rasiah" <troyr@vicnet.net.au> wrote in message news:...
>> does anyone know how i would connect a perl script to MSQL Database
>>
>> Is it using DBD::mSQL or DBD::ODBC
>>
>> where can i download these drivers from....
>>
>> if they are the ones?
>
>Microsoft SQL Server even
it's unclear whether you meant this as a correction to your original or
an alternative .. in any case this should cover both
+ mSQL is a database written by Hughes Technology
(http://www.hughes.com.au/)
+ Microsoft SQL Server is commonly shortened to MSSQL
+ to access an mSQL database you use the DBI and the DBD which comes as
part of Msql-Mysql-modules from CPAN
+ to access an MSSQL database you can use the DBI and the ODBC DBD which
comes as part of DBD-ODBC from CPAN
+ to access an MSSQL database you can ALTERNATIVELY use Win32::ODBC from
Roth Consulting (http://www.roth.net/perl/)
+ CPAN is at http://www.cpan.org/
[ jeopardectomy ]
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 21 Aug 2000 11:45:16 +0200
From: "Raymond J.W. Jacobs" <king@sjako.demon.nl>
Subject: finding out which program enters your script
Message-Id: <39a0fa58$1@news>
As we all know it is a simple subroutine which let you find out from which
reffering site a perlprogramm is accesed. I wonder if it is possible to find
out from which programm on the clients-server your perlscript is being
accesed. I imagine it works in the same way as "HTTP_REFERER".
Of course I could look for the protocol being used. But I wonder what
happens if you acces a url from a mailprogram like Outlook Express. Which
protocol will it use? I guess http. But what I want to know if this url is
accesed from Outlook Express or Internet explorer. (Or Netscape or Eudora,
whatsoever)
1. Could somebody help me with a list of possibilities to find out about
environmental variables, where I can find the correct code.
2. Could somebody help me with a list of responses of the various
commonly used programs like browsers, emailprograms, ftp-programs.
Thank you all in advance
------------------------------
Date: Mon, 21 Aug 2000 10:35:31 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: Following Hyperlinks with cgi (Slightly Off Topic)
Message-Id: <39A0F7E3.7C0D1467@yahoo.co.uk>
amonotod wrote:
> In article <399DBB27.98C5AE97@stomp.stomp.tokyo>,
> "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
[garbage snipped]
> Oh man, I just realized, you're not a troll, you're a freaking
> encyclopedia of IT knowledge. Someone should should hook up your brain
> to a web server so that all of us idiots can ask you questions on
> demand. Since that is not feasible however, I have come up with an AI
> program that will emulate you:
>
> #!perl
> print "Blah Blah Blah" x 10000000;
> exit;
ROFLMAO!
------------------------------
Date: 20 Aug 2000 10:42:12 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Following Hyperlinks with cgi
Message-Id: <8no95k$j7s$1@orpheus.gellyfish.com>
On Sat, 19 Aug 2000 15:09:32 GMT Jeremiah Adams wrote:
> Would you actually speak face to face
> to one another in the manner you illustrated with your posts? I think not.
>
Yes. Except I would use an idiom more appropriate for speech.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Mon, 21 Aug 2000 05:22:10 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Forking sub{}'s and selective SIG{CHLD} responses
Message-Id: <slrn8q1f3u.m4q.tjla@thislove.dyndns.org>
I was shocked! How could Martien Verbruggen <mgjv@tradingpost.com.au>
say such a terrible thing:
>[reorganised order of post to respect the normal arrow of time]
>> I've tried localizing the SIG, that doesn't seem to work right.
>>
>> my $SIG{CHLD} = \&Callback();
>
>Bummer. I was afraid of that.
Just thought I'd butt in here and say that doesn't compile and if it
did, it doesn't localise the $SIG{CHLD} handler. You need to do:
local $SIG{CHLD} = {die};
or something similar for that.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
You can never tell which way the train went by looking at the tracks.
------------------------------
Date: Mon, 21 Aug 2000 17:02:31 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Forking sub{}'s and selective SIG{CHLD} responses
Message-Id: <slrn8q1l07.s2e.mgjv@martien.heliotrope.home>
On Mon, 21 Aug 2000 05:22:10 GMT,
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
> I was shocked! How could Martien Verbruggen <mgjv@tradingpost.com.au>
> say such a terrible thing:
> >[reorganised order of post to respect the normal arrow of time]
Hmmm. You really think this statement was that horrible?
> >> I've tried localizing the SIG, that doesn't seem to work right.
> >>
> >> my $SIG{CHLD} = \&Callback();
> >
> >Bummer. I was afraid of that.
or is it this one that's shocking?
> Just thought I'd butt in here and say that doesn't compile and if it
> did, it doesn't localise the $SIG{CHLD} handler. You need to do:
>
> local $SIG{CHLD} = {die};
Indeed... Something like that, but not entirely :). I missed that in the
followup, but you'll note that my original post that contained this
suggestion does the right thing :)..
local $SIG{CHLD} = sub { my $pid = wait; # ... other code goes here }
sub REAPER { my $pid = wait; # ... other code goes here }
local $SIG{CHLD} = \&REAPER;
And addressed to the originator of the thread:
Just checked myself what happens. It doesn't work, and with hindsight
it's obvious. The handler that is assigned at the moment the signal is
received will be used, not the one that was assigned at the moment the
fork happens, and I really don't know why I thought it would be. The
only decent way of doing this would be to keep track of the pid's that
you want to treat differently.
You should probably also use a better reaper than the one I presented.
The perl Cookbook (pp 590-593) has some good ones, and the perlipc man
page also shows some better ones.
If you have the Perl Cookbook, you might also be interested in the
example of a pre-forking server on pp 625-628).
Martien
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: Mon, 21 Aug 2000 09:47:22 GMT
From: zideon@my-deja.com
Subject: gethostbyaddr
Message-Id: <8nqtr6$s59$1@nnrp1.deja.com>
Hello,
I am writing a logfile script in Perl. With this script I would like to
register a visitors domain/hostname. I use the following code to find
out the host.
if ($ipadres =~ m!(\d+)\.(\d+)\.(\d+)\.(\d+)!) {
$host = (gethostbyaddr(pack('C4', $1, $2, $3, $4), 2))[0];
$host = "unknown" unless $host;
} else {
$host = "unknown";
}
I split the $host at '.', but I think I'll have a problem when $host
contains the following string (it must only print "xs4all" and "demon"):
- dial2334-2.xs4all.nl
- dial32ssd.demon.co.uk
- dial332.sdf.demon.co.uk
The first $host is from The Netherlands (.nl) and the second from the
UK (.co.uk). Is this format always the same???
("dialxxx" . "domain" . "country...country").
Where can I find how the '(gethostbyaddr(pack('C4', $1, $2, $3, $4), 2))
[0]' is built.
Regards,
Zid
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 21 Aug 2000 05:12:26 GMT
From: ajeet@my-deja.com
Subject: Help: Excel Automation question!
Message-Id: <8nqdng$agc$1@nnrp1.deja.com>
Dear all,
I am trying to use Win32::OLE to extract data from a MS Excel sheet.
Once, I open the workbook, I do this to access the values:
$worksheet = $workbook->Worksheets($sheetNo);
$thisref = $worksheet->Range("A4:A24")->{'Value'};
I have no problem with this, but it returns the exact values in the
cells A4:24. What I NEED are the FORMATTED values in the cells. The
documentation for the module says that I can access the TEXT-ONLY using
this:
$thisref = $worksheet->Range("A4:A24")->{'Text'};
But, all I get is an empty array. Anyone, who's done this before, could
please help me? Thank you very much!
Cheers
Ajeet
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 21 Aug 2000 04:25:28 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: HELP: TEXTAREA field and newlines
Message-Id: <slrn8q1bpm.9ae.efflandt@efflandt.xnet.com>
On Sun, 20 Aug 2000 23:47:39 -0400, Albert Dewey <timewarp@shentel.net> wrote:
>Code from a site I recently made to do just this -
>
> ## Remove the line returns and carriage feeds from the description and
>replace them with '<br>'
> $cr = chr(13).chr(10);
> $Description =~ s/$cr/\<br\>/g;
>
>Trust me - it works.
>
>Albert Dewey
I can confirm that. Even though Unix systems typically end text lines
with a newline, textarea lines from Linux Netscape posted to a Unix
system end with CR-LF.
>Perry Winkle wrote:
>
>> I've got a TEXTAREA field into which users may unfortunately type
>> newlines. I need to get rid of the newlines so that I can get
>> everything onto a single line.
>>
>> For some reaso, this is not working for me:
>>
>> $textblock =~ s/\n\n/<P>/;
>> $textblock =~ s/\n/<BR>/;
>>
>> $textblock (VALUE) still shows up as:
>>
>> <INPUT TYPE=hidden NAME=bio_info VALUE="Here is line 1
>> <BR>
>> <BR>Here is line 2">
>>
>> How can I get this on one line? I've tried the /m and /s modifiers, but
>> I'm not really sure how to set up the expression.
>>
>> Thanks,
>> Nigel
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Mon, 21 Aug 2000 09:01:47 +0200
From: Jimmy Lantz <webmaster@ostas.lu.se>
Subject: Re: HELP: TEXTAREA field and newlines
Message-Id: <39A0D3DC.B02E96E1@ostas.lu.se>
Jim Mauldin wrote:
>
> Perry Winkle wrote:
> >
> > I've got a TEXTAREA field into which users may unfortunately type
> > newlines. I need to get rid of the newlines so that I can get
> > everything onto a single line.
This might also be a HTML problem, have you set the TEXTAREA field to
physical or virtual?
// Jimmy
> >
> > For some reaso, this is not working for me:
> >
> > $textblock =~ s/\n\n/<P>/;
> > $textblock =~ s/\n/<BR>/;
> >
> > $textblock (VALUE) still shows up as:
> >
> > <INPUT TYPE=hidden NAME=bio_info VALUE="Here is line 1
> > <BR>
> > <BR>Here is line 2">
> >
> > How can I get this on one line? I've tried the /m and /s modifiers, but
> > I'm not really sure how to set up the expression.
>
> I don't know what your data looks like, but that should work as long as
> you use the /g modifier to catch them all:
>
> $textblock =~ s/\n\n/<P>/g;
> $textblock =~ s/\n/<BR>/g;
>
> You could also do it in one step:
>
> $textblock = "Here is some information that I entered in a textbox
> but then I scrolled off the screen and decided to enter some
> newlines so that I could read what I've written.
>
> Now I want to start a new idea so I enter two newlines to
> really set it off from the previous paragraph";
>
> $textblock =~ s/(\n)(\1?)/$2?"<p>":"<br>"/eg;
> print $textblock; # all on one line
>
> -- Jim
------------------------------
Date: 21 Aug 2000 06:59:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: hey, i need help, im trying to get what email = from www.mydomain.com/cgi-local/test.cgi?email=test@test.com
Message-Id: <8nqggq$lsu$1@orpheus.gellyfish.com>
On Sun, 20 Aug 2000 05:02:16 GMT Brian Delaney wrote:
> On Sun, 20 Aug 2000 03:46:22 GMT, mattman055@my-deja.com wrote:
>
>>what i want to do is get test@test.com
>>so when a person clicks in an email
>>www.mydomain.com/cgi-local/test.cgi?email=teset@test.com
>>
>>i am trying all sorts of things to get what email =
>>i am trying $data{'email'}
>>i am trying $values{'email'}
>>i am trying $input{'email'}
>>i am trying $in{'email'}
>>
>>when i do like $xyz = one of those, it always returns nothing, anyhelp
>>would
>>be appreaciated
>>
>>i imagine it is very easy to get the value of a variable from that, but
>>i can't figrue it out
>>
>
> have you parsed the form? Use:
>
> read(STDIN, $input,$ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $input);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $name =~ tr/+/ /;
> $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $IN{$name} = $value;
> }
>
> the email will be stored in $IN{'email'}
>
No it wont - the OP was explicitly using the GET method and there the
query string is not passed via STDIN. Of course even if the POST method
was being used most people would recommend that the module CGI is used.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Mon, 21 Aug 2000 04:30:51 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: HOWTO......(without LWP)
Message-Id: <slrn8q1c3p.9ae.efflandt@efflandt.xnet.com>
On Sun, 20 Aug 2000 23:40:02 GMT, Mark <mtaylorlrim@my-deja.com> wrote:
>I have searched and cannot find that oft asked question....
>
>Can I capture the source of a web page into an array?
>
>I know it can be done with the LWP module, but I want to do it without.
>Perhaps even put the output into a file. Sort of like this...
See the webget example in 'perldoc perlipc' or I have a script that can
get various parts of the page, from just headers, just contents or both at
http://www.de-srv.com/pub/urlcheck.txt
It can also check the response of other ports like ftp, smtp, etc.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Mon, 21 Aug 2000 17:58:49 +0900
From: "sang" <laoxiu100@hotmail.com>
Subject: IE is OK but NC4 is wrong
Message-Id: <8nqqsb$44d$1@nn-os102.ocn.ad.jp>
Hi,
$sql ="Select ";
$sql .="
H_00_MONEY,H_01_MONEY,H_02_MONEY,H_03_MONEY,H_04_MONEY,H_05_MONEY";
$sql .=" FROM apollo.reportday ";
$sql .=" where SETUBI_CD='$parkCode' ";
$sql .=" AND START_DT=TO_DATE('$inDate 00:00:00','YYYY-MM-DD HH24:MI:SS')
";
$statementHandle = $dbHandle->prepare($sql);
$statementHandle->execute() || die $statementHandle->errstr;
@dbRows = $statementHandle->fetchall_arrayref();
$i=0;
foreach $rowReference(@dbRows)
{
foreach $columnReference(@$rowReference)
{
$i=0;
@cola=@$coloumnReference;
foreach $column(@$columnReference)
{
$listvalue[$i]=$column;
$i++;
}
}
}
It is OK in IE5
but it is wrong in Netscape 4.73, i cannot get data.
What is wrong?
Thanks in advance
------------------------------
Date: Mon, 21 Aug 2000 09:28:33 GMT
From: sandhall@swipnet.se (Robert Hallgren)
Subject: Re: IE is OK but NC4 is wrong
Message-Id: <slrn8q1tjm.2g6.sandhall@poetry.lipogram>
On Mon, 21 Aug 2000 17:58:49 +0900, sang <laoxiu100@hotmail.com> wrote:
[Cut out perl-code]
> It is OK in IE5
> but it is wrong in Netscape 4.73, i cannot get data.
>
> What is wrong?
Probably your HTML. Can't really say from what you included in your post.
Have you run it through a validator?
<URL: http://validator.w3.org/ >
My guess is <comp.infosystems.www.authoring.html> would be a better group
for your problem.
Robert
--
Robert Hallgren <sandhall@swipnet.se>
PGP: http://www.lipogram.com/pgpkey.asc
5F1E 95C2 F0D8 25A3 D1BE 0F16 D426 34BD 166A 566C
------------------------------
Date: Mon, 21 Aug 2000 09:10:39 GMT
From: peter pilsl <pilsl@goldfisch.atat.at>
Subject: Re: join on two arrays
Message-Id: <MPG.140b109719e8dd3e98984e@news.chello.at>
thanks a lot,
very helpful solutions.
peter
--
pilsl@
goldfisch.at
------------------------------
Date: Mon, 21 Aug 2000 11:02:23 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: Re: Modifying a text file
Message-Id: <8nqr68$qck$1@qnsgh006.europe.nortel.com>
"> You should seriously consider using DBD::CSV or DBD::RAM, which will
> handle all the low-level mechanics of file maintenance for you; your code
> will reduce to writing a few simple SQL INSERT, UPDATE, and DELETE
> statements. And if your database ever gets so big that you need to go to
> a full-fledged RDBMS, all you'll have to do is change one or two literal
> strings in your code and it will still work.
>
But I am using a flat text file - don't sql databases interface to programs?
And can i still use these modules even with pipe delimited text files?
------------------------------
Date: Sun, 20 Aug 2000 21:49:51 -0700
From: John <johnt@sparc.nic.bc.ca>
Subject: MySQL in Perl/CGI question
Message-Id: <Pine.GSO.4.10.10008202148530.8406-100000@sparc.nic.bc.ca>
I'm pulling some info from a mysql db and displaying it using Perl/CGI.
For some reason two of the outputs are being cut off.. here's the run
down:
in mysql
address='2345 Nutball St SE #48'
country='United States'
password_lost_question='what's blac and blue and red all over?'
name='John'
I am display the address in: <textarea>$hash_ref->{'address'}</textarea>.
This prints out fine even with the spaces.
Name is displayed like <input type=text name=fname
value='$hash_ref->{'fname'}>
The name displays fine.
when country comes out: <input type=text name=country
value='$hash_ref->{'country'}>
it only displays "United" in the text box.
Same with password_lost_question : <input type=text name=plost
value='$hash_ref->{'plost'}>
.. I only get "what's" in the text box.
At first I thought it was due to the ' in the password lost question.. but
that doesn't explain why it cuts off 2 chars past the '.. also.. that does
not explain the cuttof in United States.
Anyone have any ideas?
Thanks,
John
------------------------------
Date: Mon, 21 Aug 2000 05:19:19 GMT
From: ajeet@my-deja.com
Subject: Re: MySQL in Perl/CGI question
Message-Id: <8nqe4c$aqo$1@nnrp1.deja.com>
Dear John,
If I am not wrong, your problem is cos of your missing "quote".
For eg, this is what you do:
<input type=text name=country value='$hash_ref->{'country'}>
Instead, do this:
<input type=text name=country value='$hash_ref->{'country'}'>
And it should work. If it doesnt, replace the outer 's with ".
Same for password field.
Reasons: Address works coz it's a textarea field and encloses all the
characters. If you chk your output source code of the HTML, you'll find
the whole United States there without the ending quote.
Hope that helps!
Cheers
Ajeet
In article <Pine.GSO.4.10.10008202148530.8406-100000@sparc.nic.bc.ca>,
John <johnt@sparc.nic.bc.ca> wrote:
> I'm pulling some info from a mysql db and displaying it using
Perl/CGI.
>
> For some reason two of the outputs are being cut off.. here's the run
> down:
>
> in mysql
>
> address='2345 Nutball St SE #48'
>
> country='United States'
>
> password_lost_question='what's blac and blue and red all
over?'
>
> name='John'
>
> I am display the address in: <textarea>$hash_ref->{'address'}
</textarea>.
> This prints out fine even with the spaces.
>
> Name is displayed like <input type=text name=fname
> value='$hash_ref->{'fname'}>
>
> The name displays fine.
>
> when country comes out: <input type=text name=country
> value='$hash_ref->{'country'}>
>
> it only displays "United" in the text box.
>
> Same with password_lost_question : <input type=text name=plost
> value='$hash_ref->{'plost'}>
>
> .. I only get "what's" in the text box.
>
> At first I thought it was due to the ' in the password lost
question.. but
> that doesn't explain why it cuts off 2 chars past the '.. also.. that
does
> not explain the cuttof in United States.
>
> Anyone have any ideas?
>
> Thanks,
>
> John
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 21 Aug 2000 05:47:39 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: MySQL in Perl/CGI question
Message-Id: <MPG.140b5fe660a89896d2@localhost>
John <johnt@sparc.nic.bc.ca> wrote ..
>I'm pulling some info from a mysql db and displaying it using Perl/CGI.
>
>For some reason two of the outputs are being cut off.. here's the run
>down:
>
>in mysql
>
> address='2345 Nutball St SE #48'
>
> country='United States'
>
> password_lost_question='what's blac and blue and red all over?'
>
> name='John'
>
>
>I am display the address in: <textarea>$hash_ref->{'address'}</textarea>.
>This prints out fine even with the spaces.
>
>Name is displayed like <input type=text name=fname
>value='$hash_ref->{'fname'}>
>
>The name displays fine.
>
>when country comes out: <input type=text name=country
>value='$hash_ref->{'country'}>
>
>it only displays "United" in the text box.
>
>Same with password_lost_question : <input type=text name=plost
>value='$hash_ref->{'plost'}>
>
>.. I only get "what's" in the text box.
>
>At first I thought it was due to the ' in the password lost question.. but
>that doesn't explain why it cuts off 2 chars past the '.. also.. that does
>not explain the cuttof in United States.
>
>Anyone have any ideas?
show a real working example of the problem (not all your code - just
enough to show the problem that you're having)
in your examles above you've got single quotes flying everywhere
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 21 Aug 2000 09:00:52 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Ordered set of permutations algorithm
Message-Id: <966846894.14337@itz.pp.sci.fi>
In article <8mrpag$db4$1@tomm.stsci.edu>, Keith Scollick wrote:
> For example, given a list (1, 2, 3, 4, 5). I want to return an array
>containing
>(each element is separated by a comma):
>
>1, 2, 3, 4, 5, 1 2, 1 3, 1 4, 1 5, 2 3, 2 4, 2 5, 3 4, 3 5,
>1 2 3, 1 2 4, 1 2 5, 1 3 4, 1 3 5, 2 3 4, 2 3 5, 3 4 5,
>1 2 3 4, 1 2 3 5, 1 2 4 5, 1 3 4 5, 2 3 4 5, 1 2 3 4 5
sub comb {
map {
my $x = $_[$_];
[$x], map [$x, @$_] => comb(@_[$_+1 .. $#_]);
} 0 .. $#_;
}
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4076
**************************************