[27919] in Perl-Users-Digest
Perl-Users Digest, Issue: 9283 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 11 18:05:49 2006
Date: Sun, 11 Jun 2006 15:05:04 -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 Sun, 11 Jun 2006 Volume: 10 Number: 9283
Today's topics:
ANN: Dao 1.0.0-alpha is released <phoolimin@gmail.com>
Re: CGI for collecting phone numbers <tadmc@augustmail.com>
Re: CGI for collecting phone numbers <segraves_f13@mindspring.com>
Re: Help - Inline::C arrayref deref? <leegee@gmail.com>
Re: Help - Inline::C arrayref deref? xhoster@gmail.com
how to spider part of the content of a webpage ? jiehuang001@hotmail.com
Re: how to spider part of the content of a webpage ? <noreply@gunnar.cc>
Re: how to spider part of the content of a webpage ? <tadmc@augustmail.com>
Re: I received eBay Star Developer Award <angrie.woman@ggmail.com>
Re: I received eBay Star Developer Award <ignoramus19378@NOSPAM.19378.invalid>
Re: I received eBay Star Developer Award <ignoramus19378@NOSPAM.19378.invalid>
Re: I received eBay Star Developer Award <puonegf+hfrarg@tznvy.pbz>
Re: I received eBay Star Developer Award <angrie.woman@ggmail.com>
Re: I received eBay Star Developer Award caroball@aol.com
Re: I received eBay Star Developer Award caroball@aol.com
Re: I received eBay Star Developer Award <ignoramus19378@NOSPAM.19378.invalid>
Re: I received eBay Star Developer Award <angrie.woman@ggmail.com>
Re: memory efficiency - for loop with reverse list <hoosier45678@hotmail.com>
OOP: Share objects between classes hobosalesman@gmail.com
Re: Using tee with Perl's system command olson_ord@yahoo.it
Re: Writing a "Hello world" HTML page from perl script krakle@visto.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Jun 2006 09:31:54 -0700
From: "fulimin" <phoolimin@gmail.com>
Subject: ANN: Dao 1.0.0-alpha is released
Message-Id: <1150043514.871639.70000@m38g2000cwc.googlegroups.com>
Hello,
It is a pleasure to announce in this mailing list the newly released
Dao. This is the first release after the Dao interpreter being
re-designed and re-implemented as a virtual register machine since the
beginning of this year. There have been many great improvements on both
the language and the efficiency of the virtual machine. 10-20 times
speedup has been observed. I am sure you will be surprised when you try
it and compare it with other scripting languages.
Some important language features have been added, such as switch-case
control, for-in-do control, setting function parameter types and
default values, passing parameters by name, and function overloading by
parameter types; OOP in Dao is also greatly improved; reflection
methods are newly supported. In one word, the release represents a
milestone in the development of Dao.
Two modules are also released along with the virtual machine: DaoMySQL
and DaoPyhon. DaoPython is particularly interesting, because it allows
Python modules to be loaded by Dao, then Python variables, functions
and classes can be used conviniently in Dao scripts.
However, since the virtual machine is almost written from scratch only
since the beginning of this year, it could not be very robust (it
should be more robust than any previous releases), that is why it is
release as an alpha release. A formal release will be made once the
virtual machine is well tested (please join us, if you want this
process to be faster).
For more detail about this release: please visit http://www.xdao.org,
and http://xdao.org/dokuwiki/.
Your suggestions and comments are extremely welcome!
Limin FU
------------------------------
Date: Sun, 11 Jun 2006 11:30:16 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: CGI for collecting phone numbers
Message-Id: <slrne8oh8o.nbt.tadmc@magna.augustmail.com>
ferreira@unm.edu <ferreira@unm.edu> wrote:
> Pual,
> Do you just like to badger newbes or what?
You have not correctly identified the nature of Paul's followups.
It was not badgering, it was letting you in on the social dynamic
of this group of people that you just entered.
You've done a half dozen things that will be seen as rudeness by
many here.
One (probably too) common response to such a post is to killfile
your address, and ignore you forevermore, with you not even
knowing what has happened!
Another response is to make a followup pointing out these things
to you so that you would become aware of them before it is too late.
Which approach is more helpful to you?
Leaving you in ignorance, or helping you to learn what you
need to know to participate fully?
You were walking around with some toilet paper stuck to your shoe.
Many people just snickered at you, Paul was courteous enough to
say "Hey, you have some TP stuck to your shoe".
Now you are acting as if you _prefer_ not knowing.
> I don't even get paid for
> this.
Neither do we.
So we are not likely to write complete programs to specification,
that is what we do at work.
We don't write programs here. We help people write programs here.
> I'm just a volunteer trying to help out for a good cause.
So are we.
(But "help out" is not the same as "do it for me".)
(and if your code leads to embarrassment for your client that makes
the 6 o'clock news, your "help out" may end up costing far more
than what was paid for the code.)
> Here is the final code.
I sure hope not...
> Maybe someone wanting to submit phone numbers
> from a form to a text file with a cgi will run across this post and
not use the code in a cargo-cult manner, but will instead
work to understand what it does. (and then probably decide
to do it differently.)
> save the hassle I went through.
I expect the root cause of your hassle was being new to four
different things all at the same time.
1) Usenet
2) web (CGI) programming
3) Perl
4) programmming itself (IMO)
Lurking or reading the Posting Guidelines or even googling
for "netiquette" would handle most of #1. (or simply listening
to the advice that Paul gave you.)
You can start on #2 with:
perldoc -q CGI
Where can I learn about CGI or Web programming in Perl?
What is the correct form of response from a CGI script?
My CGI script runs from the command line but not the browser.
(500 Server Error)
How can I get better error messages from a CGI program?
How do I make sure users can't enter values into a form that
cause my CGI script to do bad things?
How do I decode a CGI form?
You can start on #3 at learn.perl.org, and finish with asking
questions about Perl programming right here.
Learning industry standard programming practices (#4) is not
so easily addressed.
> #!/usr/bin/perl -w
use warnings;
is a much better method of enabling warnings.
You should also enable strictures:
use strict;
to get perl to help you find common bugs.
> use CGI;
Why did you include this module?
This is not a rhetorical question.
You never make use of any of the facilities that it provides,
so it looks like you are engaging in "cargo cult programming"
(using code even when you do not understand what it does).
Your programming life will be very hard unless we can
successfully teach you to understand code before using it. :-)
> if ($ENV{'REQUEST_METHOD'} eq 'POST') {
>
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
> @pairs = split(/&/, $buffer);
>
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
> hex($1))/eg;
> $FORM{$name} = $value;}
> }
> my $phone = $FORM{phone};
If you do it like in the answer to the "How do I decode a CGI form?" FAQ,
then you can replace all of your code above with these 2 lines:
use CGI qw(:standard);
my $phone = param( "phone" );
Not only is it a whole lot shorter, it does not contain the bugs
that your hand-rolled (and cargo-culted I would assume) code has.
> flock (FILE, 2) or die "cannot lock file exclusively: $!";
^
^
You should avoid using system-dependent hard coded values like
that, since the numbers can be different on different systems.
You should import the constants from the Fcntl module instead:
use Fcntl qw(:flock);
flock (FILE, LOCK_EX) or die ...
> print FILE $phone . "\n";
You don't say what you are going to use this list of phone numbers
for, but in light of #2 above I better mention a couple more things
in case you haven't thought about them yet.
The web is a wild and wooly place. There are people out there that
just cruise around looking for an opportunity to cause trouble.
They will find opportunity aplenty if you put your "final code"
where they can find it.
What will your code do if a user enters this for the "phone" form value:
http://www.pornography.com
??
Do you _want_ to put that into your phone list? Probably not, so
you'd better do some input checking:
die 'does not look like a phone number' unless $phone =~/^[0-9 -]+$/;
(but don't use die() in a real CGI program...)
Yet another thing to consider: what if the user enters all of
his enemy's phone numbers instead of his own phone number?
Be careful out there!
[snip TOFU.
Yet another breach of standard netiquette...
]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 11 Jun 2006 18:30:46 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: CGI for collecting phone numbers
Message-Id: <qjZig.4693$lp.536@newsread3.news.pas.earthlink.net>
<ferreira@unm.edu> wrote in message
news:1149996936.518786.85110@f6g2000cwb.googlegroups.com...
<snip>
> Here is the final code. Maybe someone wanting to submit phone numbers
> from a form to a text file with a cgi will run across this post and
> save the hassle I went through.
Defective code deleted.
<snip>
> You will be returned to GaryKing .org in 5 seconds.
> <p><a href="http://www.GaryKing.org/"> Or click here to return to
> GaryKing.org now.</a></p></center>
IMO, it's not a good idea to include a real web site in your example, as you
may inadvertantly expose that web site to exploits of poorly written (or
poorly configured)code used by the site, e.g., FormMail v. 1.92.
You may wish to consider the use of Gunnar's Contact program (see link in
his sig).
Good luck.
--
Bill Segraves
------------------------------
Date: 11 Jun 2006 08:31:51 -0700
From: "Lee" <leegee@gmail.com>
Subject: Re: Help - Inline::C arrayref deref?
Message-Id: <1150039911.948163.15580@y43g2000cwc.googlegroups.com>
xhoster@gmail.com wrote:
> "Lee" <leegee@gmail.com> wrote:
> >
> > int x = av_fetch(av_pcm, 0, 0);
>
> av_fetch returns a SV**. You need to dereference it twice, once
> in the normal C way and once with a special macro to get the integer
> out of it.
>
> int x = SvIV(*(av_fetch(av_pcm, 0, 0)));
> However, your code leaks like a sieve and I'm not sure how to fix that.
Me neither - I'm having problems enough with perlguts, but thank you
for your help. I totally overlooked the double star in the definition.
Lee
------------------------------
Date: 11 Jun 2006 21:49:10 GMT
From: xhoster@gmail.com
Subject: Re: Help - Inline::C arrayref deref?
Message-Id: <20060611174915.971$6Y@newsreader.com>
"Lee" <leegee@gmail.com> wrote:
> xhoster@gmail.com wrote:
> > "Lee" <leegee@gmail.com> wrote:
> > >
> > > int x = av_fetch(av_pcm, 0, 0);
> >
> > av_fetch returns a SV**. You need to dereference it twice, once
> > in the normal C way and once with a special macro to get the integer
> > out of it.
> >
> > int x = SvIV(*(av_fetch(av_pcm, 0, 0)));
>
> > However, your code leaks like a sieve and I'm not sure how to fix that.
>
> Me neither - I'm having problems enough with perlguts, but thank you
> for your help. I totally overlooked the double star in the definition.
I stopped the leaks by adding sv_2moral in two places:
AV* av_pcm=newAV() ; // Dereferenced PCM input array
sv_2mortal(av_pcm);
(Althought I don't particularly like this. The only reason the newAV()
seems to here is to prevent errors in the case that the thing passed in is
not an array reference, which should probably be handled down in the "if",
not up here.
And:
sv_2mortal(av_ret);
return av_ret;
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 11 Jun 2006 12:40:20 -0700
From: jiehuang001@hotmail.com
Subject: how to spider part of the content of a webpage ?
Message-Id: <1150054820.286203.304670@u72g2000cwu.googlegroups.com>
This page http://www.dpgn.com/resultDetail.cfm?resultID=1 has data on
physican networks. ("jieACS" is the username and password). When I
change the resumtID on the URL to a different number such as 2, a
different record will show up.
Now I need to write a program, say, to collect all the records into a
single file, from resultID=1 to resultID=10000.
Can someone please tell me how to write such a perl program. Of course,
I don't need the content on the left and bottom of the webpage.
Thank you very very much!
JIe
------------------------------
Date: Sun, 11 Jun 2006 22:29:16 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to spider part of the content of a webpage ?
Message-Id: <4f3cmvF1hesliU1@individual.net>
jiehuang001@hotmail.com wrote:
> This page http://www.dpgn.com/resultDetail.cfm?resultID=1 has data on
> physican networks. ("jieACS" is the username and password). When I
> change the resumtID on the URL to a different number such as 2, a
> different record will show up.
>
> Now I need to write a program, say, to collect all the records into a
> single file, from resultID=1 to resultID=10000.
>
> Can someone please tell me how to write such a perl program.
1. Learn Perl.
2. Write the program.
> Of course,
> I don't need the content on the left and bottom of the webpage.
No, of course not.
> Thank you very very much!
You are welcome.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 11 Jun 2006 16:29:51 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to spider part of the content of a webpage ?
Message-Id: <slrne8p2qe.nta.tadmc@magna.augustmail.com>
jiehuang001@hotmail.com <jiehuang001@hotmail.com> wrote:
>
> This page [snip URL] has data on
> physican networks. ( [snip pword] is the username and password).
Did you just really do that!?
You are willing to have the whole World use that pay-for service
under your account information?
Are you crazy or just incompetent?
Go change your password right now.
Don't read the rest of this message yet, go change your password right now.
We'll wait...
...
...
Good. Thank you, and don't ever do that again.
> Now I need to write a program, say, to collect all the records into a
> single file, from resultID=1 to resultID=10000.
What do you plan to do with the information that you are collecting?
Does the website's Terms Of Service allow you to do that?
A compentent webmaster is bound to notice a usage spike when you
do ten thousand lookups in 20 minutes. It might look like you
are trying to copy the entire database.
You should ask the site's webmaster if you are allowed to do this
before spending a lot of time coding it up.
> Can someone please tell me how to write such a perl program.
Sounds illegal to me, so I figure you are probably on your own...
> Thank you very very much!
You *did* already change your password, didn't you?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 11 Jun 2006 10:19:59 -0500
From: "angrie.woman" <angrie.woman@ggmail.com>
Subject: Re: I received eBay Star Developer Award
Message-Id: <e6hbr4$rom$1@nntp.aioe.org>
Ignoramus14786 wrote:
> I am at eBay developers conference right now, and they gave me a Star
> Developer Award for writing a Net::eBay perl module.
Congrats!!!!
------------------------------
Date: Sun, 11 Jun 2006 16:17:24 GMT
From: Ignoramus19378 <ignoramus19378@NOSPAM.19378.invalid>
Subject: Re: I received eBay Star Developer Award
Message-Id: <omXig.9760$BD1.9195@fe07.usenetserver.com>
On Sun, 11 Jun 2006 08:38:46 -0400, Agent_C <Agent-C-hates-spam@nyc.rr.com> wrote:
> On Sat, 10 Jun 2006 19:32:37 GMT, Ignoramus14786
><ignoramus14786@NOSPAM.14786.invalid> wrote:
>
>>I am at eBay developers conference right now, and they gave me a Star
>>Developer Award for writing a Net::eBay perl module. That perl module
>>allows developers to send queries to eBay API by making very simple
>>perl calls. Useful for website developers or people like me who like
>>to ist stuff on ebay without going to their website.
>>
>>Apparently, I am one of about 8 or so people who received the award
>>this year.
>>
>>Pictures will be provided after I get back home from conference.
>>
>>This module is described at my site www.net-ebay.org.
>
>
> Congratulations! Perhaps you could use your new clout to get the eBay
> development team to improve their configuration management and change
> control procedures.
>
> That way we'd have fewer broken, untested web functions to deal with.
Perhaps, yes, I could get attention of people slightly more easily.
i
------------------------------
Date: Sun, 11 Jun 2006 16:23:16 GMT
From: Ignoramus19378 <ignoramus19378@NOSPAM.19378.invalid>
Subject: Re: I received eBay Star Developer Award
Message-Id: <UrXig.9761$BD1.385@fe07.usenetserver.com>
On Sun, 11 Jun 2006 10:19:59 -0500, angrie.woman <angrie.woman@ggmail.com> wrote:
> Ignoramus14786 wrote:
>> I am at eBay developers conference right now, and they gave me a Star
>> Developer Award for writing a Net::eBay perl module.
>
>
> Congrats!!!!
Thanks AW!
You can click here:
http://ebaydevcon.com/blog/
and scroll down to 2006 Star Developer Awards. Mine is for eBay
Service to the Community: Open Source Project.
i
------------------------------
Date: Sun, 11 Jun 2006 10:33:25 -0600
From: Chris Barts <puonegf+hfrarg@tznvy.pbz>
Subject: Re: I received eBay Star Developer Award
Message-Id: <pan.2006.06.11.16.33.24.621433@tznvy.pbz>
On Sat, 10 Jun 2006 17:09:21 -0700, caroball wrote:
>
> Congrats from a long long ago COBAL programmer
That must have been frustrating: Hacking away at COBAL code while the
COBOL programmers got all the glory. ;)
--
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Sun, 11 Jun 2006 11:43:03 -0500
From: "angrie.woman" <angrie.woman@ggmail.com>
Subject: Re: I received eBay Star Developer Award
Message-Id: <e6hgmt$310$1@nntp.aioe.org>
Ignoramus19378 wrote:
> On Sun, 11 Jun 2006 10:19:59 -0500, angrie.woman <angrie.woman@ggmail.com> wrote:
>> Ignoramus14786 wrote:
>>> I am at eBay developers conference right now, and they gave me a Star
>>> Developer Award for writing a Net::eBay perl module.
>>
>> Congrats!!!!
>
> Thanks AW!
>
> You can click here:
>
> http://ebaydevcon.com/blog/
>
> and scroll down to 2006 Star Developer Awards. Mine is for eBay
> Service to the Community: Open Source Project.
>
> i
>
>
That is just so very, very cool. Were you specifically invited to attend
the conference, or did you just happen to be there?
It looks to me like you're the only person there who actually isn't
affiliated with a company. I know you run Algebra.com, but that's not
really what drove you to the eBay programming, is it?
------------------------------
Date: 11 Jun 2006 10:30:00 -0700
From: caroball@aol.com
Subject: Re: I received eBay Star Developer Award
Message-Id: <1150047000.565540.259720@f6g2000cwb.googlegroups.com>
Chris Barts wrote:
> On Sat, 10 Jun 2006 17:09:21 -0700, caroball wrote:
>
> >
> > Congrats from a long long ago COBAL programmer
>
> That must have been frustrating: Hacking away at COBAL code while the
> COBOL programmers got all the glory. ;)
>
> --
MAYBE that's why my stuff always got kicked out with 9000 error
messages - I did some FORTRAIN & AUTOMOBILECODDER too
------------------------------
Date: 11 Jun 2006 10:32:27 -0700
From: caroball@aol.com
Subject: Re: I received eBay Star Developer Award
Message-Id: <1150047147.725680.288660@j55g2000cwa.googlegroups.com>
caroball@aol.com wrote:
> Ignoramus14786 wrote:
> > I am at eBay developers conference right now, and they gave me a Star
> > Developer Award for writing a Net::eBay perl module. That perl module
> > allows developers to send queries to eBay API by making very simple
> > perl calls. Useful for website developers or people like me who like
> > to ist stuff on ebay without going to their website.
> >
> > Apparently, I am one of about 8 or so people who received the award
> > this year.
> >
> > Pictures will be provided after I get back home from conference.
> >
> > This module is described at my site www.net-ebay.org.
>
> Congrats from a long long ago COBAL programmer - we thought at that
> time that we were the ultimate in programs, etc --- kinda like a
> horse saying automobiles will never catch on
WHO put that A key over my O key?????
------------------------------
Date: Sun, 11 Jun 2006 20:32:26 GMT
From: Ignoramus19378 <ignoramus19378@NOSPAM.19378.invalid>
Subject: Re: I received eBay Star Developer Award
Message-Id: <u5%ig.14168$E51.4836@fe71.usenetserver.com>
On Sun, 11 Jun 2006 11:43:03 -0500, angrie.woman <angrie.woman@ggmail.com> wrote:
> Ignoramus19378 wrote:
>> On Sun, 11 Jun 2006 10:19:59 -0500, angrie.woman <angrie.woman@ggmail.com> wrote:
>>> Ignoramus14786 wrote:
>>>> I am at eBay developers conference right now, and they gave me a Star
>>>> Developer Award for writing a Net::eBay perl module.
>>>
>>> Congrats!!!!
>>
>> Thanks AW!
>>
>> You can click here:
>>
>> http://ebaydevcon.com/blog/
>>
>> and scroll down to 2006 Star Developer Awards. Mine is for eBay
>> Service to the Community: Open Source Project.
>>
>> i
>>
>>
> That is just so very, very cool. Were you specifically invited to attend
> the conference, or did you just happen to be there?
Yes, I was invited.
> It looks to me like you're the only person there who actually isn't
> affiliated with a company. I know you run Algebra.com, but that's not
> really what drove you to the eBay programming, is it?
No, but on the other hand, I sell used stuff on eBay. It was just a
free software thing, done because, in my opinion, software wants to be
free.
i
------------------------------
Date: Sun, 11 Jun 2006 15:52:22 -0500
From: "angrie.woman" <angrie.woman@ggmail.com>
Subject: Re: I received eBay Star Developer Award
Message-Id: <e6hvac$fum$1@nntp.aioe.org>
Ignoramus19378 wrote:
>> It looks to me like you're the only person there who actually isn't
>> affiliated with a company. I know you run Algebra.com, but that's not
>> really what drove you to the eBay programming, is it?
>
> No, but on the other hand, I sell used stuff on eBay. It was just a
> free software thing, done because, in my opinion, software wants to be
> free.
That's what I thought. A *very* cool victory for freeware!
------------------------------
Date: Sun, 11 Jun 2006 10:58:15 -0500
From: James <hoosier45678@hotmail.com>
Subject: Re: memory efficiency - for loop with reverse list
Message-Id: <pan.2006.06.11.15.58.10.151834@hotmail.com>
On Sun, 11 Jun 2006 06:28:42 -0700, tuser wrote:
> But I can't find any statement about memory efficiency, so my question
> is this:
>
> In the second for-loop (the one with the reverse-function):
>
> would the entire list ($MIN..$MAX) be constructed first, then reversed
> and iterated over ?
>
> ...or...
>
> is there some optimizer which internally would translate the for-loop
> into a memory efficient for (my $remaining=$MAX; $remaining>=$MIN;
> $remaining--) ?
In recent versions of perl (accd to perldoc perlop, under the section
Range Operators), the increasing case:
foreach (1 .. 1_000_000)
{
sleep 5;
}
... does not build the list in memory, which I verified using top.
(perl did not show up in the first 60 lines of top, sorted by mem). The
reverse case, however:
foreach (reverse 1 .. 1_000_000)
{
sleep 5;
}
Used 9.4% of my memory (second only to firefox), using perl 5.8.7
ymmv
------------------------------
Date: 11 Jun 2006 14:47:29 -0700
From: hobosalesman@gmail.com
Subject: OOP: Share objects between classes
Message-Id: <1150062448.882169.265190@u72g2000cwu.googlegroups.com>
I've divided my code into classes, and I use objects as much as
possible to make the code maintainable and so I can reuse code. I have
modules and objects that need to be used throughout my relatively large
program, from several different packages/classes. FOr instance I have a
handful of fully encapsulated classes with get/set methods to access
instance variables and all. Each of these objects needs to interact
with my database, and obviously I can't have 100 different database
connections for every object. So I want to use inheritance so that all
classes that need to use the database inherit methods for doing so from
a database parent.
But then I also have a class for logging actions that every object
needs to use. And each object needs to use a configuration class that
reads from the config file. And on, and on. I don't know how to set
this up, multiple inheritance? I want to keep it simple, maybe I can
have one parent class that creates instances of the log/db/conf classes
and allows every other class to inherit functions that allow access to
these log/db/conf objects.
I don't want some hack with global variables, I want namespacews as
clear as possible. Maintainability, code re-use, clarity are all more
important than speed for this program. Any advice is welcome.
------------------------------
Date: 11 Jun 2006 08:17:31 -0700
From: olson_ord@yahoo.it
Subject: Re: Using tee with Perl's system command
Message-Id: <1150039051.164618.268260@y43g2000cwc.googlegroups.com>
Ok I agree with what you say and I even pointed this out in my own post
i.e. its seeming that I am passing these as arguments to ls.
After reading your post I just tried passing everything to system
using just one string i.e. system("ls | tee out.txt"); - and this
works. As mentioned in my original post I tried everything but I forgot
that I could pass the entire thing as a string without breaking it up
into arguments.
Thanks a lot.
O.O.
------------------------------
Date: 11 Jun 2006 09:42:25 -0700
From: krakle@visto.com
Subject: Re: Writing a "Hello world" HTML page from perl script ?
Message-Id: <1150044145.509370.19430@g10g2000cwb.googlegroups.com>
Thomas Blabb wrote:
> Sorry for this question but how do I write a simple "Hello world" HTML page from a
> perl script?
>
> In other words if I click in an already existing html page on a link like:
>
> ...
> <a href="/export/home/aaa/cgi-bin/writehello.pl" target="_top">Click on this link</A>
> ...
>
> a html page with the following stuff should be written and displayed in the browser:
>
> <HTML>
> <HEAD>
> <TITLE>Test</TITLE>
> </HEAD>
> <BODY>
> Hello World
> </BODY>
> </HTML>
>
> How should the perl script look like ?
>
> Do I have to change the perl script if I use the domain name instead of the internal path name?
>
> <a href="http://www.mydomain.com/cgi-bin/writehello.pl" target="_top">Click on this link</A>
>
> Tom
#!/usr/bin/perl -Tw
use strict;
use warnings;
use CGI;
my $cgi = new CGI;
print $cgi->header("text/html");
print <<End_Html;
<html>
<head>
<title>Your Title</title>
</head>
<body bgcolor="#ffffff" text="#000000">
Helllo world!
</body>
</html>
End_Html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9283
***************************************