[16369] in Perl-Users-Digest
Perl-Users Digest, Issue: 3781 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 23 18:05:23 2000
Date: Sun, 23 Jul 2000 15:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964389909-v9-i3781@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 23 Jul 2000 Volume: 9 Number: 3781
Today's topics:
Add data to script with perl and php? <vivekvp@spliced.com>
Callback in SNMP module <mcnuttj@nin.iats.missouri.edu>
Re: cgi and back button? hayati@math.berkeley.edu
Existence of a file on the web server (Scott Cale)
Re: Existence of a file on the web server (Decklin Foster)
Re: Existence of a file on the web server (brian d foy)
golf apocalypse post-mortem? <jbc@west.net>
Re: IO:Socket and Timeout => "5" ? <coy@coystoys.com>
Re: IO:Socket and Timeout => "5" ? <coy@coystoys.com>
iPerl V0.6 now with mod_perl support (de, en & eo) <occitan@esperanto.org>
Re: looking to learn perl tltt@my-deja.com
Re: looking to learn perl <DNess@Home.Com>
Re: Perl 5.* (Abigail)
Re: Perl vs ColdFusion for Database Oriented Project (Abigail)
reading binary and sending it to client browser... <sigmund@easy-net.no>
Re: reading binary and sending it to client browser... aqutiv@my-deja.com
Re: Sending mail with formatted text <dguiney@lineone.net>
Re: Sending mail with formatted text <dguiney@lineone.net>
Re: Setting $/ from variable - accepting meta character kjeldahl@hotmail.com
Re: Setting $/ from variable - accepting meta character <iltzu@sci.invalid>
Re: Setting $/ from variable - accepting meta character aqutiv@my-deja.com
Re: Setting $/ from variable - accepting meta character <bart.lateur@skynet.be>
Thanks <eng80956@nus.edu.sg>
Re: uninitialized variable value? (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 23 Jul 2000 20:12:50 GMT
From: vivekvp <vivekvp@spliced.com>
Subject: Add data to script with perl and php?
Message-Id: <8lfjk0$bl3$1@nnrp1.deja.com>
Hello,
I am actually using PHP script. I need to be able to add ip addresses
and ports.
Is there a way to do this via the web - write it to a perl script then
load it to a php file?
I would lijke to be able to add the info via the web and have it save
to my script so it uses the new addresses added.
I would like a form that would just have a text box for ip address,
then port. You enter it and it would add it to the list below.
If I could do this in perl - that would make me happy. Any help?
Thanks,
V
Here is the form of the data:
$gnutella_server_list = array(
"128.2.244.8"=>"5634",
"130.236.238.25"=>"6346",
"24.112.176.250"=>"6346",
"192.168.100.74" => "22674",
"195.181.8.186"=>"6346",
"208.160.105.41"=>"6346",
"24.66.235.188"=>"6346",
"24.88.72.95"=>"6346",
"24.16.201.87"=>"6346",
"206.207.108.59"=>"6346",
"193.118.193.53"=>"6346",
"24.19.52.63"=>"6346",
"207.43.114.48"=>"6346",
"24.247.195.12"=>"6346",
"193.205.146.12"=>"6346",
"147.52.126.73"=>"6346",
"146.87.1.5"=>"6346",
"128.197.125.42"=>"6346",
"209.136.75.83"=>"6346",
"213.25.216.76"=>"6346",
"130.237.217.175"=>"6346",
"24.5.0.105"=>"6346"
);
--
He who fights and runs away, lives to run another day!
--
He who fights and runs away, lives to run another day!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 Jul 2000 20:48:05 GMT
From: Justin McNutt <mcnuttj@nin.iats.missouri.edu>
Subject: Callback in SNMP module
Message-Id: <8lflm5$53b$1@dipsy.missouri.edu>
Okay, I've looked all over the place (including 'perldoc SNMP' over and
over) and I can't figure out how to do this.
Here's the basic idea:
I want to send a *lot* (~65000) SNMP 'GET's asynchronously, and collect
the data in a hash as it returns. According to the perldoc page for UCDs
SNMP module:
$sess->getnext(<vars> [,<callback>])
do SNMP GETNEXT, multiple <vars> formats accepted,
returns retrieved value(s), <vars> passed as
arguments are updated to indicate next
lexicographical <obj>,<iid>,<val>, and <type>
Note: simple string <vars>,(e.g., 'sysDescr.0') form
is not updated. If <callback> supplied method will
operate asyncronously
And furthermore:
Acceptable callback formats
<callback> may be one of the following forms:
without arguments
\&subname
sub { ... }
or with arguments
[ \&subname, $arg1, ... ]
[ sub { ... }, $arg1, ... ]
[ """"method"""", $obj, $arg1, ... ]
callback will be called when response is received or
timeout occurs. the last argument passed to callback will
be a SNMP::VarList reference. In case of timeout the last
argument will be undef.
&SNMP::MainLoop([<timeout>, [<callback>]])
to be used with async SNMP::Session calls. MainLoop
must be called after initial async calls so return
packets from the agent will not be processed. If no
args suplied this function enters an infinite loop so
program must be exited in a callback or externally
interupted. If <timeout(sic)
Notice that the documentation is cut off there, and there are no examples.
I checked the SNMP.pm module itself, and the docs actually do stop there
(not a quirk in the pod syntax).
I *have* found an example asynch1.pl un the UCD SNMP source tree, but I'm
still trying to make sense of it.
Here's what I'm trying to do (more or less):
[assume MIBs loaded, with $SNMP::use_sprint_value=1 and &initMib() run]
$ip = $ARGV[0]; # Assume 172.16 is given.
$community = $ARGV[1]; # Assume 'public' is given.
$mib = $ARGV[2]; # Assume 'sysDescr' is given.
for ( my $x = 0 ; $x < 256 ; $x++ ) {
for my $y = 0 ; $y < 256 ; $y++ ) {
$fullip = $ip.'.'.$x.'.'.$y
$sess[$x][$y] = new SNMP::Session(
DestHost => $fullip,
Community => $community,
Retries => 1,
Timeout => 1000000); # timeout of 1 sec
$var{$fullip}=$sess[$x][$y]->getnext( **what's here?** );
SNMP::MainLoop();
}
}
# Print out contents of %var here.
So a couple of questions. First, I gather that the 'callback' part needs
to be a subroutine, or otherwise executable block of code. I have not
been able to figure out how to write said code. An example that printed
"foo!" when executed would clear up a lot of things.
Second, what kinds of problems am I going to have if I don't put some sort
of 'sleep 2' somewhere in the 'for $x' loop (outside the 'for $y' loop),
aside from running out of UDP sockets? Consider that 2^16 queries are
being sent here.
Third, how do I know when all of my queries have either timed out or
returned (aside from waiting for one second after the last query)?
Lastly, assuming that I figure the rest of this out, the callback function
is a subroutine of some sort. Is there something glaringly obvious that I
should avoid doing within that code?
Thanks in advance for any insight you might have. I've been banging my
head against the wall on this for quite some time. I'm trying to
eliminate my program's dependence on the scotty 'discover' script (which
does the same thing, asynchronously, but uses Tcl/Tk), improve upon the
original design, and learn something all at once.
--J
------------------------------
Date: Sun, 23 Jul 2000 19:40:00 GMT
From: hayati@math.berkeley.edu
Subject: Re: cgi and back button?
Message-Id: <8lfhmg$a72$1@nnrp1.deja.com>
In article <8kl527$j2k$1@news3.kcnet.com>,
"James Nelson" <james@kcnet.com> wrote:
> Is there a quick or easy way to configure a perl script to trigger
the back
> button on your browser?
Abigail speaks the truth on this matter at:
http://ucan.foad.org/~abigail/HTML/Misc/back_button.html .
KH
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 Jul 2000 13:43:20 -0800
From: uo780@vtn1.victoria.tc.ca (Scott Cale)
Subject: Existence of a file on the web server
Message-Id: <397b58e8@news.victoria.tc.ca>
I need to write a little script that will check a url for the existence of
a file _without_ actually downloading it. The server won't allow directory
listing so I can't just do that :-(
I tried this...
use LWP::Simple;
$url = 'http://www.myserver.com/myfile.exe';
print "File: ", $url, "\n";
if ( head( $url ) ){
print "Exists\n";
} else {
print "DnE\n";
}
But it always says the file's there even when I know that it's not. How
can I get the information I need? Please help
Fair Winds
Scott
-----
Scott Cale
uo780@victoria.tc.ca Canada Rocks! ()_()
Walt Disney World International Program (Canada) 7/95 - 4/96 (_)
------------------------------
Date: 23 Jul 2000 21:19:58 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: Existence of a file on the web server
Message-Id: <8lfnht$4ad38$1@ID-10059.news.cis.dfn.de>
Scott Cale <uo780@vtn1.victoria.tc.ca> writes:
> use LWP::Simple;
>
> $url = 'http://www.myserver.com/myfile.exe';
>
> print "File: ", $url, "\n";
>
> if ( head( $url ) ){
> print "Exists\n";
> } else {
> print "DnE\n";
> }
>
> But it always says the file's there even when I know that it's not. How
> can I get the information I need? Please help
Unfortunately, the answer is ``fix your web server''. I just checked
this with a copy of Boa running on the host I'm sitting at; it works
as expected. My guess is that the server is not using a 404 response
code when it should be.
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: Sun, 23 Jul 2000 17:28:41 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Existence of a file on the web server
Message-Id: <brian-ya02408000R2307001728410001@news.panix.com>
In article <397b58e8@news.victoria.tc.ca>, uo780@vtn1.victoria.tc.ca (Scott Cale) posted:
> use LWP::Simple;
>
> $url = 'http://www.myserver.com/myfile.exe';
>
> print "File: ", $url, "\n";
>
> if ( head( $url ) ){
> print "Exists\n";
> }
> But it always says the file's there even when I know that it's not. How
> can I get the information I need? Please help
see the documentation on the head() function. even if the resource
does not exist, there is still an HTTP response header that is not
undef, 0, or the empty string. thus, it is always true, even if the
status code is 404.
you need to look at the status code and decide what you need to do.
furthermore, you need to use the GET method on failure because some
servers in wide use (that may have been bought by a media giant and
renamed) don't handle HEAD correctly.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Sun, 23 Jul 2000 12:54:45 -0700
From: John Callender <jbc@west.net>
Subject: golf apocalypse post-mortem?
Message-Id: <397B4D85.2C33B808@west.net>
I realize that the subject might still be somewhat painful for
those who labored so hard on setting up the 'Perl Golf
Apocalypse" at TPC, but I'm curious if someone like Uri or Larry
R. would be willing to provide some details on just what it was
that went wrong, such that the event had to be scrubbed. I'm also
curious if there's any chance of reviving it for a future event,
since it certainly gave every indication of being a (potentially)
riotous good time for all concerned, and it would be an awful
shame to let all that hard work go to waste.
Come to think of it, might it be possible to bring it back as a
real-time distributed competition over the net? Since a tool has
apparently been created to automatically score entries for
correct performance of the stated problem, time of submission,
and length of answer, and a set of problems has been generated,
it might not be too much work to put a network interface on it
and run it as a game open to as many participants as chose to
play. It might need to be somewhat slower-paced than the version
attempted at TPC, but it could still be loads of fun, I'd think.
Just wondering.
John
------------------------------
Date: Sun, 23 Jul 2000 21:36:05 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: IO:Socket and Timeout => "5" ?
Message-Id: <9zJe5.8899$Mt.93164@nnrp1.ptd.net>
: Urm.. technically I did, though for some strange reason I sent it as a mail
: rather than a followup. The reason you didn't get it was that your mail
: address bounced ...
yes, it should, because I don't use real information on myself for anything on
the internet, sorry about that :c/
But, thanks for trying anyway :)
------------------------------
Date: Sun, 23 Jul 2000 21:40:04 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: IO:Socket and Timeout => "5" ?
Message-Id: <UCJe5.8901$Mt.93141@nnrp1.ptd.net>
: Its highly possible that in the five hours between your two posts your
: original article hadn't propagated to all of the servers that it might have,
: and consequently hadn't been read by all of the people that might have
: answered you. Then again your question might simply have not been
: interesting to people. Here, on Usenet, patience really is a virtue. If
: you want instant gratification you can chance your arm on IRC, if you want
: consistent reliable solutions to your problems hire a consultant or get
: a support contract.
:
: On the other hand your original problem was already answered in previous
: posts to this group and could have been find with judicious searching at
: Deja News ...
:
: Oh well, glad you sorted it out in the end.
:
: /J\
Actually,
this post was a 'repost' of the original that was sent about a day before,
but anyway, u are correct in saying I should have had more patience..
The newsgroups have been a lifesaver at times for me, and I owe a lot
for the support received here.
But thanks for replying regardless =D
Thanks again
-Coy
------------------------------
Date: Sun, 23 Jul 2000 19:31:53 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: iPerl V0.6 now with mod_perl support (de, en & eo)
Message-Id: <8lfh79$a3q$1@nnrp1.deja.com>
http://beam.to/iPerl (de, en & eo)
http://beam.to/iPerl/ChangeLog.html
Deutsch:
Endlich funktioniert es mit mod_perl und kann auch seinerseits die
Dokumente cachen. Auch ein bequemer Debugger gibt recht viel Auskunft
darüber was iPerl gerde treibt.
Der iPerl Interpreter ist ein transformierender Filter, der wie der C
Präprozessor oder der m4 Makroprozessor funktioniert, nur, daß die
eingebettete Sprache Perl in seiner ganzen Macht ist. Per HTML/XML u.a.
ist dies auch im Internet sehr interessant, wie mitgelieferte Beispiele
zeigen. Man kann es auch als Vorlagenmechanismus sehen oder PODs zum
Leben erwecken oder eliminieren.
Die Webseite kommt automatisch auf Deutsch, wenn Dein Browser so
eingestellt
ist.
English:
Finally it works with mod_perl and can in turn cache the documents it
treats. Also a comfortable debugger gives quite a bit of information
about what iPerl is up to.
The iPerl interpreter is a transforming filter that works much like the
C preprocessor or the m4 macro processor, only that the language
embedded into a document is full powered Perl. With HTML/XML among
others this is also very interesting in web-pages, as included examples
show. You can also see it as a template mechanism or bring PODs alive
or eliminate them.
The web-pages automatically appear in English, if your browser is so
configured.
Esperanto:
Finfine funkcias kun mod_perl kaj povas siavice gardi la dokumentojn jam
traktitajn. Kaj komforta sencimigilo donas sufi^ce da informojn pri
kion iPerl faras.
La iPerl interpretilo estas aliformiga filtrilo kiu funkcias kiel la C
anta^uprocezilo a^u la m4 makroprocezilo, nur ke ^gi enmetebligas
plenpovan Perl en viajn dokumentojn. Kun HTML/XML i.a. tio estas
interesega por TTT-pa^goj, kiel kunliveritaj ekzemploj montras. Oni
povas anka^u ^gin vidi kiel me^hanismo por kompletigi tekstojn.
La pa^garo memstare aperas esperante, se vi tiel instruis vian krozilon.
Daniel Pfeiffer
--
Bring text-docs to life! Erwecke Textdokumente zum Leben!
http://beam.to/iPerl/
Vivigu tekstodokumentojn!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Jul 2000 19:56:34 GMT
From: tltt@my-deja.com
Subject: Re: looking to learn perl
Message-Id: <8lfilg$auq$1@nnrp1.deja.com>
John Callender <jbc@west.net> wrote:
--- snip ---
> Unfortunately, Tom C. is no longer actively involved in this
> newsgroup, nor does he seem to be doing much Usenetting at all,
> at least within the limits of my ability to hunt down his
> writings. I asked him at TPC if there was any chance of his
> coming back here, and the answer was pretty much, "No, not ever.
I haven't been reading this newsgroup for very long, so I don't know the
story. What happened with Tom Christiansen that made him so bitter?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Jul 2000 20:42:53 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: looking to learn perl
Message-Id: <397B58CD.EF35FD39@Home.Com>
tltt@my-deja.com wrote:
>
> I haven't been reading this newsgroup for very long, so I don't know the
> story. What happened with Tom Christiansen that made him so bitter?
>
Consult `Quoting Strategies and the Jeopardy Game', an interminable thread
that will be archived at Deja.
------------------------------
Date: 23 Jul 2000 16:15:24 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Perl 5.*
Message-Id: <slrn8nmkii.vcg.abigail@alexandra.foad.org>
Colin Keith (ckeith@clara.net) wrote on MMDXVIII September MCMXCIII in
<URL:news:mWEe5.11$DT4.1237384@nnrp2.clara.net>:
&& In article <397afb96$0$6098@reader2>, "Roderik Hamers" <Dwarf3@casema.net> wrote:
&& >Does someone know where a can download a Perl complitation program?
&&
&& Er.. Do you mean a program to produce stand alone executables from perl
&& scripts, or a program that executes scripts?
No, no, no. He surely means a program that given an incomplete program
completes the program.
Doesn't Emacs have a keyboard macro for that?
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: 23 Jul 2000 16:59:15 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Perl vs ColdFusion for Database Oriented Project
Message-Id: <slrn8nmn4u.vcg.abigail@alexandra.foad.org>
David Webb (davidwebb@MailAndNews.com) wrote on MMDXVIII September
MCMXCIII in <URL:news:398460DA@MailAndNews.com>:
:: Hi,
::
:: I know that perl is language of choice for CGI but for a database oriented
:: project, what should one use?
That of course entirely depends on the project, and even more on the people.
I always say the biggest reason to use Perl for a project are the people
involved; that's far more important than the project itself. Perl is a
general purpose language, meaning its well suited for many tasks, and
it also means there's hardly any task where Perl is the only suitable
language. But Perl isn't the only language with that feature. Python,
Java, C are other well known general purpose languages.
Perl is written with the human thought process in mind, and less the
compiler or interpreter. It makes the compiler/interpreter bend over
to serve the programmer, and the programmer doesn't have to bend over
to satisfy the compiler. This however divides mankind in four groups.
1) "I know Perl, and I love it".
2) "I know Perl, and I hate it".
3) "I think I know Perl (but I don't really), and I hate it".
4) "I don't know Perl".
If your project has to be done by people from 1), than Perl is very
suited. If your project has to be done by people from 2), pick another
language. If the people in the project are in 4), you would have to
ask yourself whether it's worthwhile to advocate Perl and have people
learn Perl. After all, they might end up in group 2). And if your people
are in group 3), then it probably isn't worthwhile to spend the effort.
:: Can anyone compare the features?
Compare which features with what? Perl has interfaces for most of the
well known databases, but so have most other general purpose languages.
But maybe you don't even want a general purpose language, but a special
domain language. SQL for instance.
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Sun, 23 Jul 2000 21:40:41 +0200
From: "Sigmund Straumland" <sigmund@easy-net.no>
Subject: reading binary and sending it to client browser...
Message-Id: <8lfhhs$br3$1@news.ost.eltele.no>
I'm trying to make a Perl/CGI-script which reads image files from my servers
harddrive and sends them to the clients browser. This might be a CGI problem
but I believe the problems lies in my Perl code.
#!c:\perl\bin\perl.exe
open(FILE, "<c:/apache/serverroot/sok.gif");
binmode(FILE);
read(FILE, $picture, (-s "c:/pache/serverroot/sok.gif"));
close(FILE);
print "Content-type: image/gif\n\n";
print $picture; # I suspect my problem lies here...
With this code the image apears as gibberish. If my assumption is right and
I have to use another command to send the picture, what is it, or where can
I find it in the documentation?
I run Apache on Win98se environment.
Sigmund S.
sigmund@easy-net.no
------------------------------
Date: Sun, 23 Jul 2000 20:28:58 GMT
From: aqutiv@my-deja.com
Subject: Re: reading binary and sending it to client browser...
Message-Id: <8lfki8$c44$1@nnrp1.deja.com>
In article <8lfhhs$br3$1@news.ost.eltele.no>,
"Sigmund Straumland" <sigmund@easy-net.no> wrote:
> I'm trying to make a Perl/CGI-script which reads image files from my
servers
> harddrive and sends them to the clients browser. This might be a CGI
problem
> but I believe the problems lies in my Perl code.
>
> #!c:\perl\bin\perl.exe
> open(FILE, "<c:/apache/serverroot/sok.gif");
> binmode(FILE);
> read(FILE, $picture, (-s "c:/pache/serverroot/sok.gif"));
> close(FILE);
> print "Content-type: image/gif\n\n";
> print $picture; # I suspect my problem lies here...
>
> With this code the image apears as gibberish. If my assumption is
right and
> I have to use another command to send the picture, what is it, or
where can
> I find it in the documentation?
>
> I run Apache on Win98se environment.
>
> Sigmund S.
> sigmund@easy-net.no
>
I'm not sure... But I think you also need to binmode(STDOUT);
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Jul 2000 20:36:56 +0100
From: "David Guiney" <dguiney@lineone.net>
Subject: Re: Sending mail with formatted text
Message-Id: <8lfhg6$6m2$1@supernews.com>
Thank you very much. This is exactly what I was looking for and it worked a
treat!!
David
Nnickee <nnickee@nnickee.com> wrote in message
news:AA4ADA60E0BC2EE3.6AA0D1D36E5844AC.039748F4BC649736@lp.airnews.net...
> On Sun, 23 Jul 2000 12:37:27 +0100, someone claiming to be "David
> Guiney" <dguiney@lineone.net> said:
>
> >I am witten a script to send out mail to recipients in a mailing list but
so
> >far the message body is simple text.
>
> >Can anybody give me any pointers on spicing this up a bit ie.
> >bold,italics,font size etc. Can I use HTML format - if so what changes
would
> >I need to make?
>
> You sure can.
>
> Change your message body to html format (start it with <html> ....
> whatever ... <tags> .... </html>
>
> And add a couple more headers into the header section of the email
>
> (the following works with NET::SMTP:
>
> $smtp->datasend("Content-Type: text/html\n");
> $smtp->datasend("Content-Transfer-Encoding: 7-bit\n");
>
> )
>
>
> HTH
> Nnickee
>
------------------------------
Date: Sun, 23 Jul 2000 20:38:42 +0100
From: "David Guiney" <dguiney@lineone.net>
Subject: Re: Sending mail with formatted text
Message-Id: <8lfhjf$bd9$1@supernews.com>
Thanks for the reply. I should have mentioned that I was using a perl script
with the NET:smtp module!
It was the content type in the header I didn't know about but have got it
working now using HTML.
Thanks again,
David
Colin Keith <ckeith@clara.net> wrote in message
news:PfBe5.4$DT4.1208715@nnrp2.clara.net...
> In article <8leld4$ld5$1@supernews.com>, "David Guiney"
<dguiney@lineone.net> wrote:
> >I am witten a script to send out mail to recipients in a mailing list but
so
> >far the message body is simple text.
> >
> >Can anybody give me any pointers on spicing this up a bit ie.
> >bold,italics,font size etc. Can I use HTML format - if so what changes
would
> >I need to make?
>
> *searches down the back of the sofa for the relevance to this group* :)
> (best I can come up with)
>
> Perl's print and printf statements will allow you to print any characters
> you want though if you are using text that contains double quotation
marks,
> you need to remember to escape them, ala \", (assuming you're double quote
> enclosing your text so you can use embedded variables and newline
> characters, I.e ("Dear $name,\n")
>
> If you want to use HTML you may find that the CGI module will be helpful
for
> URL encoding of strings and the addition of MIME attachments can be
handled
> by MIME::* modules. (Remember that send HTML in e-mails should only be
done
> if you're recipients are able to handle it HTML looks icky in a mail
program
> that doesn't decode it, and doubles the size of the mail for no reason.)
>
> You may also want to use the Mail::Sendmail module to send your mail ...
>
> But that's about the closest that perl gets to your question. Yes, you can
> send anything you want but this isn't the group to ask about that, its the
> forum to ask for help with problems you're encountering doing so. (Once
> you've read the FAQ's of course)
>
> Col.
>
>
> ---
> Colin Keith
> Systems Administrator
> Network Operations Team
> ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 23 Jul 2000 19:15:34 GMT
From: kjeldahl@hotmail.com
Subject: Re: Setting $/ from variable - accepting meta characters
Message-Id: <8lfg8k$9d7$1@nnrp1.deja.com>
In article <8lfaoo$5rj$1@nnrp1.deja.com>,
aqutiv@my-deja.com wrote:
>
> This has to work:
> my $sep = '\n';
> $sep = eval qq("$sep");
> $/ = $sep;
> print "[$/]\n";
Yes it does. Thanks for the tip!
Marius
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 Jul 2000 19:43:27 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Setting $/ from variable - accepting meta characters
Message-Id: <964381101.27838@itz.pp.sci.fi>
In article <8lfaoo$5rj$1@nnrp1.deja.com>, aqutiv@my-deja.com wrote:
>This has to work:
>my $sep = '\n';
>$sep = eval qq("$sep");
>$/ = $sep;
>print "[$/]\n";
That's a bad idea unless you really trust the input..
my $sep = '@{[`rm -rf *`]}';
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Sun, 23 Jul 2000 20:19:03 GMT
From: aqutiv@my-deja.com
Subject: Re: Setting $/ from variable - accepting meta characters
Message-Id: <8lfjvl$bnq$1@nnrp1.deja.com>
In article <964381101.27838@itz.pp.sci.fi>,
Ilmari Karonen <usenet11161@itz.pp.sci.fi> wrote:
> In article <8lfaoo$5rj$1@nnrp1.deja.com>, aqutiv@my-deja.com wrote:
> >This has to work:
> >my $sep = '\n';
> >$sep = eval qq("$sep");
> >$/ = $sep;
> >print "[$/]\n";
>
> That's a bad idea unless you really trust the input..
>
> my $sep = '@{[`rm -rf *`]}';
>
> --
> Ilmari Karonen - http://www.sci.fi/~iltzu/
> "The screwdriver *is* the portable method." -- Abigail
> Please ignore Godzilla and its pseudonyms - do not feed the troll.
>
>
Ooooops. hrrrm, Good point. :) forget I've ever said anything.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Jul 2000 21:16:10 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Setting $/ from variable - accepting meta characters
Message-Id: <j2omns4l6mblceuh4d700ro21hmhptog9q@4ax.com>
kjeldahl@hotmail.com wrote:
>I have an input field, where I want to accept meta characters such as \n
>and \t, but also normal characters. If I type the "\n" string in my
>input field, how can I assign the interpolated value of that string to
>$/?
%replace =( 'n' => "\n", 't' => "\t", # ...
);
s/\\(.)/$replace{$1} || $1/ge;
--
Bart.
------------------------------
Date: Mon, 24 Jul 2000 02:13:57 +0800
From: Murlimanohar Ravi <eng80956@nus.edu.sg>
Subject: Thanks
Message-Id: <22E71DAEC504D111B78100805FFE9DC73C04D147@pfs21.ex.nus.edu.sg>
Thank you for your responses, guys. Working on it now!
Murli.
-----Original Message-----
From: nobull@mail.com [mailto:nobull@mail.com]
Sent: Friday, July 21, 2000 7:16 PM
Posted To: comp.lang.perl.misc
Conversation: Perl newbie requests help with CGI/Perl
Subject: Re: Perl newbie requests help with CGI/Perl
Murlimanohar Ravi <eng80956@nus.edu.sg> writes:
> For some reason, when I click the Submit button, the browser only
> displays the source of the Perl file not the desired HTML output. How
> should I resolve this?
Configure you web server correctly. This has nothing whatever to do
with Perl.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 23 Jul 2000 16:10:27 EDT
From: abigail@foad.org (Abigail)
Subject: Re: uninitialized variable value?
Message-Id: <slrn8nmk9d.vcg.abigail@alexandra.foad.org>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote on MMDXVIII September MCMXCIII in
<URL:news:8lev5o$3lp$1@pegasus.csx.cam.ac.uk>:
.. Abigail <abigail@foad.org> wrote:
.. >M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote on MMDXVII September MCMXCIII in
.. ><URL:news:8lc8nj$6ir$1@pegasus.csx.cam.ac.uk>:
.. >() Abigail <abigail@foad.org> wrote:
.. >() >
.. >() >Here's one way to test it:
.. >() >
.. >() > eval 'local $^W = 1; "$certain_variable"';
.. >() > if ($@ =~ /^Use of uninitialized value in string/) {
.. >() > # Value is unitialized
.. >() > }
.. >()
.. >() Eh? What are you expecting to see in $@ ?
.. >
.. >Did you try?
..
.. Yes, I did. And it generates a message to STDERR and doesn't set $@.
Hmmm, I wonder how I tricked myself.
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3781
**************************************