[12899] in Perl-Users-Digest
Perl-Users Digest, Issue: 309 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 30 07:09:51 1999
Date: Fri, 30 Jul 1999 04:05:10 -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 Fri, 30 Jul 1999 Volume: 9 Number: 309
Today's topics:
$/ for cross platform text files? <rolf@parallax.co.uk>
Re: ASCII to ANSI conversion -- HELP <nospam.newton@gmx.net>
Re: ASCII to ANSI conversion -- HELP <flavell@mail.cern.ch>
bug in perlop manual (elephant)
Re: Die process, Die! (Michel Dalle)
Re: Easy way to emulate Unix's "sort" command? (Anno Siegel)
Re: ebcdic packed numbers <nospam.newton@gmx.net>
Re: File maintenance algorithm required (Lars Gregersen)
Filehandle: append and tee at the same time (Eric Smith)
Re: form, binary attachments <again> <prinspaul@NOSPAM!hotmail.com>
Re: form, binary attachments <again> <prinspaul@NOSPAM!hotmail.com>
Re: form, binary attachments <again> <prinspaul@NOSPAM!hotmail.com>
Re: form, binary attachments <again> <gellyfish@gellyfish.com>
Re: form, binary attachments <again> (Anno Siegel)
framekeeper.pl <benjamin@daelken.com>
Re: How to: run a DOS batch in perl/cgi? <timnett@mindspring.com>
Re: HTML 2 text??? (Anno Siegel)
Re: Invoing Perl script on Remote NT machine <carvdawg@patriot.net>
Re: Newbie alert !! <cajun@rattler.cajuninc.com>
Re: parameter doesn't show up <rhrh@hotmail.com>
Re: Printing lines BTW two strings in file (NOT!) <nospam.newton@gmx.net>
Re: Refresh problem coming out of Perl script (Bart Lateur)
Re: running Perl and Linux from a boot-cd? <wallenborn@phys.chem.ethz.ch>
Re: Use of uninitialized value at ...... warning with h <jong@ebi.ac.uk>
Why is this regexp not working ? marcza@my-deja.com
Win32::OLE or something else ??? <w-woerlinger@ti.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 30 Jul 1999 10:18:26 +0100
From: Rolf Howarth <rolf@parallax.co.uk>
Subject: $/ for cross platform text files?
Message-Id: <37A16DE2.978D363A@parallax.co.uk>
What's the easiest way to process a text file a line at a time if you
don't know in advance whether it's DOS (\r\n), Unix (\n) or Macintosh
(\r) format?
DOS and Unix is easy, set the input record separator $/ to \n and remove
any trailing \r's, but if your script encounters a Mac file then it will
read the entire file in one go.
I keep thinking this ought to be trivially easy (even the default
behaviour of $/ if you don't set it to anything else), but can't think
of any way of doing it without reading the file twice (the first time to
identify it's type), reading it a character at a time and splitting it
into lines myself, or slurping it all into memory and then splitting it,
none of which are ideal. The file might be huge, so efficiency is
important. Am I missing something obvious?
-Rolf
------------------------------
Date: Fri, 30 Jul 1999 11:30:11 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: ASCII to ANSI conversion -- HELP
Message-Id: <37A170A3.2E0647CB@gmx.net>
Alan J. Flavell wrote:
>
> On Thu, 29 Jul 1999, Philip 'Yes, that's my address' Newton wrote:
>
> > > > I need to create a script that converts ANSI characters to ASCII
> > > > characters.
> > >
> > > So what is it actually that you hope to achieve with this
> > > "conversion"?
> >
> > Chances are he means, roughly, "ISO-Latin-1 (or Windows-1252) --> IBM
> > Codepage 437 (or 850)".
>
> Well, I thought he _might_ have meant the exact opposite, but I didn't
> want to put words into his mouth.
It depends on whether you read the subject ("ASCII to ANSI conversion")
or the body of the posting ("that converts ANSI characters to ASCII
characters").
> I think the recode program was the
> right thing to point at, anyhow.
Surely. `recode latin1:ibmpc` I think is what he wants (or the other way
round).
> But ASCII is still a 7-bit code.
Yes. ANSI-to-OEM might have been more familiar; I think that's the
terminology windows itself uses. Still not technically precise, though.
Cheers,
Philip
------------------------------
Date: Fri, 30 Jul 1999 12:06:46 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: ASCII to ANSI conversion -- HELP
Message-Id: <Pine.HPP.3.95a.990730120511.6568B-100000@hpplus03.cern.ch>
On Fri, 30 Jul 1999, Philip 'Yes, that's my address' Newton wrote:
> It depends on whether you read the subject ("ASCII to ANSI conversion")
> or the body of the posting ("that converts ANSI characters to ASCII
> characters").
Oh yeah, so it does. I wish people wouldn't do that :-}
all the best
------------------------------
Date: Fri, 30 Jul 1999 19:09:01 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: bug in perlop manual
Message-Id: <MPG.120c16b5186a5d3d989ba7@news-server>
I sent this to tchrist@perl.com by email which seemed to be the right
course of action according to the pumpkins listing on www.perl.org ..
having received no reply to that nor any reply to a question here about
whether I should expect a reply .. and after seeing a few bug
notifications posted here I'm posting this now
if it's the wrong place .. flame away - I'm beyond caring
I believe that there's a bug in the perlop documentation .. in the "Quote
and Quote-like Operators" section - line 736 (when viewed with 'man')
"For example, most networking protocols
expect and prefer a CR+LF ("\012\015" or "\cJ\cM") for
line terminators,"
should be
"For example, most networking protocols
expect and prefer a CR+LF ("\015\012" or "\cM\cJ") for
line terminators,"
--
jason - remove all hyphens for email reply -
------------------------------
Date: Fri, 30 Jul 1999 10:49:58 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Die process, Die!
Message-Id: <7ns04b$p3j$1@news.mch.sbs.de>
In article <37A08FC4.3DA2F723@mail.cor.epa.gov>, David Cassell <cassell@mail.cor.epa.gov> wrote:
[snip]
>ASCII art. Line 17 is still smack in the middle of their
>header, which has a dramatic 40-line rendering of their
>self-concept.
>
>David
Several free CGI scripts (*) show this on line 17 :
# expressly forbidden. In other words, please ask first before you try and #
Could this be the problem ? :-)
Michel.
(*) found on Matt's Script Archive...
------------------------------
Date: 30 Jul 1999 10:48:06 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Easy way to emulate Unix's "sort" command?
Message-Id: <7nrvt6$310$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>> map { [ $_, uc((/\d+\s*(\S+)/ )[0] ] } @data;
>The first time I saw this buggy code today (in the response in this
>thread by Darrin Edwards), I chose to ignore it. But now you have
>rubbed our noses in it again, Tad, so I thought it was worth an
>observation here.
>
>Some of us sometimes boast to newcomers about the thousands of eye-hours
>that the solutions in the FAQ have received. Obviously this one hasn't.
Only perl can parse Perl. And Larry Rosler, apparently. How on earth
did you spot that missing paren in the line of comics-swearing above?
I guess I'm not alone in going into faq mode, just trusting those
stacks of eye-hours instead of piling on top a minute or two of my own.
Kudos.
Anno
------------------------------
Date: Fri, 30 Jul 1999 11:26:25 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: ebcdic packed numbers
Message-Id: <37A16FC1.F5A4083D@gmx.net>
Uri Guttman wrote:
>
> >>>>> "P'tmaN" == Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> writes:
>
> P'tmaN> Uri Guttman wrote:
> >>
> >> only the ibm 360 (and descendents), the vax and a few others did this
> >> in hardware. no risc machines could do it directly since by
> >> definition, decimal instructions are cisc.
>
> P'tmaN> As far as I know, x86 processors can do this in a two-step
> process using P'tmaN> DAA / DAS (decimal adjust after
> addition/subtraction) or AAA/AAS/AAD/AAM P'tmaN> (ASCII adjust
> after...). I think DAA and DAS were in 8080 and Z80 chips, P'tmaN> as
> well. So you could do addition and subtraction with packed numbers,
> P'tmaN> at least -- by using the normal ADD/SUB opcode and then
> correcting with P'tmaN> DAA/DAS.
>
> which backs my point. x86 is a cisc cpu.
Yes, I knew that. I was just giving an example of "a few others".
> also where did the decimal point alignment happen?
You had to take care of it yourself, I suppose. I think the mechanism
was only suited to integers. You could do fixed-point calculation, if
you want (e.g. always to decimal places), but for floating point you'd
have to align the operands yourself.
Cheers,
Philip
------------------------------
Date: Fri, 30 Jul 1999 10:40:15 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: File maintenance algorithm required
Message-Id: <37a17f65.346060747@news.dtu.dk>
On Thu, 29 Jul 1999 20:05:35 GMT, roger@wheelpro.co.uk (Roger Musson)
wrote:
>Appending is really what I would like to do for efficiency, but 90% of
>the time the file is used for displaying the recent additions, so
>appending to the front makes the display transaction faster. An index
It sorts of depends then on how many additions of lines you have per
display call. How many lines do you need to display for recent
additions? Couldn't you make a special, small file for that purpose.
When that file gets too big then move the lines to large file.
>would be fine but for the fact that lines can also be deleted from the
>file.
The index is a rather good idea if you have lines with varying length.
Is it possible for you to have equal line lengths? You may lose a few
bytes by making all lines of equal length, but then you don't have to
make the index and you can simply use fseek to get to the line you
want.
If you have to delete lines, you have to rewrite the file. An
alternative is to keep the index and simply delete the entry for the
deleted lines. If you tend to delete a lot of lines and waste too much
space this way then sweep over your data file once in a while and
rewrite the file.
Lars
------------------------------
Lars Gregersen (lg@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg
------------------------------
Date: 30 Jul 1999 10:35:09 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: Filehandle: append and tee at the same time
Message-Id: <slrn7q2vvd.esl.eric@plum.fruitcom.com>
Hi
I am having trouble creating a filehandle that can append to a file and tee
at the same time. I can do each thing seperately but not together.
This is what did not work for me:
open LOG, "| tee >>/d/u/log/$date"
this did the tee nicely (i.e output to STDOUT and the file)
open LOG, "| tee /d/u/log/"
May I do both at the same time?
--
Eric Smith
eric@fruitcom.com
www.fruitcom.com
Speak softly and carry a cellular phone.
------------------------------
Date: Fri, 30 Jul 1999 11:39:18 +0200
From: "Paolo" <prinspaul@NOSPAM!hotmail.com>
Subject: Re: form, binary attachments <again>
Message-Id: <7nrrh2$j55t$1@reader3.wxs.nl>
Anno Siegel heeft geschreven in bericht
<7nq596$1u5$1@lublin.zrz.tu-berlin.de>...
>Paolo <prinspaul@NOSPAM!hotmail.com> wrote in comp.lang.perl.misc:
>>Hi,
>>
>>Searching the web for the script I need I ended up here.
>>I must admit I don't know a damn thing about Perl.
>>I've seen some scripts and decided not to get into this because you just
>>can't know it all.
>>Here's my problem:
>>Like many others I am looking for a script with which I can let my website
>>visitors attach a binary file from their PC to the form displayed and mail
>>it to me.
>>Now, please don't send me replies about MIME::Lite and CPAN because like I
>>said I don't know anything about perl.
>>Does anybody have a script like this to share ?
>>Or maybe an example ?
>
>Translation: Solve my problem but don't bother me with pesky
>details.
Well you could put it that way.
But it's NOT what I wrote, it's what you make of it.
Why should I invent this wheel again ?
>Go away.
Since no one here is going to help me by giving me some code
I guess I have to figure out Perl after all %#%@ !
So sorry Anno I'm here to stay
>Anno
------------------------------
Date: Fri, 30 Jul 1999 11:43:35 +0200
From: "Paolo" <prinspaul@NOSPAM!hotmail.com>
Subject: Re: form, binary attachments <again>
Message-Id: <7nrrp4$is3n$1@reader3.wxs.nl>
elephant wrote...
>Anno Siegel writes ..
>>Paolo <prinspaul@NOSPAM!hotmail.com> wrote in comp.lang.perl.misc:
>>>I must admit I don't know a damn thing about Perl.
>>>Now, please don't send me replies about MIME::Lite and CPAN because like
I
>>>said I don't know anything about perl.
>>>Does anybody have a script like this to share ?
>>>Or maybe an example ?
>>
>>Translation: Solve my problem but don't bother me with pesky
>>details.
>
>I saw it more as:
>
>I've had my brain removed - can someone please live my life for me and
>let me know when I'm dead
:) Did you make this one up by yourself ?
>how do people go through life not wanting to know things .. Paolo -
I don't know Jumbo, but like I said , you just CAN'T know it all
>you've got more guts than brains if you'd install something that someone
>sent you for free without knowing how it works and then make that script
>available via the web
Well you are right; I would have more guts than brains installing some code
without looking at it first.
Maybe you assume to much.
But hey, With elephantbrains like yours I guess you know it all ;)
Thanx-a-lot
------------------------------
Date: Fri, 30 Jul 1999 11:43:10 +0200
From: "Paolo" <prinspaul@NOSPAM!hotmail.com>
Subject: Re: form, binary attachments <again>
Message-Id: <7nrroa$iuq2$1@reader3.wxs.nl>
>People are always _wanting_ and not giving anything, what did Larry get?
>What did Mr. Linus get for making Linux and giving for free? ... They are
>great heroes though :)
I don't know Larry but I guess you have to be American to know him.
Why are you assuming that I'm only wanting and not giving?
What do you want ? Money, a blowjob ?
We all want something, don't we ?
>: Now, please don't send me replies about MIME::Lite and CPAN because like
I
>: said I don't know anything about perl.
>If you don't know Perl, then learn Perl. I assure you won't waste your
>time! :)
Well I guess I havent got any choice then, do I ?
>: Does anybody have a script like this to share ?
>If you knew Perl, you could make it in 2 minutes!
yeh, that's what I mean.
Like some old lady asking in a supermarket ,"young man,could you please get
this stuff for me I can't reach it" You'll probably say no too. So the lady
has to find a ladder or something to get to the stuff she wants.
Well I'm going to find my ladder and won't waste any more time with this
discussion.
>: Or maybe an example ?
>Oh boy, you asked for it :)
>
>Go to CPAN and download MIME::Lite module.. you don't need to install it
>at this point :)
>
>Just looking to Lite.pm and see the documentation either in the
>beginning or the end and see an example there.
>
>Or search @ perl.com
:) I will, thanks for putting me in the right direction
------------------------------
Date: 30 Jul 1999 11:57:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: form, binary attachments <again>
Message-Id: <37a18514_1@newsread3.dircon.co.uk>
Paolo <prinspaul@NOSPAM!hotmail.com> wrote:
>
> Anno Siegel heeft geschreven in bericht
> <7nq596$1u5$1@lublin.zrz.tu-berlin.de>...
>>Paolo <prinspaul@NOSPAM!hotmail.com> wrote in comp.lang.perl.misc:
>>>Hi,
>>>
>>>Searching the web for the script I need I ended up here.
>>>I must admit I don't know a damn thing about Perl.
>>>I've seen some scripts and decided not to get into this because you just
>>>can't know it all.
>>>Here's my problem:
>>>Like many others I am looking for a script with which I can let my website
>>>visitors attach a binary file from their PC to the form displayed and mail
>>>it to me.
>>>Now, please don't send me replies about MIME::Lite and CPAN because like I
>>>said I don't know anything about perl.
>>>Does anybody have a script like this to share ?
>>>Or maybe an example ?
>>
>>Translation: Solve my problem but don't bother me with pesky
>>details.
>
> Well you could put it that way.
> But it's NOT what I wrote, it's what you make of it.
> Why should I invent this wheel again ?
>
>>Go away.
>
> Since no one here is going to help me by giving me some code
> I guess I have to figure out Perl after all %#%@ !
> So sorry Anno I'm here to stay
>
Oh thats a shame for you because I figure that you've now totally blown
any chances you had of getting help here ...
*plonk*
/J\
--
"The most frightening thing on television since Anthea Turner revealed
she had a sister" - Suggs
------------------------------
Date: 30 Jul 1999 11:03:41 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: form, binary attachments <again>
Message-Id: <7ns0qd$339$1@lublin.zrz.tu-berlin.de>
Paolo <prinspaul@NOSPAM!hotmail.com> wrote in comp.lang.perl.misc:
>Anno Siegel heeft geschreven in bericht
>>Go away.
>
>Since no one here is going to help me by giving me some code
>I guess I have to figure out Perl after all %#%@ !
>So sorry Anno I'm here to stay
You are welcome, as are any reasonable questions you might have about
perl. Just don't mistake this group for a repository of ready-to-use
solutions. Those have a cost, either in terms of search time or in
money. Advice here is free.
Anno
------------------------------
Date: Fri, 30 Jul 1999 11:35:43 +0200
From: "Benjamin Dälken" <benjamin@daelken.com>
Subject: framekeeper.pl
Message-Id: <7nrrkl$ijh$1@news01.btx.dtag.de>
does anyone now where i can get the script "framekeeper.pl" ?
this is a script which takes you in the right frameset, when you only load
one frame of the set.
thanks, benjamn
------------------------------
Date: Fri, 30 Jul 1999 06:35:53 -0400
From: "Tim Nettleton" <timnett@mindspring.com>
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <7nrv51$h5u$1@nntp3.atl.mindspring.net>
I am sorry that I did not state it clearly enough. I really am a bit
apprehensive about perl because I have no experience with it.
Simply stated, I have a batch file that I would like to run on the server
that would get one parameter from a web page form and would display the
results to that same web page. I have looked at formmail.pl and am not sure
how to modify something like that to do what I would like.
This seems like an easy one for you(the group) but I am not sure where to
start. I have already done some searched for key words like batch dos perl
and found nothing that looks like a fit. I have a unix and an NT account
that I can load the script to.
Thanks for your understanding.
Tim
Abigail <abigail@delanet.com> wrote in message
news:slrn7pvhmo.4oo.abigail@alexandra.delanet.com...
> Tim Nettleton (timnett@mindspring.com) wrote on MMCLVII September
> MCMXCIII in <URL:news:7nmm6b$lgd$1@nntp9.atl.mindspring.net>:
> `` I have need to run a batch file that requests nslookup and ping
information
> `` on several hosts. I would like to have a form on a page that someone
can
> `` just type in the IP or domain and then the .bat file will run in the
> `` CGI-BIN. I have a unix server and a NT server.
> ``
> `` Is this possible? Can anyone reference some working code that I may
learn
> `` from?
>
>
> Yes, but what's your Perl question?
>
>
>
> Abigail
> --
> perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
>
>
> -----------== 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: 30 Jul 1999 09:25:16 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: HTML 2 text???
Message-Id: <7nrr1s$2rn$1@lublin.zrz.tu-berlin.de>
Bob Freedman <bob.freedman@eis.noaa.gov> wrote in comp.lang.perl.misc:
>Can someone show me a quick example of how to extrapolate the text from
>a HTML file.
>
>I tried:
>$text = new HTML::Parser;
>
>$text->parse_file($document);
>
>if I print $document I get 'HTML::Parser=HASH(0xba23c)'
I'm sure you looked into the documentation that comes with HTML::Parser
and found
$p->parse_file( $file );
This method can be called to parse text from a file.
The argument can be a filename or an already opened
file handle. The return value from parse_file() is a
reference to the parser object.
So what did you expect it to print?
You may also have come across
In order to make the parser do anything interesting, you
must make a subclass where you override one or more of the
following methods as appropriate:
but you didn't do that. I suppose you don't want it to do
anything interesting then.
Well, seriously: Read the documentation and at least try to make
it work for you before you turn to a newsgroup for help.
Anno
------------------------------
Date: Fri, 30 Jul 1999 06:37:15 -0400
From: HC <carvdawg@patriot.net>
Subject: Re: Invoing Perl script on Remote NT machine
Message-Id: <37A1805B.BB21A6B7@patriot.net>
Can you describe what the script is intended to do? If the function is
Un*x-specific, you'll have problems even if you do get it to run. If
it's
NT-specific, you might not need to log in remotely...
prem_g@technologist.com wrote:
> Hello
>
> I have a cgi-script(perl) that 'rsh's to a remote machine and
> kicks off another perl script. It works OK if the remote machine
> is running unix.
>
> If the remote machine is NT, I get a message saying:
> "Illegal character \015 (carriage return) at /../test.pl line 2
> (Maybe you didn't strip carriage returns after a network transfer?)
>
> (I can rsh and run a shell script on a remote NT machine though).
>
> Do I need to make some config changes that will take care of this
> problem?
>
> I appreciate your input.
>
> Thank U,
> Prem
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Fri, 30 Jul 1999 03:19:21 -0700
From: 96Vette <cajun@rattler.cajuninc.com>
Subject: Re: Newbie alert !!
Message-Id: <37A17C29.DEAB1976@rattler.cajuninc.com>
Thank you Sam. I'm sure there are many ways to accomplish it. Thanks much
for the starting point. That's what I was looking for.
In my tiny mind, I thought the following might work:
#!/usr/bin/perl -n -pi.bak
s/$_/$_'.'|||||/w;
Of course, I was wrong.
Thanks again,
Mike
Sam Holden wrote:
> On Fri, 30 Jul 1999 01:00:45 -0700,
> 96Vette <cajun@rattler.cajuninc.com> wrote:
>
> If you choose a subject that relates to the question you might
> actually get an answer.
>
> >Current database example:
> >
> >|Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222|
> >|Joe|432 Pine Street|Downtown, CA|88888|555-222-3333|
> >
> >The database definition has been expanded to include five more blank
> >fields at the end of each record. Making the new database example look
> >like this:
> >
> >|Mary|601 Elm Street|Nowhere, CA|99999|555-111-2222||||||
> >|Joe|432 Pine Street|Downtown, CA|88888|555-222-3333||||||
> >
> >
> >It would seem that this would be a trivial matter for a perl script.
> >I'm pretty sure this will involve the "." operator, but I'm not sure how
> >to go about it.
>
> perl -lni -e 'print $_,"|||||"' database.file
>
> Since this is perl there are about ten million other ways of doing it,
> about half of which are probably 'better' as measured by some metric (some
> of which are better as measured by all metrics, in all likelyhood).
>
> You can read the documentation that comes with perl to find out what it
> all does. The perlrun documentation might be a good place to start...
>
> Of course this is also trivial to do with sed. Just as easy with any
> reasonable text editor.
>
> --
> Sam
>
> About the only thing most people know about black holes is they are
> black, and now we have stuffed that up
> -- Dr Paul Francis (after reporting finding 'pink' holes)
------------------------------
Date: Fri, 30 Jul 1999 09:45:22 +0100
From: Richard H <rhrh@hotmail.com>
Subject: Re: parameter doesn't show up
Message-Id: <37A16622.DF9FACAE@hotmail.com>
Maria Zevenhoven wrote:
>
> I made this thing to test, but it doesn't work:
>
> #!/usr/bin/perl
>
> print "Content-type: text/plain\n\n";
> print '<html>';
> print "<br><h1>Kalenteri 0.01b</h1>\n";
> print "<br>";
>
> read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
> print "Parameter: $in";
>
> with perl -w I get the following:
>
> <html><br><h1>Kalenteri 0.01b</h1>
> Use of uninitialized value at kalenteri.cgi line 8.
> <br>Parameter:
>
> so what went wrong?
Nothing went wrong, you asked for a warning and you got one,
you've read an environmental variable into an uninitiated variable,
declare it first:
my $in;
and to make things easier in the long run look up strict in the docs:
#!/usr/bin/perl -w
use strict;
Richard H
------------------------------
Date: Fri, 30 Jul 1999 11:47:59 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Printing lines BTW two strings in file (NOT!)
Message-Id: <37A174CF.9F32E6CC@gmx.net>
chris dawson wrote:
>
> And there are better ways to match multiple occurences of a character
> than
> $eks_file[$i] !~ /\*\*\*\*/ )
Such as? Were you thinking about /\*{4}/? By explicitly specifying the
four asterisks, you relieve the regex engine from having to count
itself. As I understand it, the original version is more efficient
("better", in my book) than \*{4}. Or what were you thinking of?
Cheers,
Philip
------------------------------
Date: Fri, 30 Jul 1999 09:50:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Refresh problem coming out of Perl script
Message-Id: <37a2754e.169169@news.skynet.be>
Jeff Pitman wrote:
>Anyone had this problem? When the user hits back on the browser it re runs
>the perl script and goes to the same "redirected" page. What I want to do
>is when the user clicks on a link, the perl script takes them to a
>redirected page
Does your Perl script output a "Location:" header, instead of a HTML
page?
>I've tried <meta http-equiv="refresh....
It looks like it doesn't.
Bart.
------------------------------
Date: 30 Jul 1999 12:03:51 +0200
From: Ernst-Udo Wallenborn <wallenborn@phys.chem.ethz.ch>
Subject: Re: running Perl and Linux from a boot-cd?
Message-Id: <uiyafyxxmg.fsf@bacon.ethz.ch>
Thomas Weholt <thomas@bibsyst.no> writes:
> Hi,
>
> I got a database I`d like other less fortunate people, actually people
> running crap like windows98 and Windows Nt, to have the pleasure of
> using. Because these people are scared of the OS called Linux they will
> not dare to install it on their computer, but a boot-cd they might try
> out. My idea was that if I could make a boot-image, using linux, with
> all the stuff needed to run Perl, and Perl of-course, on it, the
> database could be used by everybody. The main database would be burned
> after the boot-part was created on the disc, so the cd-rom would appear
> like a normal disc for ordinary use. No X-Windows, no extra bullshit.
The SuSE CDs come with what they call a rescue system: a 8 MB RAM
disk with a selected number of tools on them. You can boot from
CD, and use it just as any other installed system. Ask the folks
at www.suse.de about how to make a bootable CD that includes perl.
--
Ernst-Udo Wallenborn
Laboratorium fuer Physikalische Chemie
ETH Zuerich
------------------------------
Date: Fri, 30 Jul 1999 11:33:29 +0100
From: "J.H.P" <jong@ebi.ac.uk>
Subject: Re: Use of uninitialized value at ...... warning with hash of hash
Message-Id: <37A17F79.36E82AF5@ebi.ac.uk>
You are right.
The actual code is as follows.
Thanks,
Jong
==================================================================
my($each_sub, %out_subs, %left_out, $ver, $real_sub_entry_found,
%final_out_subs, %out_subs, $separate_hash_entry_opt, $long_subname,
@final_separate_entry_out);
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Parsing input files of perl programs
#_____________________________________________
my ($sub_name, $title_found);
my @lib = @$lines;
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~``
# This for loop does not allow return until each sub is finished
#_____________________________________________________________________
for ($j=0; $j < @lib; $j++) {
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
# Reading the first delimiter line and 'Title' line altogether
#_______________________________________________________________
if ($lib[$j]=~/^\#[\-_]{50,}/ ) {
next;
} elsif ( $lib[$j]=~/^(\#+ *title *: *([\w\-\.]+))/i ) {
$long_subname=$1; $sub_name=$2; $title_found=1;
if ($sub_name=~/\.pl$/) {
next;
} ## to avoid the very first headbox
$out_subs{"$sub_name"}{'title'}="$sub_name";
> > $hash{first}{second}='xxxx';
> >
> > I 'my' %hash in the subroutine.
>
> You must be doing something else than what you're showing.
> You'll have to show the newsgroup 10-15 lines of code which
> illustrate your problem. Because just saying:
>
> #!/usr/bin/perl -w
>
> my %hash;
> $hash{first}{second}='xxxx';
> print $hash{first}{second};
>
> doesn't produce your warning. It prints this:
>
> xxxx
>
> just like you would want. So you're doing something else
> which you're not showing us, and *that* is causing the
> problem. You may be reading in text from another source,
> and not checking that it is defined. But I can't tell.
> My PSI::ESP module is on the fritz again.
>
> HTH,
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
-- Jong Park : a Biology student -- Tel work: +44 1223 49-4613
BioPerl Conference with ISMB 99 in Heidelberg ==>
http://bio.perl.org/bioperl-99/
------------------------------
Date: Fri, 30 Jul 1999 10:35:20 GMT
From: marcza@my-deja.com
Subject: Why is this regexp not working ?
Message-Id: <7nrv57$6m7$1@nnrp1.deja.com>
Assume the following:
$currline = "Date: 23.05.1999";
if ($currline =~ /([ \w]{1,20})$/) {
print "matched\n"; }
Surprisingly currline IS MATCHED. Why ?
I mentioned "$" at the end of the regexp. That means from my point
of view that the last character of currline must be
a word char (\w = [a-zA-Z_]) or a space.
BUT: The last char is a digit. So the reg exp shouldn't match. But it
does.
Any help is appreciated.
Bye
Marcus
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 30 Jul 1999 12:23:52 +0200
From: Willibald Woerlinger <w-woerlinger@ti.com>
Subject: Win32::OLE or something else ???
Message-Id: <37A17D38.5D251A31@ti.com>
Hallo,
I'm writing a program that allows me to let's say 'remote control'
a web browser (I used InternetExplorer 50) with a macro-editor
created procedure.
To be able to continue accessing the browser, I need to know when
the browser has finished loading the current page or applet.
But so far I haven't found any way of how to get this information
automatically:
I tried
a) Win32::OLE, but this only gives back ProgramName,program-path,
window-size, window-position,...
But it doesn't return infos on LocationURL,LocationName,Busy, ..
b) NT Resourcekit programs like pstat.exe, pmon.exe
but I found no way to automtically interpet this informations.
Maybe there's any other perl module to accomplish this task or any
other means as longas it runs without interaction.
I'm running AS Perl 5.16 on NT 4.0 SP3 machine.
Any help would be appreciated !!!
Thank You,
Willi,
w-woerlinger@ti.com
------------------------------
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 309
*************************************