[11213] in Perl-Users-Digest
Perl-Users Digest, Issue: 4813 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 3 07:07:23 1999
Date: Wed, 3 Feb 99 04: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 Feb 1999 Volume: 8 Number: 4813
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: Accessing ASP objects from perl <matthew.sergeant@eml.ericsson.se>
Re: alternative perl NG for newbies? <andrewf@beausys.demon.co.uk>
Re: alternative perl NG for newbies? (Sam Holden)
calling ole objects from the database to the html page <john@mediamanager.com.sg>
Re: END blocks for subs? (Damian Conway)
Re: END blocks for subs? (Bart Lateur)
Re: Help me with this small script <allan@due.net>
Re: Help me with this small script <allan@due.net>
how to search for/replace name with HTML name/URL ? (John Owens)
HTML::TokeParser doesn't recognize Doctype (?) (Marc-A. Woog)
Re: local($_) - why not "my"? (Andrew M. Langmead)
Outsourcing FORMAT directives (Marc-A. Woog)
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl in ASP code <matthew.sergeant@eml.ericsson.se>
Problems with Content-Type Header in PERL/CGI (Lynch Man)
Re: read an html from a url <guillaume@nospam.com>
Searching for char in a string lamj@softhome.net
Re: Searching for char in a string (Sam Holden)
Re: shell command in perl (Andrew M. Langmead)
Re: Statistics for comp.lang.perl.misc (Andrew M. Langmead)
Re: submit a form and Perl question <gernot@cat.at>
Re: tie, hash problem <andrewf@beausys.demon.co.uk>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 03 Feb 1999 11:24:39 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage918041041.17673@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 03 Feb 1999 11:38:07 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Accessing ASP objects from perl
Message-Id: <36B8351F.57351944@eml.ericsson.se>
spessard@orionsci.com wrote:
>
> I am trying to access some of the built in asp objects from perl. Makely the
> session, request, and server objects. Is there a way to access these objects
> from perl 5.0? I am trying to do a systems integration using some of this
> technology. And no I can not get the client to change web servers and
> rewriting half the code is also not an option.
You can't access the objects from ordinary perl CGI's, but you can write
ASP code in Perl. Download ActivePerl from www.activestate.com and read
the introduction (actually it's more of a reference) on my web site.
--
<Matt email="msergeant@ndirect.co.uk" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Wed, 3 Feb 1999 10:07:44 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: alternative perl NG for newbies?
Message-Id: <Tn9L8HAw$Bu2EwhF@beausys.demon.co.uk>
In article <798js5$6b$1@client2.news.psi.net>, Abigail <abigail@fnx.com>
writes
>Andrew Fry (andrewf@beausys.demon.co.uk) wrote on MCMLXXXI September
>MCMXCIII in <URL:news:OxisJAACj3t2EwbQ@beausys.demon.co.uk>:
>$$
>$$ As I have already said, take this to its logical conclusion and
>$$ one could, with some justification, answer 'RTFM' to 99.9% of all
>$$ questions.
>
>That certainly isn't true. (See your point c).
Yes it is ... to a point. I guess that the answer to the majority of
questions/queries lies in a document/FAQ/book/website somewhere ...
where do you draw the line ?
>$$ This does rather presume that...
>$$ (a) newbies know what documentation exists, and know their way around it
>
>If you want to know how the 'ls' command works, you type 'man ls'.
>If you want to know how the 'tar' command workds, you type 'man tar'.
>If you want to know how the 'cp' command works, you type 'man cp'.
>If you want to know how the 'telnet' command works, you type 'man telnet'.
>
>Guess what you have to type to learn more about Perl?
(Why is it the experts *have* to add a touch of condescension/sarcasm
to their remarks, I wonder ?)
BTW. I tried 'man perl' on UnixWare 7.0.1 some time ago ... it doesnt
produce anything. Unfortunately, I dont have the time to find out
why this is.
>
>$$ (b) newbies have all the time in the world to read documentation
>
>Oh. Right. They are execused from reading the documentation, cause their
>time is so valueble. Wasting time of hundreds or thousands of people
>reading their question doesn't matter?
1. I was not suggesting that newbies should be excused reading
documentation, nor that their time is so valuable as to be so
excused. These are absurd suggestions, and it is wrong of you
to read these interpretations into what I said.
2. "Wasting time of hundreds/thousands of people reading their
question".
Oh no ... here comes the hyperbole! How long does it take to read
one question and decide that it is to trivial to respond to, for
goodness sake ? (Probably a small fraction of the time you spend
on-line, I guess).
>
>$$ (c) the documentation will tell them precisely what they need to know
>$$ (Come know ... anyone who knows technical documentation knows that
>$$ that often isnt the case!)
>
>Then they should ask a questions to clearify the documentation. Like,
>"the documentation says "Foo bar", but what does that mean?".
If I have a problem in a piece of code that I need to fix
quickly, then I am not going to start asking questions about
a particular document. But I take your point...
>
>$$ (d) reading the numerous Perl books isnt enough
>
>Then they should ask questions to clearify the books.
The suggestion is that all newbies should...
a) be aware of, and read thoroughly, all on-line documentation
b) be aware of, and read a number of recommended books
c) be aware of, and read, the code inside Perl modules
... before even daring to post a question on this newsgroup.
I dont know about other people, but, while I realize the importance of
reading documentation, I dont always have time to do all this.
>
>$$ It may irritate (some of) the experts who use this NG when newbies
>$$ post question which are so trivial and obvious and "uninteresting"
>$$ (...to quote one of the many condescending replies to myself a while
>$$ back) ... but I have to say that I am EQUALLY irritated by a response
>$$ which says nothing more that 'RTFM' (...especially when accompanied
>$$ by a hint of sarcasm).
>$$ I say: if you dont have anything more useful to say than this, then
>$$ DONT BOTHER SAYING ANYTHING!
>
>That doesn't help, does it? RTFM points someone to the manual, saying
>"what you ask is in the manual". Being silent doesn't help the person
>asking the question.
No ... nor does RTFM in my opinion. Well, it may help those who are so
dumb that they dont realize that documentation exists or that the
documentation may provide an answer to their problem ... but I suspect
that most newbies arent so dumb.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
------------------------------
Date: 3 Feb 1999 10:57:59 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: alternative perl NG for newbies?
Message-Id: <slrn7bgatn.5sm.sholden@pgrad.cs.usyd.edu.au>
Andrew Fry <andrewf@beausys.demon.co.uk> wrote:
>In article <798js5$6b$1@client2.news.psi.net>, Abigail <abigail@fnx.com>
>writes
>>Andrew Fry (andrewf@beausys.demon.co.uk) wrote on MCMLXXXI September
>>MCMXCIII in <URL:news:OxisJAACj3t2EwbQ@beausys.demon.co.uk>:
>>$$
>>$$ As I have already said, take this to its logical conclusion and
>>$$ one could, with some justification, answer 'RTFM' to 99.9% of all
>>$$ questions.
>>
>>That certainly isn't true. (See your point c).
>
>Yes it is ... to a point. I guess that the answer to the majority of
>questions/queries lies in a document/FAQ/book/website somewhere ...
>where do you draw the line ?
The line is drawn at the documentation that comes with the lastest stable
version of perl.
I have never said that the answer is in a book or website without quoting
the whole answer as well. What books people have access to, and what web sites
they have access to varies. Everyone who uses perl has access to the
documentation that comes with perl (excusing installation problems) and thus
references to that documentation are as valid an answer as the text of the
document itself.
>
>>$$ This does rather presume that...
>>$$ (a) newbies know what documentation exists, and know their way around it
A reference to the documentation as an answer tells them that the
documentation exists, and by finding that reference they will
learn thier way around it.
>>
>>If you want to know how the 'ls' command works, you type 'man ls'.
>>If you want to know how the 'tar' command workds, you type 'man tar'.
>>If you want to know how the 'cp' command works, you type 'man cp'.
>>If you want to know how the 'telnet' command works, you type 'man telnet'.
>>
>>Guess what you have to type to learn more about Perl?
>
>(Why is it the experts *have* to add a touch of condescension/sarcasm
>to their remarks, I wonder ?)
>
>BTW. I tried 'man perl' on UnixWare 7.0.1 some time ago ... it doesnt
>produce anything. Unfortunately, I dont have the time to find out
>why this is.
>
>>
>>$$ (b) newbies have all the time in the world to read documentation
>>
>>Oh. Right. They are execused from reading the documentation, cause their
>>time is so valueble. Wasting time of hundreds or thousands of people
>>reading their question doesn't matter?
>
>1. I was not suggesting that newbies should be excused reading
> documentation, nor that their time is so valuable as to be so
> excused. These are absurd suggestions, and it is wrong of you
> to read these interpretations into what I said.
>2. "Wasting time of hundreds/thousands of people reading their
> question".
> Oh no ... here comes the hyperbole! How long does it take to read
> one question and decide that it is to trivial to respond to, for
> goodness sake ? (Probably a small fraction of the time you spend
> on-line, I guess).
But even if it only takes a couple of seconds, thats a couple of seconds
that has to be taken by hundreds/thousands of people, I think the poster
can have the courtesy to think about that and spend a few thousand
seconds looking themselves first.
>
>>
>>$$ (c) the documentation will tell them precisely what they need to know
>>$$ (Come know ... anyone who knows technical documentation knows that
>>$$ that often isnt the case!)
>>
>>Then they should ask a questions to clearify the documentation. Like,
>>"the documentation says "Foo bar", but what does that mean?".
>
>If I have a problem in a piece of code that I need to fix
>quickly, then I am not going to start asking questions about
>a particular document. But I take your point...
>
>>
>>$$ (d) reading the numerous Perl books isnt enough
>>
>>Then they should ask questions to clearify the books.
>
>The suggestion is that all newbies should...
>a) be aware of, and read thoroughly, all on-line documentation
>b) be aware of, and read a number of recommended books
>c) be aware of, and read, the code inside Perl modules
>... before even daring to post a question on this newsgroup.
>I dont know about other people, but, while I realize the importance of
>reading documentation, I dont always have time to do all this.
No all newbies should read the faqs thouroughly and read perlsyn and
perlfunc enough to actually write some code that compiles, and if they
are using a regex then perlre. If the are using references then perlref.
And so on and so forth.
I don't expect newbies to know everything about the documentation (I haven't
read it all myself, I have read most of it, but I don't reread it every time
a new version of perl comes out, so I'm sure there are parts I have never
seen). I do expect them to have looked at it and at least read the faq for the
type of problem they are having, and at least have read the appropriate
manuals for the problem they are having, be it perlsyn, perlre, perllol, etc.
I don't know the faqs off by heart, I don't know the documentation off by
heart. When I respond to a question with RTFM, or perlfaq# : ...? I went and
looked to find the answer, instead of posting the whole thing I refer them to
their copy. If it takes me more than 2 minutes to find the answer I either give
up, search some more, or try to solve the problem myself and post an answer.
If I can find the answer in the docs in 2 minutes then a newbie can find it
in the docs as well, it might take them 10 minutes, but they should still look.
By refering them to the docs to find the answer instead of quoting it, they
are forced to learn how to read the docs on their system (with whatever tool
perl has for their platform), and they get to see some of the context and
maybe learn where to look next time.
Posting the full answer just makes it too easy for people to never learn how
to read the docs themselves.
>
>>
>>$$ It may irritate (some of) the experts who use this NG when newbies
>>$$ post question which are so trivial and obvious and "uninteresting"
>>$$ (...to quote one of the many condescending replies to myself a while
>>$$ back) ... but I have to say that I am EQUALLY irritated by a response
>>$$ which says nothing more that 'RTFM' (...especially when accompanied
>>$$ by a hint of sarcasm).
>>$$ I say: if you dont have anything more useful to say than this, then
>>$$ DONT BOTHER SAYING ANYTHING!
>>
>>That doesn't help, does it? RTFM points someone to the manual, saying
>>"what you ask is in the manual". Being silent doesn't help the person
>>asking the question.
>
>No ... nor does RTFM in my opinion. Well, it may help those who are so
>dumb that they dont realize that documentation exists or that the
>documentation may provide an answer to their problem ... but I suspect
>that most newbies arent so dumb.
I suspect that most of the people that ask a FAQ have never actually read the
answer to that particular FAQ, otherwise they wouldn't ask.
I have no problem with people asking for clarification of the documentation.
If they know where to look for the answer but don't understand that answer then
they should say where they looked to save me the effort of finding it myself.
Being silent might work, as people would go away after not getting answers for
a while. However, that isn't what happens someone will answer the question with
their version of an answer, which is incorrect in some subtle way. This demands
a reply to correct the error. Better to just post a pointer to the answer so
that people can go and look themselves and find the correct answer.
--
Sam
Can you sum up plan 9 in layman's terms? It does everything Unix does
only less reliably.
--Ken Thompson
------------------------------
Date: Wed, 3 Feb 1999 18:29:41 +0800
From: "John Francis" <john@mediamanager.com.sg>
Subject: calling ole objects from the database to the html page using perl
Message-Id: <36b905de.0@news.smartnet.com.sg>
Hi,
I am a new bee and want to write programs in perl. My first project is that
I need to get banners from the database (MS Access) to the html file and
display one banner after the other with a time interval.
Could anyone who is an expert or who knows how to write this program help me
out on this pls. Its is very urgent.
Thanking you before for your help
John Francis
------------------------------
Date: 3 Feb 1999 09:09:04 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: END blocks for subs?
Message-Id: <7993ng$7eq$1@towncrier.cc.monash.edu.au>
In article <7980l9$am0$2@news.rz.uni-karlsruhe.de>,
Marc.Haber-usenet@gmx.de (Marc Haber) writes:
> This doesn't look very perlish. Especially taking care about the file
> being closed in the second unless statement doesn't strike me as being
> a perlism.
I'm rather partial to a poetic little OO solution:
sub Cleanup::DESTROY { $_[0]->{cleanup}->() }
sub Cleanup::on { $_[0] = bless { cleanup => $_[1] }, Cleanup }
sub your_sub_here
{
Cleanup::on my $completion
=> sub { print "cleaning\n" };
# whatever
}
:-)
Damian
------------------------------
Date: Wed, 03 Feb 1999 11:15:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: END blocks for subs?
Message-Id: <36b82f3a.9497521@news.skynet.be>
Marc Haber wrote:
>This doesn't look very perlish. Especially taking care about the file
>being closed in the second unless statement doesn't strike me as being
>a perlism.
In general, you could create a local filehandle (either by a typeglob or
through the filehandle module). The filehandle would then be closed when
exiting the sub, automatically.
But for this specific case, this looks like poor program design. If
you're going to ignore the file, then why are you opening it? You should
do the file type test BEFORE opening it, and then you have no problem.
Bart.
------------------------------
Date: Wed, 3 Feb 1999 06:42:03 -0500
From: "Allan M. Due" <allan@due.net>
Subject: Re: Help me with this small script
Message-Id: <uCWt2.449$L1.571@nntp1.nac.net>
LukeV wrote in message ...
:@pages contains two occurences (as an example): cies_an&1 and cies_fr&1
:I read them, increment their value (at the right of the &) and after that, I
:wanna write them to a file like this:
:cies_an&1 [line break]
:cies_fr&1 [line break]
:when i have only one, it's fine, it increments ok. Then, if i add another
:one, it's still ok but as soon as i wanna increment the 2nd one, the file
:looks like this:
:cies_an&1 [line break]
:[line break]
:cies_fr&1 [line break]
:here's the script:
:open(INF, ">$logfile");
Oops, always check the return value from your open. .
:foreach $i (@pages) {
You read in the newline that you wrote to the file before
: print INF "$i\n";
and then you add another one, either chomp the newlines as you read in the
data (probably preferred) or just before you write it out. So one, slightly
pendantic, way would be:
open(INF, ">$logfile") or die "an ugly death while opening due to: $!";
foreach $i (@pages) {
chomp $i;
print INF "$i\n";
}
close(INF) or die "trying to close because $!";
HTH
AmD
------------------------------
Date: Wed, 3 Feb 1999 06:45:49 -0500
From: "Allan M. Due" <allan@due.net>
Subject: Re: Help me with this small script
Message-Id: <3GWt2.450$L1.9203@nntp1.nac.net>
Allan M. Due wrote in message ...
:LukeV wrote in message ...
::@pages contains two occurences (as an example): cies_an&1 and cies_fr&1
::I read them, increment their value (at the right of the &) and after that, I
::wanna write them to a file like this:
::cies_an&1 [line break]
::cies_fr&1 [line break]
::when i have only one, it's fine, it increments ok. Then, if i add another
::one, it's still ok but as soon as i wanna increment the 2nd one, the file
::looks like this:
::cies_an&1 [line break]
::[line break]
::cies_fr&1 [line break]
::here's the script:
::open(INF, ">$logfile");
:Oops, always check the return value from your open. .
:
::foreach $i (@pages) {
:
:You read in the newline that you wrote to the file before
Just to be clear, I mean that I assume that you must have read in the newline,
as we can't really tell from the code you posted. It just seems the logical
explanation.
:: print INF "$i\n";
:and then you add another one, either chomp the newlines as you read in the
:data (probably preferred) or just before you write it out. So one, slightly
:pendantic, way would be:
:open(INF, ">$logfile") or die "an ugly death while opening due to: $!";
:foreach $i (@pages) {
: chomp $i;
: print INF "$i\n";
:}
:close(INF) or die "trying to close because $!";
:
:HTH
:
:AmD
:
:
:
------------------------------
Date: 3 Feb 1999 07:45:56 GMT
From: jowens@blit.Stanford.EDU (John Owens)
Subject: how to search for/replace name with HTML name/URL ?
Message-Id: <798urk$nhv$1@nntp.Stanford.EDU>
My group has a large number of web pages that have people's names on
them. What I would like to do is automate adding HTML references to
each name I find.
For example, if the page says "Ben Bitdiddle" and I've got another
file (which I define) which has a pairing between "Ben Bitdiddle" and
"http://www.bitdiddle.com/", I'd like to replace "Ben Bitdiddle" in
the original file with "<a href="http://www.bitdiddle.com/">Ben
Bitdiddle</a>".
Making this more difficult is instances of "Bitdiddle, Ben" and
"Bitdiddle, Ben X." and "Ben X. Bitdiddle" (for example). Also making
it more difficult are existing links:
"<a href="http://www.foo.com/~ben">Ben Bitdiddle</a>" (although I
ought to keep the canonical file with no links and run the Perl script
on it each time I want to incorporate the links).
None of this seems like rocket science, but I'd prefer not to reinvent
the wheel. If those with more Perl experience than I could point me at
some previously written scripts that help me accomplish my task I'd
appreciate it very much.
Thanks,
JDO
--
------------------------------
Date: Wed, 03 Feb 1999 11:56:16 GMT
From: mwoog@pobox.ch (Marc-A. Woog)
Subject: HTML::TokeParser doesn't recognize Doctype (?)
Message-Id: <36b83695.10530699@news.datacomm.ch>
Hi,
I've build an HTML Beautifier which seems to work quit nicely except
for one small problem: HTML::TokeParser does seem to recognize
DocTypes as comments.
HTML-Snippet:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
...
Script-Snippet:
...
# Packages
use File::Find;
use Getopt::Std;
use HTML::TokeParser;
use File::Basename;
...
sub beautify { # This is the blue-collar worker
...
$p = HTML::TokeParser->new(shift||"$input_file");
while ( my $token = $p->get_token ) {
my @tokens = @$token; # $token is reference to an array
(my $type, my $tag, my $attr, my $attrseq, my $origtext) = @tokens;
my %hash_attr = %$attr if defined($attr);
if ( $type eq 'C' ) { print OUTPUTFILE &handle_comments($tag); }
if ( $type eq 'D' ) { # Doctype
print "Doctype\n";
print OUTPUTFILE "<!$tag>\n";
}
...
The new HTML-File:
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"-->
which is what handle_comments() does. What is going wrong here? Is it
the Doctype declaration (if yes this is not a perl question;)?
Thanks for any answers,
Marc
------------------------------
Date: Wed, 3 Feb 1999 11:13:14 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: local($_) - why not "my"?
Message-Id: <F6KsI2.FAF@world.std.com>
Ala Qumsieh <aqumsieh@matrox.com> writes:
>... what are the potential advantages/disadvantages of yanking the
>special variables out of the symbol table?
Since the symbol tables are common accross all threads in threaded
perl, lexeical variables have the advantage of being thread specific.
--
Andrew Langmead
------------------------------
Date: Wed, 03 Feb 1999 11:37:22 GMT
From: mwoog@pobox.ch (Marc-A. Woog)
Subject: Outsourcing FORMAT directives
Message-Id: <36b934e3.10096926@news.datacomm.ch>
Hi,
If I need a lot of format declarations for write() in a script or need
the same declaration for different scripts it gets harder to manage
them. Is there a way to keep this format stuff in a separate file and
just reference (maybe the wrong word here) in the main script? Do I
have to write PMs for that and use require|use then?
Thanks for any answers.
Regards,
Marc
------------------------------
Date: 3 Feb 1999 10:28:26 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7bg969.36a.dformosa@godzilla.zeta.org.au>
In article <796unk$qi$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <slrn7bb7dl.par.dformosa@godzilla.zeta.org.au>,
> dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
[...]
>> I used an array with a boolean range so a search was
>> (pydocode)
>>
>> while (node->key != target)
>> node = node->child[node->key > target]
>> endwhile
>
>That does not look like Pascal.
Its not pascal its pydocode.
>I don't miss those Pascal pointer tree days from college.
I loved pointer tress and linked lists.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
? The platypus' furry art and lititure
compertision http://www.zeta.org.au/~dformosa/rules.html
------------------------------
Date: Wed, 03 Feb 1999 11:35:55 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Perl in ASP code
Message-Id: <36B8349B.940BBB01@eml.ericsson.se>
Sean McKenna wrote:
>
> On Tue, 2 Feb 1999 14:09:18 -0000, "Simon GIllespie"
> <simon.gillespie@virgin.com> wrote:
>
> >Having real problems getting ASP's Folder object's File collection to work.
> >Anyone know of any useful "using Perl for ASP" URL's or books ?
> >Thanks,
> >Simon Gillespie.
> >
>
> Look at the Perl section on http://come.to/fastnet for Perscript with
> ASP info. I don't know if it goes into the Folder object, though.
It doesn't specifically, but it does detail exactly what collections
are, and how to use them. A more direct (and more volatile) URL is:
http://www.fastnetltd.ndirect.co.uk/Perl/PSIntro.html
--
<Matt email="matt@teamamiga.org" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Tue, 2 Feb 1999 22:26:04 -0500
From: lynchman@cyberenet.net (Lynch Man)
Subject: Problems with Content-Type Header in PERL/CGI
Message-Id: <MPG.11218bd7a4a8e522989681@news.cyberenet.net>
I am rather new at CGI PERL, so any help would be appreciated.
I am writing a guestbook CGI ( i know, it is simple ) but I am having
some problems with it. I am trying to have the CGI return both text AND
image files to the browser. Basically I have the CGI "print" the HTML
out. However, I cannot seem to get both the image ( a jpeg file - being
used for the title of the messages page) and the text to disple in the
browser at the same time. The problem is the content header. Right now
it is set to:
Content-Type: text/HTML
and I can get graphics to display if I do:
Content-Type: image/jpeg
Is there a way I can have both at the same time on the same CGI? I would
really like to be able to have the graphics (jpeg files) along with the
text through a single CGI....
Thanks alot
-Pete
lynchman@cyberenet.net
------------------------------
Date: Wed, 3 Feb 1999 11:52:35 -0000
From: "Guillaume Buat-Menard" <guillaume@nospam.com>
Subject: Re: read an html from a url
Message-Id: <799dkl$vmh$1@newsreader2.core.theplanet.net>
Thanks Eugene, that's what I was looking for.
I already have LWP it is just that sometimes with some ISP I can't install
what I want on the server for CGI's so I was looking for script to grab a
URL. I promess, I'll learn and use LWP...
Cheers,
Guillaume.
Eugene Sotirescu wrote in message <36B7D2FF.8BAE8FFC@snailgem.org>...
>Guillaume Buat-Menard wrote:
>>
>> Hi All,
>>
>> I know there are some packages dedicated to the internet etc...
>> The problem is that I don't want to download or install any package
because
>> I'm not gonna run the script on my test server but on another server that
I
>> don't know yet.
>>
>> I just need to find a routine or a compact package that will allow me to
>> read an HTML (or text) page from a designated URL
>> (http://theserver.com/myfile.html). I would like to run this package or
>> routine on NT and UNIX with perl 5.
>
>Not sure what you mean by 'compact package'.
>I use LWP for this kind of thing, but if you insist there's an antique
>called wwwgrab.pl that might do what you want:
>
>http://zima.cae.wisc.edu/~ballard/projects/wwwgrab
>
>In the long run, you shoot yourself in the foot by using it tho: you'll
>have to hack it to do anything interesting (we still have stuff like
>wwwgrab_with_post.pl and a wwwgrab_with_cookies.pl lying around on the
>server where I work). Learn/use LWP.
>--
>Eugene
>
>"Light is the all-exacting good,
>That dry, forever virile stream
>That wipes each thing to what it is,
>The whole, collage and stone, cleansed
>To its proper pastoral."
> Alvin Feinman
------------------------------
Date: Wed, 03 Feb 1999 10:28:32 GMT
From: lamj@softhome.net
Subject: Searching for char in a string
Message-Id: <7998ca$2mt$1@nnrp1.dejanews.com>
I am looking for a way to find if there are any a-z and A-Z character in a
variable $abc. I have been trying to find to most efficient way to do it but
without success, can anyone guide me to the best way to do it?
Jason Lam
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 3 Feb 1999 11:10:38 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Searching for char in a string
Message-Id: <slrn7bgble.5sm.sholden@pgrad.cs.usyd.edu.au>
On Wed, 03 Feb 1999 10:28:32 GMT, lamj@softhome.net <lamj@softhome.net> wrote:
>I am looking for a way to find if there are any a-z and A-Z character in a
>variable $abc. I have been trying to find to most efficient way to do it but
>without success, can anyone guide me to the best way to do it?
Benchmark the ways you have come up with and see which is fastest.
'perldoc Benchmark' should explain how to use Benchmark (I think it's
standard).
I'd guess it would be one of y and m.
--
Sam
PC's are backwards ... throw them out! Linux is ok though.
--Rob Pike (on the subject of CR/LF etc)
------------------------------
Date: Wed, 3 Feb 1999 11:22:24 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: shell command in perl
Message-Id: <F6KsxC.HK9@world.std.com>
"Micah G. Cook" <mgcook@ic.delcoelect.com> writes:
>shell command = cat auto.users | egrep -e '/mgsmith$'
Similar to many other Unix tools, a double-quotish contexts (which
includes the "execute-and-return-output" backticks) backslash can be
used to disable the special interpretation of the next character. The
single quotes have no special meaning inside double quotes or
backticks, so they can be entered verbatim.
$map_loc = `cat auto.users | egrep -e '/$name\$'`
Although why use the "cat? command
$map_loc = `egrep -e '/$name\$' auto.users`
--
Andrew Langmead
------------------------------
Date: Wed, 3 Feb 1999 11:33:06 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <F6KtF7.K1v@world.std.com>
moseley@best.com (Bill Moseley) writes:
>In article <1dmmkvj.157w8c6hayyosN@bay1-89.quincy.ziplink.net>,
>rjk@linguist.dartmouth.edu says...
>>
>> In theory, a high ratio is good. High ratio == more original context.
>> Low ratio == more quoted text.
>That seems to devalue those nice one or two lines of perl that so
>beautifully answer some long question!
Its rare that a question is so intricate that it can't be edited. Its
even rarer that the answer to that question will be short.
--
Andrew Langmead
------------------------------
Date: Wed, 03 Feb 1999 11:22:53 +0100
From: Gernot Homma <gernot@cat.at>
Subject: Re: submit a form and Perl question
Message-Id: <36B8237D.BE246292@cat.at>
This is a multi-part message in MIME format.
--------------4B2BD3DBAE62A6D17D905257
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Yes, it's possible, but it's not(!) a perl question.
You have to do the following
<FORM NAME=MyForm>
<INPUT TYPE=...>
</FORM>
<A HREF=javascript:document.forms["MyForm"].submit();>Click here to
submit</A>
Altair wrote:
> Hi !
>
> Is it possible to submit the form content by clicking on a
> simple HTML link ?
> (NOT a classic input submit button)
>
> If so, how to do that in Perl ?
>
> Thank you
>
> Jean
--------------4B2BD3DBAE62A6D17D905257
Content-Type: text/x-vcard; charset=us-ascii;
name="gernot.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Gernot Homma
Content-Disposition: attachment;
filename="gernot.vcf"
begin:vcard
n:Homma;Gernot
x-mozilla-html:FALSE
org:Cyber-Atelier
adr:;;;Vienna ;;1210;Austria
version:2.1
email;internet:gernot@cat.at
tel;fax:+43 1 272 92 51 9
tel;work:+43 1 272 92 51
x-mozilla-cpt:;0
fn:Homma, Gernot
end:vcard
--------------4B2BD3DBAE62A6D17D905257--
------------------------------
Date: Wed, 3 Feb 1999 09:21:07 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: tie, hash problem
Message-Id: <5XRBwAADUBu2EwG$@beausys.demon.co.uk>
In article <m3pv7sxbfg.fsf@joshua.panix.com>, Jonathan Feinberg
<jdf@pobox.com> writes
>Andrew Fry <andrewf@beausys.demon.co.uk> writes:
>
>> tie(%DBHASH,$i,$dbname,$flags,0666)
>> where $i = SDBM_Type or DB_Type or NDBM_Type
Sorry ... for *_Type, read *_File.
(It was late when I posted my message!).
But the problem still applies.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
------------------------------
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 4813
**************************************