[10085] in Perl-Users-Digest
Perl-Users Digest, Issue: 3678 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 10 12:08:07 1998
Date: Thu, 10 Sep 98 09:00:26 -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 Thu, 10 Sep 1998 Volume: 8 Number: 3678
Today's topics:
Automate change of remote user's password <Richmont.Sy@exchange.sms.siemens.com>
Re: Automate change of remote user's password <eashton@bbnplanet.com>
CGI posting to CGI on SSL... <frejos@cswnet.com>
Re: CGI posting to CGI on SSL... (Steve Linberg)
Re: CGI posting to CGI on SSL... <frejos@cswnet.com>
Checking errorlevel of external program (RonBo)
Re: Code to Check for acceptable file type (Abigail)
Help! WinNT/95 question re: benchmark.pm <mattg@alum.mit.edu>
Re: History of Perl - round 1 <jdporter@min.net>
Hull/York Perl Mongers? <dan@fearsome.net>
library (Robert)
Need help with setting up a Form processor <P_Chatterjee@mgmt.purdue.edu>
Objects & type checking <mark@satch.markl.com>
Re: Off topic, but ... [Was Re: Perl & Java - differenc <jimbo@soundimages.co.uk>
Outputing Shell command to Web Page <root@kam.xvi.com>
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses (David Cantrell)
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: PERL newbie needs some help dave@mag-sol.com
Re: Perl Programmer Needed <jdporter@min.net>
Re: Perl/Html - mixing text and graphics (Dermot McKay)
Re: Perl/Html - mixing text and graphics (David A. Black)
Re: Perl/Html - mixing text and graphics <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Perl/Html - mixing text and graphics (Larry Rosler)
perl/msql script doesn;t work when called from web page nospam.ajm@antopia.com
Re: pop3 as http <l.brocard@elsevier.nl>
Re: problem with recursion in perl (Dermot McKay)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Sep 1998 10:00:00 -0400
From: Rich Sy <Richmont.Sy@exchange.sms.siemens.com>
Subject: Automate change of remote user's password
Message-Id: <35F7DB60.3466@exchange.sms.siemens.com>
I need to periodically change the password of a remote user. I wanted to
automated the change, ie. every week with password randomly generated or
cycled, etc.
Any idea is very much appreciated.
(I can think of using Expect but this require Tcl which is not available
in our system and will not be available. We have Perl and I think I can
use Comm.pl or Net::Telnet).
Rich :)
Richmont.Sy@exchange.sms.siemens.com
------------------------------
Date: Thu, 10 Sep 1998 14:37:30 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Automate change of remote user's password
Message-Id: <35F7E1CC.2DB262B9@bbnplanet.com>
Rich Sy wrote:
>
> I need to periodically change the password of a remote user. I wanted to
> automated the change, ie. every week with password randomly generated or
> cycled, etc.
Well, define remote user. Is the person or the machine remote? If the
person is remote and you merely wish to force the user to change their
password periodically, then try changing /etc/default/passwd (for
solaris) to the timespan you wish. Otherwise, you could use NIS+/YP (no
hissing here folks). There are already a lot of ways to do this without
Perl.
> (I can think of using Expect but this require Tcl which is not available
> in our system and will not be available. We have Perl and I think I can
> use Comm.pl or Net::Telnet).
If you do go the way or rsh and telnet consider the security
implications first.
e.
------------------------------
Date: Thu, 10 Sep 1998 10:14:30 -0500
From: Josh Freeman <frejos@cswnet.com>
Subject: CGI posting to CGI on SSL...
Message-Id: <35F7ECD6.9C87DA2A@cswnet.com>
<HTML>
Forgive me if this appears twice, I'm not sure if it got through the first
time.
<P>Thanks everyone for your help.
<P>Here is the completed subroutine that accomplishes my task.
<P><A HREF="http://www.web-smiths.com/testing/frm-rd.lib">http://www.web-smiths.com/testing/frm-rd.lib</A>
<P>I have however ran into another problem. I now realize that the
second
<BR>CGI program is on a SSL (https) server, are there any Perl functions
out
<BR>there that will help me with the SSL part of my problem?
<P>To recap the problem: I need to take the POST infromation to one
CGI
<BR>program and POST it to another CGI program that is on a SSL server.
The
<BR>subroutine I have written works fine on non-secure systems.
<P>Josh Freeman
<BR>frejos@cswnet.com
<BR> </HTML>
------------------------------
Date: Thu, 10 Sep 1998 11:40:13 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: CGI posting to CGI on SSL...
Message-Id: <linberg-1009981140130001@ltl1.literacy.upenn.edu>
In article <35F7ECD6.9C87DA2A@cswnet.com>, Josh Freeman
<frejos@cswnet.com> wrote:
> <HTML>
FWIW, you'll get much better results if you don't post in HTML. It's hard
to read.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Thu, 10 Sep 1998 10:44:19 -0500
From: Josh Freeman <frejos@cswnet.com>
Subject: Re: CGI posting to CGI on SSL...
Message-Id: <35F7F3D3.8F7554B7@cswnet.com>
Sorry, I didn't realize that I was posting as HTML. Please, everyone
accept my appoligies.
Josh Freeman
Steve Linberg wrote:
> > <HTML>
>
> FWIW, you'll get much better results if you don't post in HTML. It's hard
> to read.
------------------------------
Date: Thu, 10 Sep 1998 14:56:45 GMT
From: snorjb@wnt.sas.com (RonBo)
Subject: Checking errorlevel of external program
Message-Id: <35f7e70f.93306453@newshost.unx.sas.com>
Can someone show me how to get the errorlevel that is returned when I
run an external program from withing PERL? I need to set a PERL
variable equal to the errorlevel that this DIALCHECK.EXE program
returns.
This snippet seems cumbersome: Is there an easier way?
$cmd = "\\caryntpdc\netlogon\dialcheck.exe";
@all = `($cmd | perl -e 's/^/stdout: /' ) 2>&1`;
for (@all) { push @{ s/stdout: // ? \@outlines : \\@errlines }, $_ }
print "STDOUT:\n", @outlines, "\n";
print "STDERR:\n", @errlines, "\n";
DIALCHECK.EXE is written in C++
I use to do it like this :
dialcheck.exe
if %ERRORLEVEL% == 0 set dialup=yes
if %ERRORLEVEL% == 3 set dialup=no
------------------------------
Date: 10 Sep 1998 15:49:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Code to Check for acceptable file type
Message-Id: <6t8sed$otj$1@client3.news.psi.net>
Martin Gregory (mgregory@asc.sps.mot.com) wrote on MDCCCXXXV September
MCMXCIII in <URL: news:r84sug6gwo.fsf@asc.sps.mot.com>:
++ abigail@fnx.com (Abigail) writes:
++
++ >
++ > { local $" = '|';
++ > $string =~ /\.(?:@{[map {quotemeta} @array]})$/o;
++ > }
++
++ Damn thats neat.
++
++ Why the (?: though?
++
Small optimization. (?: ) won't set a backreference, ( ) will.
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;}'
------------------------------
Date: Thu, 10 Sep 1998 10:54:47 -0500
From: Matt Giamporcaro <mattg@alum.mit.edu>
Subject: Help! WinNT/95 question re: benchmark.pm
Message-Id: <35F7F646.B19A24D0@alum.mit.edu>
I'm relatively new to the Perl scene, and I am having problems using the
Benchmark module to measure the efficiency of some algorithms, using
timeit(), timethis(), etc. For example, when I try the following:
$t0 = new Benchmark;
[myCodeHere]
$t1 = new Benchmark;
$td = &timediff($t1, $t0);
print "blah blah blah: ", ×tr($td), "\n";
I get the error message: "times not implemented at Benchmark.pm line
274".
The line in question (#274) indicated reads:
sub new { my(@t) = (time, times); print "new = @t\n" if $debug;
bless \@t; }
I have the same problem when I try to use timeit() and $timethis(). Is
it possible that the WinNT port doesn't support the times() function? Do
I have to throw out my Microsoft products and use a real OS? Can anyone
suggest a better course of action?
Thanks,
Matt Giamporcaro
mattg@alum.mit.edu
------------------------------
Date: Wed, 09 Sep 1998 10:59:51 -0400
From: John Porter <jdporter@min.net>
Subject: Re: History of Perl - round 1
Message-Id: <35F697E7.68CFC51D@min.net>
Elaine -HappyFunBall- Ashton wrote:
>
> Well, actually, having been a UNIX dork for the last oh-so-many aeons, I
> like not having to reach for that damn 'Shift' key. I generally type
> from a stream of consciousness (or lack thereof) so I could really care
> less about a capital letter here or there.
You're deluding yourself if you think you're avoiding capitals for any
reason other than "style". Because I haven't seen any scarcity of
:"<>?~!@#$%^&*()_+{}| characters in your writing (all of which, you
know, require the use of the Shift key -- at least on most std kbds.)
John P orter
------------------------------
Date: Thu, 10 Sep 1998 15:06:08 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: Hull/York Perl Mongers?
Message-Id: <905436303.14777.0.nnrp-07.c2deb1c5@news.demon.co.uk>
I am a completely lurking/non-active pseudo-member of London Perl Mongers
who has been unable to attend any meetings because I spend half my life at
Hull University.
There isn't a Hull/York Perl Mongers that I know of - is there sufficient
interest to start one?
If anyone lives in the Hull/York area, or even goes to University there,
send me an email, and I'll see if there is enough support to warrant trying
to set one up.
Thanks,
--
Dan Adams
dan@fearsome.net
------------------------------
Date: Thu, 10 Sep 1998 15:19:22 GMT
From: colte@hem.passagen.se (Robert)
Subject: library
Message-Id: <35f7eb4d.30376660@news.hogia.net>
Hi
I'm trying to do a library, but things aint going to well.
Here is my problem.
I want a subroutine that prints out some html.
This subroutine should be in a file called "intranet.lib"
and it look like this:
# Intranet Subroutines
sub Return_HTML {
print "content-type: text/html\n\n";
local ($title, $headline, $text) = @_;
print<<end;
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'>
<HTML>
<HEAD>
<TITLE>$title</TITLE>
<LINK REL=STYLESHEET HREF="/global.css" TYPE="text/css">
<META NAME="author" content="Robert Lindgren, Stockholms
Handelskammare">
<META name="generator" content="Super NoteTab">
<BODY>
<H1 CLASS="headline">$headline</H1>
<P>$text</P>
</BODY>
</HTML>
end
}
When I call this from the main script like this:
&Return_HTML("Done", "You are ready", "this is only a test");
I get the following error message:
intranet.lib did not return a true value
It works fine if I put the same subroutine in the main script.
I also stated
require "intranet.lib";
in the main script
What am I doing wrong here?
Thanks in advance
Robert
------------------------------
Date: Thu, 10 Sep 1998 10:45:54 -0500
From: Priyo Chatterjee <P_Chatterjee@mgmt.purdue.edu>
Subject: Need help with setting up a Form processor
Message-Id: <35F7F432.6D427325@mgmt.purdue.edu>
Hi,
I've downloaded a FormProcessing script from the web but am having
trouble making it work. Basically, what I want it to do is to write the
form input into a database.
I'd appreciate any help in this regard.
Priyo
URLs: http://expert.cc.purdue.edu/~priyo/form_processor.htm
http://expert.cc.purdue.edu/~priyo/cgi-bin/form_processor.pl
------------------------------
Date: 10 Sep 1998 11:24:56 -0400
From: Mark Lehrer <mark@satch.markl.com>
Subject: Objects & type checking
Message-Id: <m31zpkhtx3.fsf@satch.markl.com>
Hello. I am new to using perl objects (i've read the simple docs
on cpan about a dozen times each and implemented a few classes).
My question: how can I best implement type checking? In particular, I
am used C++ and having the same function name with several different
sets of arguments.
In order to do this in Perl, do I have to do something really painful
like going through the @ISA array for each argument? Yuck.
Thanks!
Mark
------------------------------
Date: 10 Sep 1998 16:50:08 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Off topic, but ... [Was Re: Perl & Java - differences and uses]
Message-Id: <uemtkm0gf.fsf@jimbosntserver.soundimages.co.uk>
Randal Schwartz <merlyn@stonehenge.com> writes:
>
> Last year in Oregon, Summer fell on a *tuesday*. That was it. One
> day. Big shiny thing in the sky. Some people thought it was a UFO.
> And Oregonians don't tan in the summer... they *rust*.
That was one long summer. Here, we had summer fall on a thursday. By
noon autumn had arrived. At least you rust. Here we never get dry
enough to rust.:)
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: Thu, 10 Sep 1998 14:45:27 GMT
From: Jean-Francois Doyon <root@kam.xvi.com>
Subject: Outputing Shell command to Web Page
Message-Id: <Pine.LNX.3.96.980910104001.3696E-100000@kam.xvi.com>
I've been trying to output the results of a shell command to the web,
unsuccessfully.
The text appears, but the variables show up as blank. If I I just run the
script from the shell, all is well, but if i set it up to output to teh
web .. nada !
Here's the code, what am I doing wrong ? Or does Apache need special
configuration to allow this ? Hummm, I should look into that ...
#!/usr/bin/perl
use CGI qw(:standard);
$cda="/usr/X11R6/bin/cda";
open (CDA, "$cda toc|");
($dummy,$data) = split /:\s/,<CDA>;
($type,$id) = split / /,$data;
($artist,$album) = split /\s\/\s/,<CDA>;
chop $album;
close (CDA);
print header();
print p("Artist : $artist - Album : $album");
print end_html();
Thanks for any help I can get !
J.F.
------------------------------
Date: Wed, 09 Sep 1998 10:28:59 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35F690AB.EC162BE1@min.net>
George Reese wrote:
>
> I have never heard anyone argue that Perl must be the
> best language since if you look at the world you can see Perl in every
> tree and blade of grass.
Then allow me the honor of being the first to do so.
John Porter
------------------------------
Date: Thu, 10 Sep 1998 14:15:42 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <iaRJ1.628$E9.2271052@ptah.visi.com>
In comp.lang.java.programmer David Cantrell <NukeEmUp@ThePentagon.com> wrote:
: On Thu, 10 Sep 1998 00:53:00 GMT,
: George Reese <borg@imaginary.com> enlightened us thusly:
:>Perl has no real use. If you have to do scripting or text processing,
:>use Python. Otherwise, use Java.
: Care to back that up?
Well, simple:
Anything that can be done in Perl can by done in Python more easily.
And you can actually read and maintain the Python code.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Wed, 09 Sep 1998 10:35:26 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35F6922E.1726B62E@min.net>
George Reese wrote:
>
> David Cantrell <NukeEmUp@ThePentagon.com> wrote:
> : George Reese <borg@imaginary.com> enlightened us thusly:
>
> :>Perl has no real use. If you have to do scripting or text processing,
> :>use Python. Otherwise, use Java.
>
> : Care to back that up?
>
> Anything that can be done in Perl can by done in Python more easily.
That's not "backing it up", that's another dangling allegation.
It sounds an awful lot like a religious assertion, which I would
not have expected from you, based on statements you have made
elsewhere in this thread.
> And you can actually read and maintain the Python code.
No I can't. But I *can* read and maintain Perl code.
It's all a matter of what language(s) one already knows.
--
John Porter
------------------------------
Date: Thu, 10 Sep 1998 14:48:53 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <pFRJ1.634$E9.2309187@ptah.visi.com>
In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
: George Reese wrote:
:>
:> David Cantrell <NukeEmUp@ThePentagon.com> wrote:
:> : George Reese <borg@imaginary.com> enlightened us thusly:
:>
:> :>Perl has no real use. If you have to do scripting or text processing,
:> :>use Python. Otherwise, use Java.
:>
:> : Care to back that up?
:>
:> Anything that can be done in Perl can by done in Python more easily.
: That's not "backing it up", that's another dangling allegation.
: It sounds an awful lot like a religious assertion, which I would
: not have expected from you, based on statements you have made
: elsewhere in this thread.
Nonsense. It is actually a really easily testable hypothesis. My
claim is so sweeping, all you need to do is come up with a single
situation in which Perl accomplishes a task easier.
:> And you can actually read and maintain the Python code.
: No I can't. But I *can* read and maintain Perl code.
: It's all a matter of what language(s) one already knows.
No, it is not. First of all, the 'you' above was 'you' in the generic
sense. One of the measures of a successful language is how easy it is
for people to pick it up and also for how easy it is for those who
know the language to read legacy code. Perl is notoriously bad on
this count. To compound its horrid syntax, it also has the single
nastiest OO paradigm I have ever seen in a programming language.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Thu, 10 Sep 1998 15:30:01 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl & Java - differences and uses
Message-Id: <35f8f012.80816497@thunder>
On Thu, 10 Sep 1998 14:15:42 GMT,
George Reese <borg@imaginary.com> enlightened us thusly:
>In comp.lang.java.programmer David Cantrell <NukeEmUp@ThePentagon.com> wrote:
>: On Thu, 10 Sep 1998 00:53:00 GMT,
>: George Reese <borg@imaginary.com> enlightened us thusly:
>
>:>Perl has no real use. If you have to do scripting or text processing,
>:>use Python. Otherwise, use Java.
>
>: Care to back that up?
>
>Anything that can be done in Perl can by done in Python more easily.
>And you can actually read and maintain the Python code.
No doubt a COBOL programmer would make a similar assertion about COBOL
being better than Python.
Do you have any _real_ arguments?
--
David Cantrell, part-time NT/java/SQL techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Thu, 10 Sep 1998 15:40:07 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <rpSJ1.656$E9.2338237@ptah.visi.com>
In comp.lang.java.programmer David Cantrell <NukeEmUp@ThePentagon.com> wrote:
: On Thu, 10 Sep 1998 14:15:42 GMT,
: George Reese <borg@imaginary.com> enlightened us thusly:
:>In comp.lang.java.programmer David Cantrell <NukeEmUp@ThePentagon.com> wrote:
:>: On Thu, 10 Sep 1998 00:53:00 GMT,
:>: George Reese <borg@imaginary.com> enlightened us thusly:
:>
:>:>Perl has no real use. If you have to do scripting or text processing,
:>:>use Python. Otherwise, use Java.
:>
:>: Care to back that up?
:>
:>Anything that can be done in Perl can by done in Python more easily.
:>And you can actually read and maintain the Python code.
: No doubt a COBOL programmer would make a similar assertion about COBOL
: being better than Python.
: Do you have any _real_ arguments?
That is a _real_ argument and it is easy to refute if it is not true.
Specifically, as much as Perl and C lovers love to argue that
readability is subjective, it is only slightly so. And readability is
key to maintainability. And while some COBOL programmers might
attempt to argue it is readable, it is certainly not maintainable for
other reasons.
The refutation of my argument is simple. Show an example of a
function that Perl does well which Python is either incapable of doing
or incapable of doing well.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Thu, 10 Sep 1998 15:24:49 GMT
From: dave@mag-sol.com
Subject: Re: PERL newbie needs some help
Message-Id: <6t8r01$2b6$1@nnrp1.dejanews.com>
Duncan,
Best advice here would be to stop trying to reinvent the CGI wheel
(presumeably in a somewhat less than entirely circular manner) and use CGI.pm
which came with your Perl distribution.
This will massively reduce the size and complexity of your code and make bug
finding much easier.
hth,
Dave...
In article <01bddcae$e27ceca0$18646464@duncan.b>,
"Duncan Bates" <duncan.b@marchcom.co.uk> wrote:
> Umm sorry for being stupid here but i have some code thats really bugging
> me...
>
> a syntax error is reported although i have done everything "to the book"
>
> #!/usr/bin/perl
>
> $printrun = $FORM{'printrun'};
> $pages = $FORM{'pages'};
> $coverpics = $FORM{'coverpics'};
> $textpics = $FORM{'textpics'};
>
> # Parse the form
> &parse_form;
>
> {
> # Get the input
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
> # Split the name-value pairs
> @pairs = split(/&/, $buffer);
>
> foreach $pair (@pairs)
> {
> ($name, $value) = split(/=/, $pair);
>
> # Un-Webify plus signs and %-encoding
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $value =~ s/<!--(.|\n)*-->//g;
>
> $FORM{$name} = $value;
> }
> }
>
> # Check for zero entries
> unless ($printrun == 0) { &html_die; }
>
> # Limit the values
> if ($printrun < 1000 || $printrun > 100000) { &html_die; }
>
> # Work out the cost of printing the report
> $a = (($pages) * ($printrun))
>
> # Work out calculations for cover and textpics
>
> if (($textpics == "0") && ($coverpics == "1")) {
> $b = ($a * 1.25);
> }
> elsif (($textpics == "1") && ($coverpics == "0")) {
> $b = ($a * 1.25);
> }
> elsif (($textpics == "1") && ($coverpics == "1")) {
> $b = ($a * 1.25);
> }
> else (($textpics == "0") && ($coverpics == "0")) {
> $b = ($a * 1.35);
> }
>
> this is supposed to take some figures (printrun) and multiply them with
> another set of figures (pages) then work out the final calcualtion based on
> whether they want cover pics text pics or both or neither...
>
> its really got me stumped i'd appreciate any hints in the right direction
>
> Thanks
>
> Duncan Bates
> duncan.b@marchcom.co.uk
>
>
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 09 Sep 1998 10:52:54 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Programmer Needed
Message-Id: <35F69646.2461C7BA@min.net>
Bravo, Faust, for an excellent, well-reasoned article.
Faust Gertz wrote:
>
> ... DARPA (the Defense
> Advanced Research Projects Agency, now ARPA since the decoupling from
> the Department of Defense).
Actually it's DARPA again, don't cha know.
And I don't think the agency was ever "decoupled" from the DoD;
the name was changed for political purposes, ostensibly because
it was serving the needs of other departments and agencies besides
the DoD.
John Porter
------------------------------
Date: Thu, 10 Sep 1998 14:37:59 GMT
From: MCKAYD@aplbt1.agw.bt.co.uk (Dermot McKay)
Subject: Re: Perl/Html - mixing text and graphics
Message-Id: <6t8oid$4ub$2@pheidippides.axion.bt.co.uk>
In article <6t7n74$3o$1@artemis.backbone.ou.edu>, dogboy@doghouse.com wrote:
>All this works great until I try to add a map to $AREA. I add the following
>and Perl generates an error.
>
> print("<img src="/images/bitmaps/%s.gif" width=400 height=250>",$AREA);
>
Try print("<img src=\"/images/bitmaps/%s.gif\" width=400 height=250>",$AREA);
Ok Dermot
------------------------------
Date: Thu, 10 Sep 1998 10:35:23 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: Perl/Html - mixing text and graphics
Message-Id: <6t8o3b$io1$1@earth.superlink.net>
dogboy@doghouse.com writes:
> while(<ADDRESS>) {
> ($AREA,$ADMINISTRATOR,$ADDRESS,$PHONE) = split(':',$_);
or just: split ':';
>All this works great until I try to add a map to $AREA. I add the following
>and Perl generates an error.
> print("<img src="/images/bitmaps/%s.gif" width=400 height=250>",$AREA);
Well, ummm, you're doing some weird things with quotation marks there.
Also, is the %s supposed to be a printf format specifier? If so, best to
use printf.... However, you could do what (I think) you want with:
print "<img src=\"/images/bitmaps/$AREA.gif\" width=400 height=250>";
David Black
dblack@saturn.superlink.net
------------------------------
Date: 10 Sep 1998 16:48:01 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Perl/Html - mixing text and graphics
Message-Id: <83yarst466.fsf@vcpc.univie.ac.at>
Re: Perl/Html - mixing text and graphics, David
<dblack@saturn.superlink.net> said:
David> dogboy@doghouse.com writes:
>> while(<ADDRESS>) { ($AREA,$ADMINISTRATOR,$ADDRESS,$PHONE)
>> = split(':',$_);
David> or just: split ':';
>> All this works great until I try to add a map to $AREA.
>> I add the following and Perl generates an error.
>> print("<img src="/images/bitmaps/%s.gif" width=400
>> height=250>",$AREA);
David> Well, ummm, you're doing some weird things with
David> quotation marks there.
David> Also, is the %s supposed to be a printf format
David> specifier? If so, best to use printf.... However,
David> you could do what (I think) you want with:
David> print "<img src=\"/images/bitmaps/$AREA.gif\"
David> width=400 height=250>";
or
use CGI;
print img({src => "/images/bitmaps/$AREA.gif",
width => 400,
height => 250
});
and not have to worry about mixing and matching quotes for
generating the underlying syntax...
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Thu, 10 Sep 1998 08:01:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl/Html - mixing text and graphics
Message-Id: <MPG.106189a290127faa989841@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6t7n74$3o$1@artemis.backbone.ou.edu> on Thu, 10 Sep 1998
13:07:45 GMT, dogboy@doghouse.com <dogboy@doghouse.com> says...
...
> print("<img src="/images/bitmaps/%s.gif" width=400 height=250>",$AREA);
Three problems here:
Syntax: Double-quotes in double-quoted string.
Semantics: You are using the functionality of 'printf', not 'print'.
Idiom: Avoid all-upper-case identifiers unless they are constants.
printf('<img src="/images/bitmaps/%s.gif" width=400 height=250>', $area);
But as all you are doing with this is a simple string-interpolation, why
not simply interpolate:
print qq(<img src="/images/bitmaps/$area.gif" width=400 height=250>);
Now you *need* double-quotes, so I have used an alternate form.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 10 Sep 1998 14:00:42 GMT
From: nospam.ajm@antopia.com
Subject: perl/msql script doesn;t work when called from web page
Message-Id: <6t8m2a$rb9$1@nnrp1.dejanews.com>
Hi:
I got the perl scripts for Msql.pm on my $15/month ISP and got some sample
scripts going. Everything works great when I run the script from the shell,
I can read and write data to my database fine. However, when I run the same
script from the web page it won't connect, I get the error trap message I set
up. Is there something I'm missing? Or do I need to ask the ISP to enable
the permissions somehow for the database to allow it to be accessed from the
web page?
Please help! The following script prints "database open" when called from the
shell and "dammit" when called online.
Anthony
#!/usr/bin/perl -w
#
# ex1.pl: Written by Alligator Descartes
require "Msql.pm";
require "ant-lib.cgi";
&PrintHeader;
$host="oceanus";
$database="members";
if ($dbh=Msql->Connect($host,$database))
{print "Database open!<P>\n";}
else {print "Dammit!<P>\n";}
#$str="CREATE TABLE test (memberno char(7) not null, email char(20) not
null)";
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 10 Sep 1998 16:25:44 +0100
From: Leon Brocard <l.brocard@elsevier.nl>
Subject: Re: pop3 as http
Message-Id: <35F7EF78.333760B4@elsevier.nl>
Michael Yevdokimov wrote:
> how to create server like hotmail.com with pop3, but which will use only one
> real e-mail?
Aha. You want to get onto CPAN and get the Net modules, including
Net::POP3. Then, with a dash of CGI.pm, you have your own system.
You may want to know quite a bit about PERL and CGI before doing
this. And this is *not* a CGI newsgroup[1]. So don't ask.
<plug>
Or you could just check out http://www.astray.com/acmemail/
</plug>
Leon
[1] At least, we won't answer your questions without adding some
humourous comment...
--
Leon Brocard...............................................Perl Hacker
l.brocard@elsevier.nl...........................http://www.astray.com/
... CRIME CONTROL: Fire a warning shot into his HEART!
------------------------------
Date: Thu, 10 Sep 1998 14:26:17 GMT
From: MCKAYD@aplbt1.agw.bt.co.uk (Dermot McKay)
Subject: Re: problem with recursion in perl
Message-Id: <6t8nsg$4ub$1@pheidippides.axion.bt.co.uk>
In article <6t8apa$a2r$1@plug.news.pipex.net>, "Gary Evans"
<ggy22@dial.pipex.com> wrote:
>I'm pretty new to perl (in fact this is the first script I've written - and
>I already have problems!!). The script below is a cut down version of the
>one I've written, it's designed to recursively go through a directory
>structure and print out whether it's a directory or a file (the real version
>creates html based on this information to create a directory structure that
>can be navigated on the browser).
>
>It starts out OK but on the way out of the recursion it seems to lose the
>ability to tell if a file is a directory or file.
>I've tried it on NT and unix.
Try this
print "Content-type: text/html\n\n";
&printdir("/home/gevans",'fh00');
sub printdir{
local($dir, $input)=@_;
$input++;
opendir(DIR,$dir);
local(@DIRS) = readdir(DIR);
closedir (DIR);
foreach (@DIRS) {
if ($_ ne "." && $_ ne ".."){
$_="${dir}$_";
if ( -d $_){
print "$_/ is a directory\n";
printdir("$_/",$input);
}
else{
print "$_ is a file\n";
}
}
}
}
Ok Dermot
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3678
**************************************