[11446] in Perl-Users-Digest
Perl-Users Digest, Issue: 5046 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 3 15:17:30 1999
Date: Wed, 3 Mar 99 12:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 3 Mar 1999 Volume: 8 Number: 5046
Today's topics:
Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Pos (Ilya Zakharevich)
Re: A smiple question (brian d foy)
Re: A smiple question <jeromeo@atrieva.com>
Re: A smiple question (brian d foy)
can I make this code better? (Alan Young)
date (week number) (Cim)
Re: help on APPLET Class (brian d foy)
Re: IO::Socket and udp - exits immediately <droby@copyright.com>
Re: Pentium III Chips Released with IDs - Intel won't b (paul milligan)
Re: Pentium III Chips Released with IDs - Intel won't b (Jochem Huhmann)
Re: Pentium III Chips Released with IDs - Intel won't b (paul milligan)
Re: Pentium III Chips Released with IDs - Intel won't b <jeromeo@atrieva.com>
perl header woes--stdsyms.ph tljohn4@uswest.com
Q: File::copy behaviour <aengus.stewart@icrf.icnet.uk>
Re: Question on NET::POP3 (Dimitri Ostapenko)
Re: sysopen and NT (Monte Westlund)
Re: The millennium cometh -- eventually evanjohn@my-dejanews.com
Re: The millennium cometh -- eventually (brian d foy)
Re: The truth about the Pentium III chip and ID --- **b <gorman@sportsline.com>
Re: Tied hashes and locking (Andrew M. Langmead)
Re: URGENT! Where Do You Hide The CGI Cards From The Sp mike808@mo.net
Re: URGENT! Where Do You Hide The CGI Cards From The Sp (Andrew M. Langmead)
Re: Using Perl to resize image? (brian d foy)
warning: undefined filehandle diag check? (+jeff)
Where is Randal's "HTML to CGI.pm" converter?? (Jete Software Inc.)
Re: Win32::Registry doesn't work??? (Mark Leighton Fisher)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Mar 1999 18:03:32 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
Message-Id: <7bjthk$fsk$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Philip Newton
<Philip.Newton@datenrevision.de>],
who wrote in article <36DD5534.3CCBA728@datenrevision.de>:
> > Is anyone working on an Abigail FAQ ?
>
> I'm waiting for the entry that will answer "What is her last name?".
Why "her"?
Ilya
------------------------------
Date: Wed, 03 Mar 1999 13:39:26 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: A smiple question
Message-Id: <comdog-ya02408000R0303991339260001@news.panix.com>
Ronald J Kimball wrote:
[original citation wasn't included in previous message.]
> > if $foo !~ /\d+/; # If $foo is not all digits, all the time.
> /^\d+$/
this one allows for a trailing newline, which might be important
(or fatal) in some applications.
> /\D/
this one doesn't.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 03 Mar 1999 11:29:05 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: A smiple question
Message-Id: <36DD8D81.D272E0C5@atrieva.com>
brian d foy wrote:
> > /^\d+$/
>
> this one allows for a trailing newline, which might be important
> (or fatal) in some applications.
I was thinking about trailing and leading white space. Then I figured
that the set of expressions that can match just digits probably
approaches infinity. ;->
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Wed, 03 Mar 1999 15:04:17 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: A smiple question
Message-Id: <comdog-ya02408000R0303991504170001@news.panix.com>
In article <36DD8D81.D272E0C5@atrieva.com>, Jerome O'Neil <jeromeo@atrieva.com> posted:
> brian d foy wrote:
>
> > > /^\d+$/
> >
> > this one allows for a trailing newline, which might be important
> > (or fatal) in some applications.
>
> I was thinking about trailing and leading white space. Then I figured
> that the set of expressions that can match just digits probably
> approaches infinity. ;->
well, it approaches one of the infinities.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 03 Mar 1999 19:38:23 GMT
From: alany@2021.com (Alan Young)
Subject: can I make this code better?
Message-Id: <36de8e1d.58840722@news.supernews.com>
I'm sure there is a way to make this code shorter and more efficient,
but I can't figure out how.
Basically, I have a list of chosen items (shopping cart) and a list of
avialable items (inventory). All I have in the list of chosen items
is the item code and the quantity of items to purchase in item|qty
format and I want to display a short description for each item
(viewing the cart). This does what I want, I'm just curious and
wanting to improve my perl skills. Thanks for any help.
----Begin Code----
#!/u/alany/bin/perl
@line = ("123|1", "456|2", "012|3", "666|7");
# inventory contains 123|hello, 456|cruel, 789|world, 012|goodbye
# the comma actually being a newline
open 'fh', "<inventory";
#################################################################
# This is the part that I think I should be able to compress.
$i = 0;
foreach $l (@line) {
$l =~ /^([\w\d]+)\|/;
$item = $1;
seek fh, 0, 0;
while (<fh>) {
last if /^$item\|/;
}
if (!$_) {
@items[$i++] = "$item does not exist in inventory";
} else {
@items[$i++] = $_;
}
}
#################################################################
print @items;
print "\n";
----End Code----
--
Alan Young Technical Support
http://members.xoom.com/AlanYoung 2021.Interactive, LLC
If your happy and you know it, clunk your chains! http://www.2021.com
815 He who foresees calamities suffers them twice over.
------------------------------
Date: Wed, 03 Mar 1999 19:37:26 GMT
From: cim@online.ee (Cim)
Subject: date (week number)
Message-Id: <36dd8d2d.1854504@news.online.ee>
I need to get current week's number (week 9 currently). It can be from
the beginning of current year or from EPOCH. I have a separate data
for each week and i need to display that data according to current
week, next week and the one after that.
Any ideas. Can localtime alone and/or special math help me. Any
modules that could do it.
thanks.
------------------------------
Date: Wed, 03 Mar 1999 13:13:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: help on APPLET Class
Message-Id: <comdog-ya02408000R0303991313080001@news.panix.com>
In article <36DCE1C9.CF5E3E51@bommerang.aero.rmit.edu.au>, lql <liu@bommerang.aero.rmit.edu.au> posted:
> I am a now stuying the Javascript. But I just don't understand what
> does the ***.class mean, and how it could be produced. If someone could
> be
Javascript is not Java. neither of those are Perl. perhaps you
are playing with JPL though?
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 03 Mar 1999 17:54:14 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: IO::Socket and udp - exits immediately
Message-Id: <7bjt00$ehe$1@nnrp1.dejanews.com>
In article <36DC6AC4.1D518323@ncf.ca>,
ac256@ncf.ca wrote:
>
> Most documentation (and news postings too) seem to amount to
> "It's similar for udp". I cannot seem to find useful help
> for how to work with udp for client server communication.
>
Help for udp is indeed a bit more sparse than for tcp. But there is a good
example in perlipc, demonstrating a time client that requests time from
multiple servers and waits for the responses with a timeout.
This example doesn't use the IO::Socket interface, but it's a good demo of how
to do this stuff using the main Socket module.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 03 Mar 1999 11:10:09 PST
From: pjm@see_my_sig_for_address.com (paul milligan)
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <36e08964.75304572@news.concentric.net>
redsky@ibm.net (Thane Hubbell) pondered briefly, and wrote:
{ post list allowed, because this aspect does relate across
platforms / groups, IMO }
>> content in the development of web and e-business apps. What the
>> CPU ID allows is the identification of particular customers as
>> suckers who will not get a very good price offer, and of others
>> as smart shoppers who must be given competitive pricing
And the first respsone of the market will be access sites that
get around that. Non-issue, even if there weren't other objections on
the supplier side..
>I mentioned in a earlier message that I wrote a copy protection scheme
>for my software based on BIOS data and machine type. This was a
>FIASCO from day one, as users would change machines, upgrade machines
>etc. Trying to ID a PERSON from a CPU ID is nuts. The best you can
>do is ID the CPU. This will be a good thing for software licenses -
>to an individual CPU. I see this coming, actually, from MicroSoft.
>Buy Windows 98/2000 and install it on "THIS" CPU - but no other.
Certainly do-able, and likely to happen ( not just Windows,
but all platforms / languages ).
>Great for software sales. But as a method to ID a particular
>consumer? Not a chance.
Do you license a person or a copy ( therefore one machine ) ?
Personally, I license per copy, not per person. You want to run it on
another machine, you buy another ( discounted ) license.
Paul
>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~
pjm@(remove this part )pobox.com
My WWW site is at http://www.pobox.com/~pjm, featuring free HVAC software.
The Sci.Engr.Heat-Vent-AC and Alt.HVAC FAQ is at http://www.elitesoft.com/web/sci.hvac/
------------------------------
Date: 3 Mar 1999 19:57:04 GMT
From: joh@gmx.net (Jochem Huhmann)
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <7bk46g$1mh$4@nova.revier.com>
In article <Jl0PnHJ5PvPd-pn2-KwvJTdwEhfpR@dwight_miller.iix.com>,
redsky@ibm.net (Thane Hubbell) writes:
TH> On Tue, 2 Mar 1999 17:26:15, Al Christians <achrist@easystreet.com>
TH> wrote:
TH>
>> I'm afraid that the really big (money) issue wrt CPU ID's is one
>> that no one has noticed much yet. It has to do with electronic
>> commerce apps. The application development opportunities here
>> are endless. There is already a great deal of work on custom
>> content in the development of web and e-business apps. What the
>> CPU ID allows is the identification of particular customers as
>> suckers who will not get a very good price offer, and of others
>> as smart shoppers who must be given competitive pricing
TH>
TH> I mentioned in a earlier message that I wrote a copy protection scheme
TH> for my software based on BIOS data and machine type. This was a
TH> FIASCO from day one, as users would change machines, upgrade machines
TH> etc. Trying to ID a PERSON from a CPU ID is nuts. The best you can
TH> do is ID the CPU. This will be a good thing for software licenses -
TH> to an individual CPU. I see this coming, actually, from MicroSoft.
TH> Buy Windows 98/2000 and install it on "THIS" CPU - but no other.
TH> Great for software sales. But as a method to ID a particular
TH> consumer? Not a chance.
Who cares about software that requires licences? And how is this
related to comp.lang.tcl?
BTW: Every ethernet card on this planet has an unique ID. Since
ages. That's very useful and nobody has crossposted in this regard
over 10 newsgroup all the time.
--
# Jochem Huhmann <joh@gmx.net> Duisburg (Germany)
When the revolution comes, I will be shot by both sides.
------------------------------
Date: 03 Mar 1999 11:50:05 PST
From: pjm@see_my_sig_for_address.com (paul milligan)
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <36dd9279.77629887@news.concentric.net>
joh@gmx.net (Jochem Huhmann) pondered briefly, and wrote:
>Who cares about software that requires licences?
All users, and most programmers ( any who ever wrote something
worth selling )
>And how is this
>related to comp.lang.tcl?
As above.
>BTW: Every ethernet card on this planet has an unique ID. Since
>ages. That's very useful and nobody has crossposted in this regard
>over 10 newsgroup all the time.
You haven't even bothered reading the thread. It's been
mentioned repeatedly, in multiple contexts.
Paul
>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~>~~
pjm@(remove this part )pobox.com
My WWW site is at http://www.pobox.com/~pjm, featuring free HVAC software.
The Sci.Engr.Heat-Vent-AC and Alt.HVAC FAQ is at http://www.elitesoft.com/web/sci.hvac/
------------------------------
Date: Wed, 03 Mar 1999 11:34:47 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <36DD8ED7.2873FE08@atrieva.com>
paul milligan wrote:
> Do you license a person or a copy ( therefore one machine ) ?
> Personally, I license per copy, not per person. You want to run it on
> another machine, you buy another ( discounted ) license.
I have about 40 people running the same software on one machine. How
does your license fit that model, and how does a PSN identify an
individual user?
Per-seat licensing is a pretty standard model.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Wed, 03 Mar 1999 18:52:32 GMT
From: tljohn4@uswest.com
Subject: perl header woes--stdsyms.ph
Message-Id: <7bk0da$hoa$1@nnrp1.dejanews.com>
Anyone here know what all this means? If I use the old stdsyms.ph
from the previous perl build everything seems to work fine, but am
questioning my decision to use it.
"shm.pl" 9 lines, 106 characters
#!/bin/perl -w
use strict;
require "sys/ipc.ph";
for (@INC) {
print "$_\n";
}
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"shm.pl" 8 lines, 84 characters
$ shm.pl
Bareword found where operator expected at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 146,
near """_FILE_OFFSET_BITS"
(Missing operator before _FILE_OFFSET_BITS?)
Bareword found where operator expected at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 155,
near """_FILE_OFFSET_BITS"
(Missing operator before _FILE_OFFSET_BITS?)
Unquoted string "number" may clash with future reserved word at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 155.
Bareword found where operator expected at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 169,
near """Large"
(Missing operator before Large?)
Unquoted string "mode" may clash with future reserved word at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 169.
Bareword found where operator expected at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 173,
near """Large"
(Missing operator before Large?)
Unquoted string "interfaces" may clash with future reserved word at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 173.
Unquoted string "mode" may clash with future reserved word at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 173.
syntax error at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 146,
near """_FILE_OFFSET_BITS definition "
syntax error at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 155,
near """_FILE_OFFSET_BITS "
syntax error at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 169,
near """Large Files "
syntax error at
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1/sys/stdsyms.ph line 173,
near """Large File "
$ uname -a
HP-UX rup-co1b B.10.20 E 9000/891 390309281 8-user license
Terry Johnson
mailto:tljohn4@uswest.com
P.S. this is new build (done last week) and this is the only header that is
seeming to give me trouble. As I said above, if I use the old header (not
current h2ph, but the one from the last build) there are no problems, so I am
curious if this is critical or dangerous to use the old header.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 03 Mar 1999 18:08:25 +0000
From: Aengus Stewart <aengus.stewart@icrf.icnet.uk>
Subject: Q: File::copy behaviour
Message-Id: <36DD7A99.DB4504D4@icrf.icnet.uk>
I have a script that contains the following
print "QQQQQQ\n";
copy("blob", \*STDOUT);
print "QQQQQQ\n";
If run at the command line it works fine and the contents of blob are
outputted.
If I call the same script from within a URL, the prints get returned to
the browser but not the copy, and there is no entry in the http
error.log
If I change the copy line to
copy("blob", \*STDERR);
The file is sent to the error.log
What does the copy think STDOUT is connected too?
Thanks
Aengus
ps I know that I can write my own subroutine to output a file, I just
want to know why copy doesnt work.
--
----------------------------------------------------------------------
Aengus Stewart aengus.stewart@icrf.icnet.uk
Computational Genome Analysis Laboratory Tel: +44 (0)171 269 3679
Imperial Cancer Research Fund
Lincoln's Inn Fields, Holborn, London, WC2A 3PX, UK
----------------------------------------------------------------------
------------------------------
Date: Wed, 03 Mar 1999 19:44:22 GMT
From: euclid@fantom.com (Dimitri Ostapenko)
Subject: Re: Question on NET::POP3
Message-Id: <qigD2.245$xJ4.412@198.235.216.4>
In article <78B4BB8E4FEA3F8B.C5985DFEDACF8CE8.85170917C5383D0F@library-proxy.airnews.net>,
robert@iminet.com (Robert Saunders) writes:
> I have read the information in the Perl Cookbook along with the readme
> that came with NET::POP3
>
> I am trying to get past the very first part of the program.. below is
> the code that I am using.. I have replaced $mail_server with a dummy
> name to post here and the same with the username and password..
>
> When I run this from a prompt.. I get the error message
>
> Username password didnt work
>
> So it gets connected to my mail server without a problem. and I have
> checked the logs on the mailserver to confirm that a connection is
> being started.. I have checked and rechecked the username and
> password that I am using and can put them into a regular email program
> and have no trouble getting the mail from the machine. So what I am
> missing..
>
> #!/usr/bin/perl
>
> use Net::POP3;
>
> $mail_server = "madeupname.com";
> $username = "madeupusername";
> $password = "madeupuserpassword";
>
> $pop = Net::POP3->new($mail_server)
> or die "Can't open connection to $mail_server : $!\n";
>
> $pop->login("$username", "$password")
> or die "Username password didnt work: $!\n";
>
> Robert Saunders
> robert@iminet.com
>
>
I use Mail::POP3Client; and it works just fine.
here's excerpt from perldoc POP3Client:
#!/usr/local/bin/perl
use Mail::POP3Client;
$pop = new Mail::POP3Client("me", "mypass", "pop3.do.main");
for ($i = 1; $i <= $pop->Count; $i++) {
foreach ($pop->Head($i)) {
/^(From|Subject): / and print $_, "\n";
}
print "\n";
}
this should get you started.
___
Dimitri Ostapenko,
3D CAD Designer/System Administrator
Fantom Technologies Inc.
------------------------------
Date: Wed, 03 Mar 1999 18:36:35 GMT
From: montejw@memes.com (Monte Westlund)
Subject: Re: sysopen and NT
Message-Id: <36e0812e.1447568@news.memes.com>
On Mon, 01 Mar 1999 21:01:44 -0500, ehpoole@ingress.com (Ethan H.
Poole) wrote:
[snip]
>
>Do the directories you are trying to create files in have "CHANGE" (RWX)
>permissions enabled for the anonymous web user? You may be trying to create
>a file in a directory with only Read and eXecute permissions and that is
>guaranteed to result in a "Permission/Access Denied" message.
Our ISP says we have full read, write permissions for the directory in
question.
>
>Also, are you certain your sysopen() call is attempting to access the
>directory/file you think it is? If you are using relative paths you may be
>attempting to access a working directory different from where the script
>resides. If using absolute paths, doublecheck that the paths are correct.
We are using absolute paths. I've checked them and they are correct.
Thanks,
Monte
------------------------------
Date: Wed, 03 Mar 1999 18:31:59 GMT
From: evanjohn@my-dejanews.com
Subject: Re: The millennium cometh -- eventually
Message-Id: <7bjv71$git$1@nnrp1.dejanews.com>
In article <slrn7donmh.jnf.fl_aggie@enso.coaps.fsu.edu>,
fl_aggie@thepentagon.com wrote:
> + have you _ever_ seen anyone think 2000 is part of the 1900s?
>
> Yes. People who have a clue.
This has GOT to be a joke!!! 2000 is part of the 1900s?!?!?
So, I suppose you consider someone 40 years old to be in their 30s?
Pathetic!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 03 Mar 1999 14:05:05 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: The millennium cometh -- eventually
Message-Id: <comdog-ya02408000R0303991405050001@news.panix.com>
In article <7bjv71$git$1@nnrp1.dejanews.com>, evanjohn@my-dejanews.com posted:
> In article <slrn7donmh.jnf.fl_aggie@enso.coaps.fsu.edu>,
> fl_aggie@thepentagon.com wrote:
> > + have you _ever_ seen anyone think 2000 is part of the 1900s?
> >
> > Yes. People who have a clue.
>
> This has GOT to be a joke!!! 2000 is part of the 1900s?!?!?
>
> So, I suppose you consider someone 40 years old to be in their 30s?
>
> Pathetic!
before you get too excited, you might want to check out a bit about
calendar theory. the above idea stems from the notion that the first
year was Year 1, so the first one hundred years included Year 100, meaning
that the second century (or group of 100 years) started with Year 101.
this works similarly for millinea as well.
however, we do count from 0 when we talk about age, since Year 1 is the
year AFTER the first one, so a person 40 years old is in the first year
of his fifth decade.
however, Stephen J. Gould discusses both sides of this issue
at length in his recent book whose title i forget. it should be
easily found in Amazon though.
this is not a strange concept to FORTRAN programmers who now do
Perl :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 03 Mar 1999 14:29:52 -0500
From: Mitch Gorman <gorman@sportsline.com>
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <36DD8DB0.21A53776@sportsline.com>
"Michael T. Richter" wrote:
> And this is related to Python in precisely which way?
Uh, comic relief?
--
Mitch Gorman
gorman@sportsline.com
mitch@speedlimit35.com
http://www.speedlimit35.com/
------------------------------
Date: Wed, 3 Mar 1999 19:49:09 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Tied hashes and locking
Message-Id: <F81B1x.5CL@world.std.com>
"Juho Cederstrvm" <cederstrom@removethis.kolumbus.fi> writes:
>But didn't lockfiles cause race conditions ?
Yes.
> Or should I use a rule like
>"The one who gets lock to a lockfile, can use the hash too" or what ?
Yes.
>Is it hard to access SQL databases in Perl ?
No. (Take a look at the DBD:: modules.)
--
Andrew Langmead
------------------------------
Date: Wed, 03 Mar 1999 18:22:49 GMT
From: mike808@mo.net
Subject: Re: URGENT! Where Do You Hide The CGI Cards From The Spiders?
Message-Id: <7bjulb$g75$1@nnrp1.dejanews.com>
In article <7bhl07$god$1@nnrp1.dejanews.com>,
tatabu@my-dejanews.com wrote:
> When we use a CGI script to create greeting cards for people,
> we usually create the cards in a directory, say "cards", which can
> be accessed by anybody. If this is the case, then the search engines
> that spider our pages can actually suck in all the confidential
> greeting cards that have been created. What do we do to
> remedy this?
1) setup .cgi extensions for cgi handling in the directory.
2) create 'index.cgi' as a document that redirects them somewhere else.
3) put index.cgi as the first "default" document your webserver will look for.
OR: put the "cards" in some directory that only your "gateway" application
knows about, and is *NOT* part of the document tree. Then only programs you
write can access the "cards". You are now in the same boat as all the people
writing DBMS accessing applications. You just have a filesystem-based DBMS.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 3 Mar 1999 19:44:09 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: URGENT! Where Do You Hide The CGI Cards From The Spiders?
Message-Id: <F81AtL.14K@world.std.com>
tatabu@my-dejanews.com writes:
>When we use a CGI script to create greeting cards for people,
>we usually create the cards in a directory, say "cards", which can
>be accessed by anybody. If this is the case, then the search engines
>that spider our pages can actually suck in all the confidential
>greeting cards that have been created.
If I was going to create an Internet greeting card company, I'd
probably put the card data in some sort of database, and create the
card when accessed. Using the filesystem as a database really doesn't
scale well. Maybe I'd use perl to create the scripts that accessed the
database and created the cards. (OK, that last sentence makes this
article on topic for comp.lang.perl.misc)
If I was going to put a whole bunch of files in a directory, and I
didn't want a spider to look at the files in there, I'd probably put
at robots.txt file in my web site to lead the well behaved ones away
from my card area, and put an "index.html" (or the HTTP servers
equivalent) to some sort of static page that wouldn't have links to
the other files in the directory to protect it from misbehaving
spiders.
Of course, I probably wouldn't want to create an Internet greeting
card company unless I wanted to collect valid e-mail addresses to sell
to spammers.
--
Andrew Langmead
------------------------------
Date: Wed, 03 Mar 1999 13:22:37 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Using Perl to resize image?
Message-Id: <comdog-ya02408000R0303991322370001@news.panix.com>
In article <k12D2.7001$8N5.72175@typhoon-sf.pbi.net>, snowhare@devilbunnies.org (Benjamin Franz) posted:
> In article <7bc3j3$dpt$1@news.onramp.net>,
> John <john@terminalreality.com> wrote:
> >Is there a way, using Perl or some UNIX program that I can execute through
> >Perl that I could take a GIF or JPG image and make a thumbnail of it at a
> >size that I specify?
> Check <URL:http://www.nihongo.org/snowhare/utilities/htmlthumbnail/> for
> a script I wrote to do that and more.
[you should note that your script is just a wrapper for some unix
utilities. it would also be nice to have the good docs that you provided
in pod so they can be read with perldoc ;) ]
here's something with far less features (since it does only the parts
that i needed at the time), but is easily expanded with the Image::Magick
API which works on a variety of platforms including Unix, Mac, and Win*.
#!/usr/bin/perl -w
use strict;
use Image::Magick;
use Cwd;
my $cwd = getcwd();
opendir DIR, $cwd;
my @files = grep /jpg$/, readdir DIR;
print "Found @{[scalar @files]} files\n";
foreach my $file (@files)
{
print "Proceesing file $file\n";
$file =~ s/.jpg$//;
my $imager = Image::Magick->new;
die unless ref $imager;
my $status = $imager->Read("$cwd/$file.jpg");
print "Read: $status\n" if $status;
$imager->Border( width=>2, height=>2, color=>'black' );
$status = $imager->Write(filename=>"$cwd/${file}.jpg");
print "Write 1: $status\n" if $status;
my $height = int(0.4 * $imager->Get('height'));
my $width = int(0.4 * $imager->Get('width'));
$imager->Scale( width=>$width, height=>$height );
$status = $imager->Write(filename=>"$cwd/${file}_th.jpg");
print "Write 2: $status\n" if $status;
}
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 3 Mar 1999 19:25:50 GMT
From: gt5146c@acmey.gatech.edu (+jeff)
Subject: warning: undefined filehandle diag check?
Message-Id: <7bk2bu$ot0@catapult.gatech.edu>
Here's the warning:
Value of <HANDLE> construct can be "0"; test with defined() at
libDGT.pl line 65535 (#1)
(W) In a conditional expression, you used <HANDLE>, <*> (glob),
each(), or readdir() as a boolean value. Each of these constructs
can return a value of "0"; that would make the conditional
expression false, which is probably not what you intended. When
using these constructs in conditional expressions, test their
values with the defined operator.
Here's the block of code its from:
sub max {
$of = shift;
$max = 0;
open( TABLE, $of ) || die "Can't open file, $into\n\n";
while( <TABLE> ) {
/^(\d*)!/;
if ($1 > $max) {
$max = $1;
}
}
return $max;
}
I can't figure out why its giving me this error. There are plenty of
other very similar constructs in the file, but none of the others seem
to have this problem. In addition, why should I have to check TABLE?
Its supposed to eventually return "0", thats how it exits the while.
Any ideas?
+jeff
--
Jeffrey J. Barrett
Georgia Institute of Technology, Atlanta Georgia, 30332
Email: gt5146c@prism.gatech.edu
------------------------------
Date: 3 Mar 1999 14:29:27 -0500
From: jete@dgs.dgsys.com (Jete Software Inc.)
Subject: Where is Randal's "HTML to CGI.pm" converter??
Message-Id: <7bk2in$l5o@dgs.dgsys.com>
I remember that Randal Schwarz's wrote an HTML to CGI.pm converter in
one of his Web Techniques magazine columns. I went to the Web Techniques
site, but they don't have an adequate way of searching for a particular
article. So after an hour, I gave up looking.
Can anyone supply the URL to the article.
Thanks!!
-- Norman
------------------------------
Date: Wed, 3 Mar 1999 14:56:25 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: Win32::Registry doesn't work???
Message-Id: <MPG.11475df37146062e9896ad@news-indy.indy.tce.com>
In article <36DBEDB0.9CDC642F@pacific.net.sg>, mckang@pacific.net.sg
says...
> I was trying out some of the Win32 Registry calls such as
> RegOpenEx(), with the "use Win32::Registry;" statement in
> the begining of the script file. But Perl returns with error
> stating that the command RegOpenEx, and other Registry calls
> are not defined.
[...]
> use Win32API::Registry 0.13 qw(:ALL);
Well, IIRC, Win32API is not built into Perl, so you do need to tell Perl
to use it. The "use" mechanism enables you to dynamically load code --
you don't have to load everything in the (CPAN) universe in every script,
because with "use" you can just load what you need.
==========================================================
Mark Leighton Fisher Thomson Consumer Electronics
fisherm@.tce.com Indianapolis, IN
"Browser Torture Specialist, First Class"
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5046
**************************************