[12368] in Perl-Users-Digest
Perl-Users Digest, Issue: 5967 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 12 03:07:20 1999
Date: Sat, 12 Jun 99 00:00:29 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 12 Jun 1999 Volume: 8 Number: 5967
Today's topics:
Re: Access to mail content (John Stanley)
Re: Afraid to ask about Y2K! <webmaster@chatbase.com>
Re: Alter name of an array? (Abigail)
Re: Calculating weekday given year, month and day (Abigail)
Re: delete line ending with ) (Abigail)
Re: Disokaying files in a Browser <cassell@mail.cor.epa.gov>
Re: Disokaying files in a Browser <rootbeer@redcat.com>
Email/Comments Form sherip@sonic.net
Re: Email/Comments Form (Eric Bohlman)
Re: Email/Comments Form <rootbeer@redcat.com>
function to retrieve number of members in list dalehend@flash.net
Re: GIFgraph output to web page <rootbeer@redcat.com>
Re: HELP: Perl on Windows Platform??? <jeff@vpservices.com>
Re: HELP:Hash mapping of subroutines with params <cassell@mail.cor.epa.gov>
Re: HELP:Hash mapping of subroutines with params <rootbeer@redcat.com>
Re: how do i refresh frames from perl? (Abigail)
Re: how do i refresh frames from perl? (Abigail)
Re: how to check if file exists? (Abigail)
Re: HTTP protocol etc. (Abigail)
Re: if (my $a=1) { } print $a; Why do i get undef an no <rootbeer@redcat.com>
Re: Interpolation Question flounder99@my-deja.com
Re: Large String handling <rootbeer@redcat.com>
Re: Large String handling (Larry Rosler)
Re: MIcrosofts Attack on Perl (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Jun 1999 00:14:33 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Access to mail content
Message-Id: <7js8p9$5oa$1@news.NERO.NET>
In article <7jrq0o$ig$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Fri, 11 Jun 1999 01:47:13 GMT paul@bagend.wurley.net wrote:
>> When a new message arrives I would like to have a perl program that
>> takes the content of the message and writes this to a text file. Could
>
>You might want to look at either the Mailtools or Mailfolder packages
>of modules available from CPAN:
Overkill. If all you want is something to write the mail to a file, you
already have it. The file will be called /usr/spool/mail/your.user.name
by default.
If you want a perl script to process each piece of mail as it comes in,
then simply pipe the mail to the script using a .forward file.
------------------------------
Date: Fri, 11 Jun 1999 17:14:26 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <3761A662.778EE9B1@chatbase.com>
Steve Bean wrote:
>
> In article <375b7df9@newsread3.dircon.co.uk>, gellyfish@gellyfish.com
> says...
> >
> >Steve Bean <sbean@iex.net> wrote:
> >> But i WILL anyway. I can't believe someof the flameout answers to good
> >> questions about Y2K in this section.
> >>
> >
> >I cant believe that we have got to this stage in the game and
> >people are still asking this question - what precisely is it that
> >prevents from going to <http://www.deja.com> and searching for 'Y2K'
> >in this group ? It found 6500 hits just now.
> >
> >/J\
> >--
> >Jonathan Stowe <jns@gellyfish.com>
> >
> This is exactly what I am talking about.
What is that?.. Someone pointing you in the right direction to get as
much info as you could ever want about your question without having to
go through these "flames" and waiting time hoping someone will answer it
for the 50th time personally? Is that what you're talking about?
> What the hell is deja.com?
Did you bother to type "http://www.deja.com" in your browser's location
bar and actually go to it, before asking?
> And
> who are you to flame out at anybody.
I think it's his right, when someone so belligerently and comes in here
knowing and asks such a trivial question, when he admits it and is
stating that he's "going to ask anyway". He never flamed you, he pointed
you in the direction you needed.
> It 's obvious that you are not
> responsible for Y2K.
Not unless he wrote bad code, which I doubt by his qualifications.
> I dismiss you and do not worry about you.
Or, maybe try not to post a question that has been answered over and
over again and get pissy when you don't like the obvious answers that
come with the question.
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.
------------------------------
Date: 11 Jun 1999 18:29:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Alter name of an array?
Message-Id: <slrn7m37g4.37n.abigail@alexandra.delanet.com>
Paul Batt (pbatt@pop.agri.ch) wrote on MMCX September MCMXCIII in
<URL:news:7jqkr4$mhs$1@pollux.ip-plus.net>:
** Can you manipulate the name of an array? I'd need a way to continuously add
** a number to the names of arrays while creating them.
No you don't. You only think you do. You wouldn't that in C or Pascal, now
would you?
** The name of the first
** array should be @array_1, the next one should be called @array_2, etc. Is
** that possibly somehow or is there any alternate way?
Of course there is. Read the faq, it will be a roadmap to you.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 11 Jun 1999 18:31:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Calculating weekday given year, month and day
Message-Id: <slrn7m37jc.37n.abigail@alexandra.delanet.com>
perl_beginner@my-deja.com (perl_beginner@my-deja.com) wrote on MMCX
September MCMXCIII in <URL:news:7jq986$7g1$1@nnrp1.deja.com>:
<> what is the most efficient way to calculate the weekday (sunday=0,
<> monday=1 ...) given the year, month, and day without using the module
<> provided by perl (i.e using arithmatics and algorithm)? Any suggestion?
What's wrong with using the module?
If you really want to find the most efficient routines using arithmetic,
check out Knuth and the calendar FAQ.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 11 Jun 1999 18:35:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: delete line ending with )
Message-Id: <slrn7m37q2.37n.abigail@alexandra.delanet.com>
jimbob4334@my-deja.com (jimbob4334@my-deja.com) wrote on MMCX September
MCMXCIII in <URL:news:7jq1lr$5ba$1@nnrp1.deja.com>:
== How do I delect every line ending with ).
==
== This is what I have - trying to escape out the )
==
== perl -pi -e '/$\)//q' temp.file
==
== get: /)/: unmatched () in line 1
Perhaps you should reread on the syntax of substitutions and regexes.
You are missing a leading s, there's no such thing as /q and lines
ending with ) will have the ) *before* they end, don't they?
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 11 Jun 1999 17:25:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Reggy van Meurs <Reggy@Cistron.nl>
Subject: Re: Disokaying files in a Browser
Message-Id: <3761A911.D9585162@mail.cor.epa.gov>
[courtesy cc sent to poster]
Reggy van Meurs wrote:
>
> Hello pls help.
>
> I want to display a log file, with a browser.
>
> The log file is on a location at the http server.
I think you're going to have to be a bit more specific before
anyone can really help you. For example, is this log file
even in HTML? If not, your browser won't help you much.
If it's in a special format, you may need to know the format
to get much useful info out of it.
Is this log file accessible transparently over a network?
Is it accessible via HTTP? Are its permissions set so you
can read it?
Is this the server log for your ISP? If so, they may not
want you to read it. It would have other people's stuff
in it too.
Do you just want to look at the errors your CGI script is
generating? If so, you want to look at the CGI::Carp
module. Especially carpout() and fatalsToBrowser .
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 11 Jun 1999 17:27:03 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Disokaying files in a Browser
Message-Id: <Pine.GSO.4.02A.9906111726170.6999-100000@user2.teleport.com>
On Sat, 12 Jun 1999, Reggy van Meurs wrote:
> I want to display a log file, with a browser.
It sounds as if you want to tell a browser what to do. The docs, FAQs, and
newsgroups about browsers should be able to help you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 11 Jun 1999 23:10:41 GMT
From: sherip@sonic.net
Subject: Email/Comments Form
Message-Id: <7js51c$sga$1@nnrp1.deja.com>
I am attempting to create a comments form where readers may select
(from a drop-down list) which section of the company their comment
should be delivered to.
There are about 10 different sections (each with their own email
address) to choose from, but the form / email is to be delivered to
only one (the one selected by the reader).
I'm pretty new to this and use formmail.cgi from MSA.
Your help is very much appreciated!
Sheri
sherip@sonic.net
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 12 Jun 1999 00:46:00 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Email/Comments Form
Message-Id: <ebohlmanFD6vGo.Azz@netcom.com>
sherip@sonic.net wrote:
: I am attempting to create a comments form where readers may select
: (from a drop-down list) which section of the company their comment
: should be delivered to.
: There are about 10 different sections (each with their own email
: address) to choose from, but the form / email is to be delivered to
: only one (the one selected by the reader).
: I'm pretty new to this and use formmail.cgi from MSA.
Do you understand Perl well enough to understand how Matt's formmail
program does what it does (I deliberately refrained from writing
"works")? If not, you really need to hire someone to write the script
for you; it's relatively little work, but it's work of a boring and
tedious sort that most people don't feel like doing for free.
If you do understand Perl well enough, then I'd suggest that you first
rewrite the unreliable parts of the script, and then work on adding your
address selector. I would *definitely* do it so that the appropriate
email addresses are stored in the *script* rather than in the *form*;
store codes (like section names) in the form and use a hash in the script
to map them to email addresses. The problem with taking the addresses
themselves from the form (as Matt's script does) is that someone with
malicious intentions can easily use your server to send email with your
return address on it to anyone they want to. This is Not A Good Thing.
------------------------------
Date: Fri, 11 Jun 1999 18:04:27 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Email/Comments Form
Message-Id: <Pine.GSO.4.02A.9906111758380.6999-100000@user2.teleport.com>
On Fri, 11 Jun 1999 sherip@sonic.net wrote:
> I am attempting to create a comments form where readers may select
> (from a drop-down list) which section of the company their comment
> should be delivered to.
>
> There are about 10 different sections (each with their own email
> address) to choose from, but the form / email is to be delivered to
> only one (the one selected by the reader).
>
> I'm pretty new to this and use formmail.cgi from MSA.
>
> Your help is very much appreciated!
Since you didn't have a question, I'm not sure what help you wanted. But
I'll try to help anyway.
Unless you can get that script's author to help you with maintaining it,
just throw it out and write a new, reliable, standard, and secure one that
does what you really want. For that, I recommend Perl heartily.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 12 Jun 1999 01:20:57 GMT
From: dalehend@flash.net
Subject: function to retrieve number of members in list
Message-Id: <3761b560.27217947@news.flash.net>
Is there a function to return the number of members in a list or
array?
Is it @{...} ?
------------------------------
Date: Fri, 11 Jun 1999 17:07:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: GIFgraph output to web page
Message-Id: <Pine.GSO.4.02A.9906111706390.6999-100000@user2.teleport.com>
On Fri, 11 Jun 1999, Kevin Marlowe wrote:
> I'm trying to use GIFgraph to output directly to a web page (instead of a
> file) as a cgi, but keep getting a server error when executing the code.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Jun 1999 05:49:29 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: HELP: Perl on Windows Platform???
Message-Id: <3761F458.6EA4F2DE@vpservices.com>
seong joon bae wrote:
>
> Hi everyone,
> I know that in Unix, you have to put something like....
> #!/usr/local/bin/perl in order to run CGI script.
> But how about Windows 9x?
> What do you put on the first line in order to run CGI script?
That depends on the operating system and/or web server you use to serve
the CGI scripts, not on perl. On win9x, the OS itself ignnores the
line, Omnihttpd also ignores the line so if you are running it as a DOS
console script or using Omnihttpd, you can put anything there. OTOH
Apache for win9x reguires it be the actual path to the perl executable
so something like #!/perl/bin/MSWin32-object/perl.exe or wherever
perl.exe is. The answer for you should be in the docs for your web
server.
--
Jeff
------------------------------
Date: Fri, 11 Jun 1999 17:34:11 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: kgentes@gentek.net
Subject: Re: HELP:Hash mapping of subroutines with params
Message-Id: <3761AB03.DE9FA0D9@mail.cor.epa.gov>
[courtesy cc sent to poster]
kgentes@gentek.net wrote:
>
> I figured out what I was doing wrong.. it was a
> cockpit error... I was actually getting errors,
> but thought it was because I was using Perl to
> do something it couldn't do (pass params through
> subroutines invoked from hash references). The
> errors were not because Perl doesn't support this,
> but rather because I was using the wrong variable
> as the associative hash index. It was my fault.
No problem. I make a lot more errors than Perl does,
so I always code with the -w flag and 'use strict'
to keep me honest. They're good things.
> btw, I posted the from a dejanews web connection,
> knowing that I couldn't test further from where I
> was at the time. In response a few people berated
> me for note trying it myself. Actually, I had been
> trying it myself. I just couldn't at the time of
> the post. Why would anyone post to the group if
> they had not already tried something first hand?
Umm, you won't believe this, but *lots* of people do this.
To the point that in cases like yours, posters jump the
gun and assume the worst. We regularly see people who
list five lines of code and then ask "will this work?"
Glad to know you're not one of 'them'.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 11 Jun 1999 17:52:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: HELP:Hash mapping of subroutines with params
Message-Id: <Pine.GSO.4.02A.9906111751490.6999-100000@user2.teleport.com>
On Fri, 11 Jun 1999 kgentes@gentek.net wrote:
> Why would anyone post to the group if
> they had not already tried something first hand?
A good question. Please ask it of the next dozen people who ask "What will
this code do?" or "Is this syntax okay?" :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 11 Jun 1999 19:07:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how do i refresh frames from perl?
Message-Id: <slrn7m39m8.37n.abigail@alexandra.delanet.com>
Bastiaan S van den Berg (office@asc.nl) wrote on MMCX September MCMXCIII
in <URL:news:7jqmim$eam$1@zonnetje.NL.net>:
==
== since my last post didn't get much reply.. i redefined my question..
==
== i need to update a frame with new values , how can i export information to
== a
Djee, a single letter line....
== certain frame , instead of just the current frame ?
==
== or how can i update a default value in a form textbox without refreshing
== the entire page??
== (if that's even possible :)
The same way as you would do it from a Lisp program! So, perhaps
you should ask somewhere else. (Hint: don't ask in comp.lang.lisp).
== Bastiaan v/d Berg ; aka buZz
== Internet Specialist
Really? You don't act like one.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 11 Jun 1999 19:09:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how do i refresh frames from perl?
Message-Id: <slrn7m39q9.37n.abigail@alexandra.delanet.com>
Bastiaan S van den Berg (office@asc.nl) wrote on MMCX September MCMXCIII
in <URL:news:7jqth8$kcr$1@zonnetje.NL.net>:
## >You didnt get much reply because this is not really a Perl question -
## >it is one that should be asked in comp.infosystems.www.authoring.cgi
## >or preferably the CGI FAQ -
## <http://www.webthing.com/tutorials/cgifaq/html>
##
## have you ever tried posting something there?
## i need to confirm my posting , so i did
##
## now , at least 30mins ago , it's still not posted!!!
## am i going crazy , or is that newsgroup badly moderated??
Oh goodie. 30 minutes, and your posting still hasn't shown up!
What a horror! We need an Internet specialist to fix this! Now!
Why should this newsgroup care about moderation in other groups?
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 11 Jun 1999 19:10:28 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to check if file exists?
Message-Id: <slrn7m39s7.37n.abigail@alexandra.delanet.com>
R!k (rusenet@bigfoot.com) wrote on MMCX September MCMXCIII in
<URL:news:7jrdrj$tqs$2@enterprise.cistron.nl>:
~~ 1. Can a .pl crash (Error 500 ) on opening a non-existing file?
What is a .pl?
~~ 2. How do i check if a file exists?
That's in the manual. Did you read it?
Abigail
--
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 11 Jun 1999 19:11:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HTTP protocol etc.
Message-Id: <slrn7m39ub.37n.abigail@alexandra.delanet.com>
George (fred222@mauimail.com) wrote on MMCX September MCMXCIII in
<URL:news:fred222-ya023580001106991511480001@news.bellatlantic.net>:
`` I was curious - I'd like to muck about with connecting to servers and
`` grabbing pages on a bit lower level than LWP seems to let you do, and I was
`` wondering if anyone could point me towards some documentation or resources
`` that would be helpful in figuring out what lines to send the server, etc.
`` and how to approach it.
This is not at all a Perl question, but I give you an answer anyway: RFC 2068.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 11 Jun 1999 17:36:40 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: if (my $a=1) { } print $a; Why do i get undef an not "1" ??
Message-Id: <Pine.GSO.4.02A.9906111736050.6999-100000@user2.teleport.com>
On Fri, 11 Jun 1999, Larry Rosler wrote:
> I don't understand why 'use strict;' allowed those two uses of
> $main::a without a declaration, though.
sort(). Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 12 Jun 1999 00:21:35 GMT
From: flounder99@my-deja.com
Subject: Re: Interpolation Question
Message-Id: <7js96a$tqk$1@nnrp1.deja.com>
In article <7jp61f$498$1@newsread.f.de.uu.net>,
"Aidan Humphreys" <ahumphr@c-s-k.de> wrote:
> Can someone explain to me how I initiate interpolation? Basically I am
> retrieving a HTML string with embedded 'syntactical variables' from a
> database. I want to then interpolate the variables the program
context. To
> simulate the data base retrieval I'll assign the sting using a single
quoted
> here document.
>
> $foo = <<'__ETX';
> <HTML>
> <HEAD>
> <TITLE>$param[0]</TITLE>
> </HEAD>
> <BODY>$param[1]</BODY>
> </HTML>
> __ETX
>
> #... ... ...
>
> @param = ("<p>Title", "<p>Body");
>
> eval print $foo;
>
> How do I get the text to print out with the $param[] values
interpolated. ?
>
>
What you want is to double-double quote the string.
i.e. interpolate the string and then interpolate it again.
you can do this several ways.
print eval "\"$foo)\"";
# or
print eval "qq($foo)";
#or something similar
The outside quotes interpolate the $foo
to a string in quotes or surrounded by the qq() "operator"
that the eval then interpolates again.
caveat: $foo must be an "interpolatable" string or the eval
will choke.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 17:25:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Large String handling
Message-Id: <Pine.GSO.4.02A.9906111724540.6999-100000@user2.teleport.com>
On Fri, 11 Jun 1999, F. Brekeveld wrote:
> I want everything between the <TR><TD> and </TD></TR> on a separate line
> for further processing
So, you need to parse the HTML. Use HTML::Parser from CPAN. Have fun with
it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 11 Jun 1999 17:30:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Large String handling
Message-Id: <MPG.11cb49e371f0587a989bc8@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <37618538.D0EAC25E@worldonline.nl> on Fri, 11 Jun 1999
23:52:57 +0200, F. Brekeveld <brekevel@worldonline.nl> says...
> I have a very large string with repeated parts, actually it is a HTML
> page, and I want to split it into lines
> how to do that ?
>
> The page looks like:
>
> <TR><TD .........></TD></TR><TR><TD>......</TD></TR>
>
> I want everything between the <TR><TD> and </TD></TR> on a separate line
> for further processing
This gives one long string with separate lines in it:
#!/usr/local/bin/perl -w
use strict;
$_ = '<TR><TD> .........></TD></TR><TR><TD>......</TD></TR>';
my $out = join "\n", m%<TR><TD>(.*?)</TD></TR>%gis, "";
print $out;
__END__
But I think you really want an array containing each of the 'lines',
which is easier:
my @a = m%<TR><TD>(.*?)</TD></TR>%gis;
perldoc perlop
perldoc perlre
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 11 Jun 1999 18:04:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: MIcrosofts Attack on Perl
Message-Id: <slrn7m35s5.37n.abigail@alexandra.delanet.com>
jgrain (jgrain@yahoo.com) wrote on MMCIX September MCMXCIII in
<URL:news:37604888.E297EA75@yahoo.com>:
() What is the current strategy of those at the very top, i.e. those who
() understand, believe and promote open source, particularly in reference
() to its influence on reducing the cost of computing and spreading the net
() of those involved in "serious" computing after the announcement that
() Microsoft will be "hijacking" Perls advantages, for their own commercial
() benefit.
Could you please give a reference where Microsoft announced it will
hijack Perl?
I'm fully aware of the announcement that Microsoft will pay ActiveState
to make Perl a better product on the Windows platform though.
Or are you just distributing FUD as so many others are eager to do?
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 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 5967
**************************************