[10455] in Perl-Users-Digest
Perl-Users Digest, Issue: 4047 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 22 16:04:53 1998
Date: Thu, 22 Oct 98 13:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 22 Oct 1998 Volume: 8 Number: 4047
Today's topics:
+= operator produces error, = operator doesn't? (Sean McAfee)
Re: += operator produces error, = operator doesn't? (David Alan Black)
Re: about ssi and <img src... (Daniel Beckham)
Accessing Win NT performance counters <alext@cri-boi.nospam.com>
Re: applying perlipc ? <rootbeer@teleport.com>
Re: automatic garbage collection and memory leak DISAPP <gulriz@cs.uchicago.edu>
Re: Build DBD-Oracle-0.54 on Windows NT (John D Groenveld)
Re: Counting URLs (bill davidsen)
Re: FILEHANDLE <tupshin@tupshin.com>
Re: help shorten one-liner <uri@fastengines.com>
Re: Help with Perl5.005 lsrobert@my-dejanews.com
Re: How do i send attachment of an Excel spreadsheet? (Randy Kobes)
Re: Need Help With Win95 Perl Installation (Randy Kobes)
Re: Newbie needs help transposing two words in a file (Andrew M. Langmead)
Re: Perl & Y2K - booby trap code <rootbeer@teleport.com>
Re: Perl & Y2K - booby trap code <upsetter@shell.ziplink.net>
Re: Perl & Y2K - booby trap code (Abigail)
Re: Perl Book on-line Re: Perl Cookbook - is thi <crism@oreilly.com>
Re: Perl Cookbook - is this the best perl book? (Chris Nandor)
Re: Problem with perl scripts... (Daniel Beckham)
Repost from Data toiday@my-dejanews.com
Re: Repost from Data <tupshin@tupshin.com>
Sockets under Win95 <darren.keverne@tiuk.ti.com>
Re: sort <d-edwards@nospam.uchicago.edu>
Re: sybperl error trapping (Bill Middleton)
Re: Testing a date droby@copyright.com
Re: Updating Record Structures? <tupshin@tupshin.com>
Re: What's the "best" way to call one Perl script from (Daniel Beckham)
Why Flushing Buffer works For HTTP but NOT HTTPS? nkaiser@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 22 Oct 1998 18:54:53 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: += operator produces error, = operator doesn't?
Message-Id: <1cLX1.3081$fS.9665067@news.itd.umich.edu>
> perl -e 'print $n += 5'
syntax error at -e line 1, near "+="
Execution of -e aborted due to compilation errors.
> perl -e 'print $n = 5'
5
What the..? I checked perlop and didn't see that += and = have any sort of
differing semantics.
> perl -v
This is perl, version 5.005_02 built for sun4-solaris
[etc]
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: 22 Oct 1998 15:54:16 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: += operator produces error, = operator doesn't?
Message-Id: <70o2h8$oen$1@pilot.njin.net>
Hello -
mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
>> perl -e 'print $n += 5'
>syntax error at -e line 1, near "+="
>Execution of -e aborted due to compilation errors.
>> perl -e 'print $n = 5'
>5
And - just to thicken the plot -
orpheus:~$ perl -e 'print $n+= 5'
5
orpheus:~$ perl -e 'print +$n += 5'
5
David Black
dblack@pilot.njin.net
------------------------------
Date: Thu, 22 Oct 1998 14:51:21 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: about ssi and <img src...
Message-Id: <MPG.109948b7cfef14fe9896a3@news.supernews.com>
Ok, this really doesn't have anything to do with perl, but... if you are
using SSI, then the web server is parsing out the SSI tags and replacing
them with the proper information before ever sending the html file to the
browser. The webserver and the browser _then_ handle the exchange of
text, images, etc. Specifically, the browsers sees a link to a gif file
in the src attribute and then asks the webserver to return the gif file
and the webserver seeing that the gif file is an image, it returns the
proper http headers and then the binary image data.
If you are using a cgi script as in the second example, then the browser
has already gotten the text, images, etc. and it's expecting a file where
the src attribute is. Since the webserver sees the *.pl file as an
executable script, it will let the script take over and handle what
information is sent. It's now up to you and your script to properly send
the http headers and binary image data.
n.b. "Content-type: image/jpeg\n\n" would be valid for a *.jpg file, but
there are probably some other headers that have to be sent also such as
the size of the image, etc. You will need to take a look at the proper
RFC for the correct way to do this.
Hope that was more helpful than confusing.
Any out there want to correct my errors?
Daniel
In article <70ms9u$l65$1@camel15.mindspring.com>,
keithlol@nospammindspring.com says...
> Guess I'll start simple, then get more complicated..lol
> Ok, I have written a script (pl), that does various things
> counter/e-mail response/ logging etc.
> I start this script with the SSI:
> <!--#exec cgi="cgi-bin/whatever.pl"-->
> What is returned to the html file in place is:
>
> <br><b>You are visitor number:</b><br>
> <img src="http://myurl.com/logs/graphics/2.gif" align="center">
> <br><b>Thank you!</b><br>
>
> Ok, works great, but let's say I go this route and instead of the SSI, I
> use:
> <img src="http://myurl.com/cgi-bin/logger.pl?/index.html">
>
> I grab the $ENV{'QUERY_STRING'}, telling me which file I'm dealing with
> (index.html). Then, I return:
>
> <br><b>You are visitor number:</b><br>
> <img src="http://myurl.com/logs/graphics/2.gif" align="center">
> <br><b>Thank you!</b><br>
>
> Ok... I get a broken image, cause NO bitmap is returned.. I still return
> text/html.. which is what I want to do.
>
> My question is this.. Is there anyway to return content=text/html using the
> <img src.. tag?
>
> Or, is there a method I can use to return content text/html, using a method
> other than the SSI?
>
> Sorry.. started complicated.. stayed that way.. Thanks in Advance!!
> Keith M.
>
>
>
>
>
>
------------------------------
Date: Thu, 22 Oct 1998 12:21:40 -0600
From: Alex Tatistcheff <alext@cri-boi.nospam.com>
Subject: Accessing Win NT performance counters
Message-Id: <362F77B4.E2FAB361@cri-boi.nospam.com>
I'm looking for a perl module or library that will allow me to access
the Windows NT performance counters from perl. I need to montor CPU
usage and other counters from a Perl script.
--
Alex Tatistcheff
CRI/The Resource Group, Inc.
Boise, ID
Please remove "nospam" from my email when replying
------------------------------
Date: Thu, 22 Oct 1998 19:24:57 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: applying perlipc ?
Message-Id: <Pine.GSO.4.02A.9810221221550.5534-100000@user2.teleport.com>
On Thu, 22 Oct 1998, Phil R Lawrence wrote:
> In the first excerpt, I am told all I can do is "set a global variable
> and then raise an exception." But in the next excerpt I am told I can
> put off the processing of the signal using 'IGNORE'. What is
> 'IGNORE'? Just a string, or something special to Perl?
That tells Perl to tell your system that that signal is to be ignored by
your process. See your system's docs (or any good book on Unix) to learn
what system calls are happening behind the scenes, and what it means for a
signal to be ignored.
Is that what you needed? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 22 Oct 1998 18:17:10 GMT
From: Gulriz Aytekin Kurban <gulriz@cs.uchicago.edu>
Subject: Re: automatic garbage collection and memory leak DISAPPEARED
Message-Id: <lj67dc1mxl.fsf_-_@gargoyle.cs.uchicago.edu>
Well,
I'm learning Perl from the book by Larry Wall, etc. (O'Reilly). I
could not find any information on how the garbage collection is done
except the following on page 299.
A Note on Garbage Collection
High-level languages ... For most purposes, Perl uses a fast and
simple, reference-based garbage collection system. One serious
problem is that unreachable memory with a non-zero reference count
will normally not get freed.
...
When the block is exited, its "my" variable are normally freed up...
By chance, I got rid of the memory leak. I was using a particular
class where I encapsulated how to process the input files. When, the
format of the input files was simplified, I discarded the
class. Then, the memory leak dissappared.
This tells me that Perl does reclaim storage for objects, and other "my"
variables. However, what this particular class had, and others did not,
was the saving of the file handles inside the objects by the following
simple set of statements:
sub open{...open(FILE, $name); $self->{handle} = \*FILE; ...}
sub close{ ... close($self->{handle})}
This is probably not the right thing to do in Perl, I wanted to write
the code quickly. Using FileHandle class did not help either. I guess
this could be considered a bug. I suspect that Perl 5.002(which I have
currently) can't reclaim the storage used by FILE because of \*FILE
is stored in an object, after the object itself is destroyed. And,
I'm opening hundreds of files, thousands of times to search.
Does any one know how many bytes a file handle takes up?
Gulriz
------------------------------
Date: 22 Oct 1998 14:47:21 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Build DBD-Oracle-0.54 on Windows NT
Message-Id: <70nujp$d68$1@tholian.cse.psu.edu>
After reading DBD-Oracle-0.54/README.win32 I was able to install it
with Perl5.004_04 and VC++ 5.0.
John
groenveld@acm.org
------------------------------
Date: 22 Oct 1998 19:53:57 GMT
From: davidsen@tmr.com (bill davidsen)
Subject: Re: Counting URLs
Message-Id: <70o2gl$27oa$1@newssvr03-int.news.prodigy.com>
Although edited out, my original post noted that write only solutions
were not useful to the folks who would be maintaining the program. This
solution is not likely to be obvious to anyone, it certainly isn't to
me. Entertaining, collectable, but not something I would use in
production.
Did the people who originally said perl was a fad and doing it in C with
regexp was the right way to go put you up to this? They are certainly
happy to see this!
In article <70g9v2$muq$3@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
| bill davidsen (davidsen@tmr.com) wrote on MDCCCLXXII September MCMXCIII
| in <URL:news:707oll$12qu$1@newssvr03-int.news.prodigy.com>:
| ++ I want to count URLs in a (long) string. I thought that the easy way
| ++ would be to use the split() function and look at the return count, but
| ++ that doesn't quite do what I want. I'm doing:
| ++ $N_URL = split(m#\W(http|news|mail|ftp)://\S*#o);
|
|
| # Assume $string contains the long string.
| my $count = 0;
| $count ++ while $string =~ m#
| (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
| )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)
| ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F
| \d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
| 2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.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a][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1-
| 9]\d*)))?)|(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~
| :@/])+)(?:(?:;[Uu][Ii][Dd][Vv][Aa][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1-9]\d*
| )))?(?:/;[Uu][Ii][Dd]=(?:[1-9]\d*))(?:(?:/;[Ss][Ee][Cc][Tt][Ii][Oo][Nn
| ]=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~:@/])+)))?))
| )?)|(?:nfs:(?:(?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-
| Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:
| \.(?:\d+)){3}))(?::(?:\d+))?)(?:(?:/(?:(?:(?:(?:(?:[a-zA-Z\d\$\-_.!~*'
| (),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(),
| ])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d
| \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\
| -_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA-
| Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d
| \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))#gx;
|
|
|
|
| Abigail
| --
| perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
------------------------------
Date: 22 Oct 1998 12:50:16 PDT
From: "Tupshin Harper" <tupshin@tupshin.com>
Subject: Re: FILEHANDLE
Message-Id: <newscache$s3v81f$x7a@debian>
Plenty of different ways to do what you want...since you're already using
IO::File, I'll just address the problems with your attempt to use it:
When you create $HANDLE_AOL, etc, you are creating variables referencing
anonymous filehandles. The syntax you use to put them in @proced_files
looks as though you think that your variables actually are raw filehandles,
but they are indirect filehandles that don't need the *$HANDLE syntax in
order to put them in the array. Simply changing the array assignment line
to:
$proced_files=($HANDLE_AOL, $HANDLE_MSIE, $HANDLE_NETSCAPE);
should fix that problem.
Then the problem is having your subroutine get what you pass it properly.
One way is
sub process_out
{
local *FILEHANDLE = shift
...
do_stuff with *FILEHANDLE;
...
}
-Tupshin Harper
-Programmer/Network Administrator
-Studio Verso
nguyen.van@imvi.bls.com wrote in message
<70nn1k$561$1@nnrp1.dejanews.com>...
>Hi guys,
>
>I have problem with filehandles. I have 3 files and want to open 3
FILEHANDLES
>for reading and writing. I also want to pass these FILEHANDLEs one at a
time
>to a subroutine which will process one line at a time for each FILEDANDLE.
>Please give me a general format. Thanks a lot for your help. The following
is
>my code:
>
>___________________________________________________________________________
____
>
>use IO::File;
>$HANDLE_AOL = new IO::File "+<aol_out";
>$HANDLE_MSIE = new IO::File "+<msie_out";
>$HANDLE_NETSCAPE = new IO::File "+<netscape_out";
>@proced_files = ( "\*$HANDLE_AOL", "\*$HANDLE_MSIE",
"\*$HANDLE_NETSCAPE" );
>
>foreach $out_file ( @proced_files )
>{
> process_out($out_file);
>}
>
>sub process_out
>{
> while (<$out_file>)
> {
> $_ =~ s#(AOL|MSIE)\s(\d\.\d+)#$1_$2#g;
> print STDOUT;
> }
>}
>
>You can modify my code or give me a general format.
>
>Van Nguyen
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Oct 1998 14:52:52 -0400
From: Uri Guttman <uri@fastengines.com>
Subject: Re: help shorten one-liner
Message-Id: <sarzpaol98b.fsf@camel.fastserv.com>
>>>>> "JS" == John Stanley <stanley@skyking.OCE.ORST.EDU> writes:
JS> In article <saru30zlyfz.fsf@camel.fastserv.com>, Uri Guttman
JS> <uri@camel.fastserv.com> wrote:
>> oy gevalt!! that is as old as ronald reagan! and about as useful!
JS> In other words, yes, perl 4 is very useful. Wait a minute, I'm not
JS> sure that the data collection systems aren't still running perl 3.
JS> Did you really need to take a pot shot at someone who has
JS> Alzheimers?
retrodate it back a few years. hell, i don't even know when he didn't
have that disease. :-)
>> get the latest perl and drop that 4.x fast.
JS> Some people like spending time upgrading software. Some people
JS> realize that if it works it doesn't need to be upgraded.
but he asked about END{} and other perl5 features and why they didn't
work. and he is getting info about perl now (blue camel, etc) which all
refer to perl5 features, so telling him to upgrade is the right thing to
do. and i have no problem if you have running perl4 scripts. they can
probably run under perl5 with little or no change and run faster. but
writing new perl4 scripts is a losing proposition IMO. i did lots of
perl4 and was very thankful that perl5 came along and added the major
improvements which i needed. having 2 versions around would be an extra
burden i (and many others) wouldn't want to deal with.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Thu, 22 Oct 1998 18:58:38 GMT
From: lsrobert@my-dejanews.com
Subject: Re: Help with Perl5.005
Message-Id: <70nv8u$e5f$1@nnrp1.dejanews.com>
Chad,
Perl is an interpreted language. The interpreter reads the source, also known
as a "script", and executes it.
To run a script you can type "perl script.pl" where script.pl is the name of
your perl scipt. On UNIX you can run the script directly by adding
"#!/bin/perl" to the top of your script.
I would recommend you buy "Programming Perl" from O'Reilly & Assoc.
-lsr
In article <362E63C3.B902E0B@anlon.com>,
Chad Moston <chad@anlon.com> wrote:
> I am generally new to the Perl 'business'. I just
> downloaded Perl 5.005 and installed it on my
> computer. What I am looking for is the compiler.
> This should create an .exe file for me and I
> should be able to run this .exe file on any
> computer, whether it has Perl installed on it or
> not.
>
> Does anybody know what the compiler is called and
> how do I use it?
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Oct 1998 17:59:31 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: How do i send attachment of an Excel spreadsheet?
Message-Id: <slrn72ut4f.a8u.randy@theory.uwinnipeg.ca>
On Thu, 22 Oct 1998 17:35:03 GMT,
nawani@my-dejanews.com <nawani@my-dejanews.com> wrote:
>
> Being a rather new user to Perl, i am trying to send a Excel spreadsheet
>to be sent as an attachment with the email.
[snip]
Hi,
Sounds like you'd be interested in the MIME-tools distribution,
available under
http://www.perl.com/CPAN/authors/id/ERYQ/
There's a number of example scripts included that illustrate
the basic use.
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: 22 Oct 1998 17:50:16 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Need Help With Win95 Perl Installation
Message-Id: <slrn72usj4.a8u.randy@theory.uwinnipeg.ca>
On Thu, 22 Oct 1998 16:24:40 GMT, Mike Watkins <mwatkins@ia-watkins.com> wrote:
>Hi there,
>
>OK, I'm very sorry, but I am new at this. I just downloaded perl and
>I'm not sure if I have a C Complier. I don't think I do, so I
>probably don't.
>
>Anyway, I read the help file and it said to download a GCC Compiler.
>Anyone know where I can download one?
>
Hi,
You didn't say which perl you got, or even if it's a binary
or source distribution. If it's the source, you need a C compiler,
but on Windows 95 gcc (from cygwin) doesn't work without some
fixing. Either Microsoft's Visual C++ or Borland's C compiler
would be better supported in this regard.
It sounds like though you'd be better off starting with a
binary distribution - go to
http://www.perl.com/CPAN/ports/
and look at the Win95 section. There you have two binary ports
to choose from; installation is very straightforward for either
(see the README files). Without a C compiler you won't be able to
compile some external modules that need it, but this'll get you
started for now. Good luck.
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Thu, 22 Oct 1998 18:22:57 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Newbie needs help transposing two words in a file
Message-Id: <F18r29.31H@world.std.com>
Ala Qumsieh <aqumsieh@matrox.com> writes:
>On Tue, 20 Oct 1998, Andrew M. Langmead wrote:
> > Which just proves Larry's original point, doesn't it.
>Isn't this precisely what I stated above? Actually, the very next line
>(which you deleted for some reason) says:
Lets go over this in order.
1. You have been posting code with errors in them.
2. Larry keeps correcting you.
3. In this thread post yet another piece of incorrect code.
4. Larry corrects you again and suggests you test assertions before
you post them. He also tells you your e-mail address is incorrect.
5. You say your e-mail address is fine.
6. You say your e-mail address was wrong after all.
So with this series of events, I decided to point out that Larry was
right, you don't test your assertions before you post them. The
incorrect code and the stuff about the e-mail address are just
different examples of the same underlying problem.
--
Andrew Langmead
------------------------------
Date: Thu, 22 Oct 1998 19:28:58 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <Pine.GSO.4.02A.9810221228100.5534-100000@user2.teleport.com>
On Thu, 22 Oct 1998, Scratchie wrote:
> It's not very practical for me to take a break from my regular work
> and check "all tokens" in all of my code to make sure they're handled
> correctly.
Really? That IS the regular work of most good programmers. (Of course,
maybe you're not a programmer, or not a good one. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 22 Oct 1998 15:38:15 -0400
From: Scratchie <upsetter@shell.ziplink.net>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <Pine.BSF.3.96.981022153521.2627C-100000@shell.ziplink.net>
On Thu, 22 Oct 1998, Tom Phoenix wrote:
> On Thu, 22 Oct 1998, Scratchie wrote:
>
> > It's not very practical for me to take a break from my regular work
> > and check "all tokens" in all of my code to make sure they're handled
> > correctly.
>
> Really? That IS the regular work of most good programmers. (Of course,
> maybe you're not a programmer, or not a good one. :-)
Apparently you misunderstood me. I was referring to going back and
reviewing already-completed code that's in production. I don't know many
(any?) programmers with the time to go back into completed projects and
check every token.
Reviewing completed projects for the proper use of "localtime", on the
other hand, would not seem impossible or unwarranted, especially if one is
maintaining code that one did not write personally.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 22 Oct 1998 19:44:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <70o1uu$3lr$1@client3.news.psi.net>
Bart Lateur (bart.mediamind@ping.be) wrote on MDCCCLXXVIII September
MCMXCIII in <URL:news:362f6046.2545773@news.ping.be>:
++ Abigail wrote:
++
++ >++ I see nothing wrong with year-1900. To get the proper year, just always
++ >++ add 1900. Not even a problem when comparing dates, unless you go back
++ >++ before 1900.
++ >
++ >There isn't any problem having localtime return numbers in base 17. Or the
++ >number of years since 1666 squared, minus 1024.
++ >
++ >It doesn't make it easy for the programmer though.
++
++ I agree with Abigail.
++
++ However, I think it's too late to fix it now. Backward compatibility,
++ you know.
I don't think anyone is suggesting to fix it now.
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
------------------------------
Date: 22 Oct 1998 10:01:31 -0400
From: Chris Maden <crism@oreilly.com>
Subject: Re: Perl Book on-line Re: Perl Cookbook - is this the best perl book?
Message-Id: <ke1zo04rwk.fsf@rosetta.ora.com>
Darius Jack <dariusz@usa.net> writes:
> Any chance to read this book or any other on-line.
> Give www address if avaliable.
The Perl Cookbook isn't currently on-line. So far, the only Perl book
available on-line in its entirety is _Programming Perl_, which can be
found in _Webmaster in a Nutshell Deluxe Edition_, five books on
CD-ROM. The purchase includes a subscription to the Web site at
<URL:http://online-books.oreilly.com/>, which contains the most recent
edition (give or take a few months when I'm swamped).
Given the number of Perl books we've published, it wouldn't surprise
me if we did a Perl CD-ROM, but I don't make those decisions. I'm
JA[SXHTPD]H.[1] It'd be easier if more of you wrote in SGML or XML
instead of POD. (-:
ObPerl: The on-line books produced before this year were converted
with gmat, Norm Walsh's Perl SGML processor.
-Chris
[1] SGML, X[MSL]L, HTML, TeX, Perl, DSSSL.
--
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>
------------------------------
Date: Thu, 22 Oct 1998 14:21:50 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <pudge-2210981421500001@192.168.0.77>
In article <70njqh$9s5@ohnasn01.houston.omnes.net>, pmj@hotmail.com (PM
Jenkins) wrote:
# unbearable, but their 350+ errors that can be printed
Liar.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Thu, 22 Oct 1998 14:31:57 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: Problem with perl scripts...
Message-Id: <MPG.10994425e5a4b27b9896a1@news.supernews.com>
Bzzzt! Wrong. Anytime you send data to the browser you need to send a
content header. Try it without sending one... your SSI will die and
you're apache log will show a "Premature end of script headers:" error.
In article <70lmdd$5v6$1@newnews.global.net.uk>, minich@globalnet.co.uk
says...
> >You really should read the cgi spec, the perl faq's and other docs. You
> >need to send a content header first.
> >
> >print "Content-type: text/html\n\n";
> >
> >then send your hello statment.
> >
> >print "Hello!\n";
>
>
> He's using a Server Side Include which means the browser already has
> the header so doesn't need the spec.
>
> Martin
>
>
>
------------------------------
Date: Thu, 22 Oct 1998 18:09:22 GMT
From: toiday@my-dejanews.com
Subject: Repost from Data
Message-Id: <70nsci$alt$1@nnrp1.dejanews.com>
I'm writing a cgi program. Because program generate a webpage that need to
update the information, I include the following:
<META HTTP-EQUIV="REFRESH" CONTENT="120">
to refresh every 2 minutes. This webpage would also do "POST". The problem
is if someone use Microsoft IE (version 4) to submit the data, after two
minutes, when it suppose to REFRESH, it would ask "Repost from Data?".
However, it work fine for Netscape. Can someone tell me what is going on
with IE? How can I fix that problem?
Thank you!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Oct 1998 12:56:06 PDT
From: "Tupshin Harper" <tupshin@tupshin.com>
Subject: Re: Repost from Data
Message-Id: <newscache$idv81f$q8a@debian>
You're problem is that that is the behavior of IE. What you're seeing is
the programmatic equivalent of clicking the Refresh button in IE on a page
that was produced by a POST form submission. There are two options that I
can think of off the top of my head:
1) Use a GET instead of a POST. Because the submitted data is just part of
the URL, IE shouldn't complain.
2) Use JavaScript to start a timer from an onLoad= statement. When the
timer hit's two minutes, do a document.form.submit().
Note that this is not a perl question. Keep any related questions out of
comp.lang.perl.*
-Tupshin Harper
-Programmer/Network Administrator
-Studio Verso
toiday@my-dejanews.com wrote in message <70nsci$alt$1@nnrp1.dejanews.com>...
>I'm writing a cgi program. Because program generate a webpage that need to
>update the information, I include the following:
>
><META HTTP-EQUIV="REFRESH" CONTENT="120">
>
>to refresh every 2 minutes. This webpage would also do "POST". The
problem
>is if someone use Microsoft IE (version 4) to submit the data, after two
>minutes, when it suppose to REFRESH, it would ask "Repost from Data?".
>However, it work fine for Netscape. Can someone tell me what is going on
>with IE? How can I fix that problem?
>
>Thank you!
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 22 Oct 1998 19:43:09 +0100
From: Darren Keverne <darren.keverne@tiuk.ti.com>
Subject: Sockets under Win95
Message-Id: <362F7CBD.86E31006@tiuk.ti.com>
All,
I have just installed ActiveState perl under Win95, and started
messing with some Socket based stuff...
I tried the client and server form the Camel book and also a server
that I already had using Grahams IO::Socket::INET...
Now, these all work fine, except the port number of both the server
side and the peer side all report being port '0', I can connect to the
port that I told the server to listen at, but the server doesn't think
it is on the specified port, but port 0...
Anybody got any ideas what's wrong, this is not really a problem, as I
should always know what port I started the thing on anyway.
Thanks,
Darren
--
=====================================================================
| Darren L Keverne AMIEE _ Email : dkeverne@ti.com |
| EDA Support _| '-. msg : DAZK |
| Broadband Access Group \, _} MS : TIL/10 |
| Texas Instruments Ltd \( Phone : +44 (1604) 663474 |
| Northampton England Fax : +44 (1604) 663456 |
=====================================================================
------------------------------
Date: Thu, 22 Oct 1998 18:07:13 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: sort
Message-Id: <tgzpaozd0u.fsf@noise.bsd.uchicago.edu>
Carl Fox <foxindustries@worldnet.att.net> writes:
> I am sorting and
> searching a flat database file field, numerically, and am having
> problems. For example: when I searcch for 50, any record with 5000,
> 500, 50, and 5 pops up. Is there any way to get an EXACT match
> instead of a greater than, less than, or equal to?
Are you using a pattern like /50*/? That will match any of the
numbers you gave, because * means "0 or more" of the preceding
expression. I would have guessed you were using something like
/50/, which will match everything above except 5. (It'll also
match "503", "8502", "50th street", etc. Do you see why?)
What's in the field? Can you maybe just use == or eq?
> None of the operators, so
> far, are returning the proper match, so please don't just refer me to
> some apparently "textbook" solution.
Well, maybe if you post some code you've tried, other folks can
help more. But it's very likely that most of their responses will
have come from _some_ "textbook" (i.e. perl documentation in general).
It's kind of like saying, "Help me talk to this Russian guy,
but don't hand me any of that stuff from those 'Russian Grammar
Books.'" :)
> Thanks,
>
> Carl Fox
Best of luck,
Darrin
------------------------------
Date: 22 Oct 1998 18:21:53 GMT
From: aawimi@ITS.mobil.telenor.no (Bill Middleton)
Subject: Re: sybperl error trapping
Message-Id: <70nt41$jqo@info.telenor.no>
[mailed and posted]
I'm assuming this one slipped by Michael...
In article <70iqfd$8n4$1@nnrp1.dejanews.com>,
<curt_sauer@my-dejanews.com> wrote:
>I am trying to determine when I loose my connection to the database using
>eval so that I can attempt to reconnect. I have been unsuccesful so far
>because although eval traps the error my entrire process disapears right
>after. Has this happened to anyone else or am I doing something very stupid?
>Any help will be greatly appreciated.
The Sybperl code (DBlib and CTlib) does contain several places
where croak() is called, including loss of the handle. Michael
seems to have commented some of the error-handling code to
work on later, but that doesn't seem to include lost handles.
Perhaps it is due to mucked-memory issues on lost handles, or
handles in an unknown state, I don't know. Maybe he'll see
this and help us to understand better. There are some other
places where error messages are printed to STDOUT which I'd like
to get changed, perhaps to a $errmsg variable or some such, to
keep errors off of httpd's STDIN.
I think it might help to see what, if any, error you are getting.
Bill
------------------------------
Date: Thu, 22 Oct 1998 18:28:15 GMT
From: droby@copyright.com
Subject: Re: Testing a date
Message-Id: <70ntfv$bnn$1@nnrp1.dejanews.com>
In article <MPG.1097bc7018b620d7989830@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
> [Posted to comp.lang.perl.misc and a copy mailed.]
>
> In article <fl_aggie-2110981219070001@aggie.coaps.fsu.edu> on Wed, 21
> Oct 1998 12:19:06 -0500, I R A Aggie <fl_aggie@thepentagon.com> says...
> > In article <362DD6C6.9AFB9465@whiterabbit.co.uk>, Matt Pryor
> > <matt@whiterabbit.co.uk> wrote:
> >
> > + if (($year/4) == int($year/4)) { # leapyear?
> >
> > Fortunately for you, the next century year is 2000, which happens
> > to be a leap year. But century years need to be divisible by 400.
> >
> > So...
> >
> > if (!($year % 400) or (!($year % 4) and ($year % 100))) {
>
> I call that the year 2.1K problem, which most of us won't have to deal
> with. :-( In any case, your suggested formula fails for most Western
> European countries before 1752 (do `cal 1752` and look at September),
> and for Russia before 1918 or so, and ...
>
I remember with great fondness my own 1984 problem. In my second sysadmin
job, and the first including a leap year I found and corrected about a dozen
little applications written by predecessors that hadn't bothered to deal with
leap years. I of course corrected them to handle centuries correctly. They
must be long gone by now. They were all Basic-Plus on RSTS.
> Fortunately for most of us, the Unix epoch doesn't include 1900 or 2100.
>
Yet. ;-) And of course there are other likely Unix time problems before 2100
anyway...
> As a confirmed pedant, I believe there really should be a limit to
> pedantry.
>
> unless ($year % 4) { # leapyear?
>
> will do just fine for me.
>
Works for me. I will be very surprised if any of my code is still running in
2100, and if they come asking me to fix it, I'll be quite incapable of doing
so anyway. I'm not going to be doing this at 148.
I'm going to be sitting in Blackburn Tavern drinking beers with Elaine.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Oct 1998 12:07:20 PDT
From: "Tupshin Harper" <tupshin@tupshin.com>
Subject: Re: Updating Record Structures?
Message-Id: <newscache$74t81f$5z9@debian>
Wouldn't an (if exists(your_record)) test work for you?
-Tupshin Harper
-Programmer/Network Administrator
-Studio Verso
Vickie Cooper wrote in message <362F4642.E0661172@boeing.com>...
>I want to read in a list of records into an array...but when that record
>already exists then update the BYTES field to add the value from the
>current record to the existing record.
>
>I created a routine to load the records:
>@url_index = ();
>sub BuildIndex
>$record =
> URL => $url,
> BYTES => $bytes,
> HITS => $RecCount++,
> };
>}
>
>Then I assign :
>
>$url_index[$record -> {URL}] = $record;
>
>Is there a way I can determine if the record already exists as I'm
>loading the array...and if so, update that record in place?
>
>Thanks,
>
>Vickie Cooper
------------------------------
Date: Thu, 22 Oct 1998 14:36:09 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: What's the "best" way to call one Perl script from another?
Message-Id: <MPG.10994524c6ccd9db9896a2@news.supernews.com>
Why not just turn those seperate scripts into functions and use the main
script to glue the functions together? If you still want to have the
functions in seperate files for re-usability, you can use the require
statement to pull the function files into the main script. I do this
quite often...
In article <70m2dm$3ks@transfer.stratus.com>, alfred@hw.stratus.com
says...
> I would have thought that this would be in the FAQ, but if it is
> I couldn't find it. I've written a bunch of Perl scripts that
> implement parts of our regression environment. Now I am writing
> a script that will automate the entire process, and find myself
> calling one Perl script from another often. So far, I've been
> using the following:
>
> $status = system("script_name param1 param2");
> die "$0: script_name failed\n" if (($status >> 8) != 0);
>
> But using system() to call another Perl script doesn't feel very
> perlish - is there a better (more elegant) way to do it?
>
> Alfred
>
------------------------------
Date: Thu, 22 Oct 1998 18:26:56 GMT
From: nkaiser@my-dejanews.com
Subject: Why Flushing Buffer works For HTTP but NOT HTTPS?
Message-Id: <70ntdf$bn1$1@nnrp1.dejanews.com>
Has anyone experienced this?: I have a CGI which I need to flush the buffers
and display some text before forking off another system call. So, I simply
set $|=1 and close STDOUT. Works perfect on apache http://. However, when I
use it with apache stronghold https:, the text waits until all forks are
complete before displaying.
Any ideas?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4047
**************************************