[9722] in Perl-Users-Digest
Perl-Users Digest, Issue: 3316 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 2 03:04:54 1998
Date: Sun, 2 Aug 98 00:00:25 -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 Sun, 2 Aug 1998 Volume: 8 Number: 3316
Today's topics:
Re: # in a print statement (Chris Russo)
ActiveState Perlscript <bradford@aliveonline.com>
Re: Associative array of associative arrays (Adam Donahue)
Re: Challenge: turn one word into another one letter at <tchrist@mox.perl.com>
Error message -- Newbie question <carriert@bit-net.com>
File problems <ophir@saifun.com>
Re: Help NEEDED!!!! <perlguy@inlink.com>
Help with environment variables <lina@kbss.bt.co.uk>
Re: Help with Perl... <quednauf@nortel.co.uk>
Re: hiding user input (Gary L. Burnore)
Re: Im Willing to pay or give a free DOMAIN for a custo <perlguy@inlink.com>
newbie split question <tyler@uakron.edu>
Re: Perl == Unix? (was Re: Programmer's Editor) <tchrist@mox.perl.com>
Re: perl as pseudocode <ghira@mistral.co.uk>
printed & bound perl 5.005 manuals? karl@gnu.org
Re: seeing if a file exists. (Ollie Cook)
Re: serialization and perl <jdporter@min.net>
Re: Try to execute perl script in local (Al Thomas)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Jul 1998 12:36:54 -0700
From: news@russo.org (Chris Russo)
Subject: Re: # in a print statement
Message-Id: <news-3007981236540001@buzz.hq.alink.net>
In article <35C0854B.C9F7E3DF@interactive.ibm.com>,
johnc@interactive.ibm.com wrote:
> I thought once the "Perl Studs" got their .moderated group that any
advice they
>gave here would be a little less venomous. I guess not. You got the new
group. Go
>be rude in there. If you give advice here then take the Tom P.'s approach
please.
"venomous"? Abigail said nothing rude by any reasonable measure. She just
pointed out good USENETtiquette, whether or not a .moderated perl group
exists.
Can't we all just relax a bit, and stop attacking one another?
Thanks,
Chris Russo
--
Chris Russo
news@russo.org
http://www.russo.org
------------------------------
Date: Sun, 02 Aug 1998 06:08:47 GMT
From: "Christopher Bradford" <bradford@aliveonline.com>
Subject: ActiveState Perlscript
Message-Id: <PnTw1.4961$XM4.13284880@news.rdc1.md.home.com>
Has anyone used ActiveState's Perlscript? Any success in getting it to work
over the web (there is a registry key, apparently, that limits Perlscript to
the local machine). What do I need to change to get this to work?
------------------------------
Date: 30 Jul 1998 20:15:45 GMT
From: amd0978@acf2.nyu.edu (Adam Donahue)
Subject: Re: Associative array of associative arrays
Message-Id: <6pqk9h$24c$1@news.nyu.edu>
Something like:
%HashofHashes = ( 'first' => \%hashone,
'second' => \%hashtwo )
Or use { 'another' => 'item' } in place of \%hashes to make them
anonymous hashes.
h_o_t_r_o_d@my-dejanews.com wrote:
: Does anyone know if it's possible to create an associative array of
: associative arrays? If so, could you give me an example? I've tried, but it
: doesn't seem to be working. Please reply by e-mail. Thanks,
:
: Andrew
:
: -----== Posted via Deja News, The Leader in Internet Discussion ==-----
: http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 30 Jul 1998 19:23:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Challenge: turn one word into another one letter at a time
Message-Id: <6pqh7j$s33$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
psj@euclid.jpl.nasa.gov (Peter Scott) writes:
:I was thinking about those puzzles in children's books that say, "Can
:you turn BLACK into WHITE in 8 steps, changing only one letter at a time,
:making a valid word at each stage?" And the answer is something like
Are you aware that this is being disgussed in the other moderated
newsgroup?
--tom
--
Can you sum up plan 9 in layman's terms? It does everything
Unix does only less reliably --Ken Thompson
------------------------------
Date: Thu, 30 Jul 1998 16:20:52 -0400
From: "T. Carrier" <carriert@bit-net.com>
Subject: Error message -- Newbie question
Message-Id: <35C0D5A4.5F4A854B@bit-net.com>
Hello,
I am trying to get Perl do some form processing for me. But I keep
receiving the the following error message when I click on the submit
button on the form:
'C:\Inetpub\wwwroot\test.pl' script produced no output
Here are some specifics:
I'm using MicroSoft Personal Web Server with Windows 95.
The test.pl exists in the /cgi-bin directory
Here is the registry entry for the .pl extension:
My Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Services\W3SVC\Parameters\ScriptMap\.pl "C:\Perl\bin\PerllS.dll"
Here is the code for the test.pl:
#!c:\perl\bin\perl
$temp=$ENV{'QUERY_STRING'};
@pairs=split(/&/,$temp);
foreach $item(@pairs{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#FFFFFF\">\n";
print "Hello World\n";
print "<h2>$fields{'name'}</h2>\n";
print "<pre>$fields{'comment'}</pre>\n";
---
Here is the code for the html that calls the .pl script:
<html>
<head><title>Testing</title>
</head>
<body bgcolor="#FFFFFF">
<h2>Please enter your name and comments</h2>
<form method=get action="/cgi-bin/test.pl">
<dt>Name:<br>
<dd><input type=text name=name size=30>
<dt>Comment:<br>
<dd><textarea name=comment rows=5 cols=50></textarea><p>
<input type=submit value="sign in">
</form>
</body>
</html>
Thanks for any help.
Tom Carrier
carriert@bit-net.com
------------------------------
Date: Sun, 02 Aug 1998 08:54:08 +0300
From: Ophir Marko <ophir@saifun.com>
Subject: File problems
Message-Id: <35C3FF00.D5B827B7@saifun.com>
I have a file that looks like this:
aa b ccc d
1 2 3 4
I made a script that rearanges the file to look like this:
aa === 1
b === 2
ccc === 3
d ===4
What I want to have as an output is this:
aa......1
b.......2
ccc.....3
d.......4
How do I write that kind of script?
MY current script looks like this :
#! /home1/ophir/perl5/perl
$index=0;
while(??){
$i=0;
split;
while ($i ?= $#_){
@maaraj[$i+$index]=$_[$i];
$i++;
}
$index=$index+$#_+1;
}
$t=0;
$info = while ($t?=$index/2-1){
print @maaraj[$t]," ===== ", @maaraj[$index/2+$t], "\n";
$t++;
}
------------------------------
Date: Fri, 31 Jul 1998 11:59:18 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Help NEEDED!!!!
Message-Id: <35C1B196.F4183D1B@inlink.com>
No need to SHOUT!
Try visiting http://www.perl.com the CGI area should provide some useful
information. Also, http://webreview.com has some articles on CGI
programming.
What you are asking for is SO basic, I can't imagine where you are
having problems. Can you send some sample code for us to see where you
are having problems.
Brent
------------------------------
Date: Fri, 31 Jul 1998 14:25:38 +0100
From: lina <lina@kbss.bt.co.uk>
Subject: Help with environment variables
Message-Id: <35C1C5D2.41C67EA6@kbss.bt.co.uk>
How do I make use of environemnt variables inside a Perl program?
I've seen the existence of a predefined module Env but can't make much
use out of it.
use Env;
print(PWD);
What's wrong with the above 2 lines of code?
Thanks,
Lina
------------------------------
Date: Fri, 31 Jul 1998 13:43:04 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Help with Perl...
Message-Id: <35C1BBD8.87A1BE4@nortel.co.uk>
Diesel wrote:
>
> What I want to know is how I can get a perl script to search for this line
> in the index.htm and add stuff (in html format) below it.
Brent Michalski wrote:
> I wrote an article that does ALMOST what you area asking here. In the
> article, it actually writes the whole HTML file every time. You could
> modify it so that it only changes the text in between variables if you
> wanted to.
And for the sake of having alternatives, I also wrote a script that does
insert html code after a certain tag in an html file. Check out my sig
for that.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Sun, 02 Aug 1998 06:43:31 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: hiding user input
Message-Id: <35ca0868.186579838@nntpd.databasix.com>
On 1 Aug 1998 21:43:04 GMT, in article <6q0258$cp8@scel.sequent.com>,
krader@sequent.com (Kurtis D. Rader) wrote:
snip
So Now Kurtis, you think it's proper to attempt to (paraphrasing> put pressure
on someone's human resources department to have them fired for posts made to
USENet. Since that's the way you see it, it seems fair that the human
resources department of Sequent be notified of your posts to USENet and your
private email. Email sent even after being warned to stop and being warned
that your emails were considered as harassment.
Instead of standing up for those new posters here who get shit on by a few,
you attack me. That's fine. You're welcome to do so. Gotta say at least
you're not like Rodger Donaldson <rodgerd@sacco.wnl.co.nz> who also sends
insulting emails but states he's got me killfiled and procmailed so that he
doesn't have to hear my reply. At least you're not a coward posting
anonymously.
As for archiving posts in DejaNews, just because you and others think it's ok
that your posts be archived there so DejaNews can earn $$$ for the
advertisements you're stuck seeing while your searching, that's YOUR problem.
--
for i in databasix primenet ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH! | ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
| ][3 3 4 1 4 2 ]3^3 6 9 0 6 9 ][3
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
------------------------------
Date: Fri, 31 Jul 1998 11:52:34 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Im Willing to pay or give a free DOMAIN for a custom cgi!
Message-Id: <35C1B001.4A2D9133@inlink.com>
> method98 (method98@iname.com) wrote:
> : Can Anyone Make a Hidden Cgi that clicks on sponser
> : undectably to the user viewing the web page and the sponsers
> : itself... I am willing to pay Webmasters or Hosters $400 USD with my
> : credit card, or buy a DOMAIN to anyone how can make this cgi-script
> : and the DOMAIN is for 1 year.
>
> : IT MUST BE 110% UNDECTABLE TO THE SPONSERS AND THE USERS!!!
>
> : if you can make this, email a.s.a.p
>
> : method98@iname.com
>
> : Regards
I just came up with the perfect way to do this! But I won't share it
with you because you would abuse it for your own personal gain.
:-P
Brent
------------------------------
Date: Thu, 30 Jul 1998 15:22:19 -0400
From: "tyler" <tyler@uakron.edu>
Subject: newbie split question
Message-Id: <6pqh8e$9f8$1@kira.cc.uakron.edu>
hello,
im having trouble with split. im trying to read a file which is carat
delimited, parsing each field into an array. my problem is that i'm using
the split function to split it up and when i do, it doesnt work. however,
when i change it from carat delimited to colon delimited, the code works.
here's the code:
open(MINN,"klaisjul2.txt") || die "no $!\n";
while (<MINN>)
{
@list=split(/^/); # split up the fields
chomp(@list); # take the carriage return off
print $list[0],"\n"; # print out first field
}
close(MINN);
what happens is when its like this, it prints out the entire line instead of
the first field. if i change the ^ to a : and change the input file, it
works fine. am i doing something stupid here? thanks in advance.
oh, im using perl for win32
tyler
------------------------------
Date: 30 Jul 1998 19:12:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl == Unix? (was Re: Programmer's Editor)
Message-Id: <6pqgit$s33$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Cameron Dorey <camerond@mail.uca.edu> writes:
:I beg to differ, your logic is faulty. I do not know Unix. I am learning
:Perl. If I knew Unix to begin with, maybe some of the stumbling blocks I
:am finding with Perl would have been easier to traverse, but they are
:not impossible now.
Oh, crud, looks like the cat's out the bag. We've been apprehended
redhanded. It's all true. Unix, you see, if a virus -- and Perl is
the carrier that allows it to jump hosts, even penetrating hostile
environments. You are now all infected. But don't worry! It's a
beneficial virus! The Unix virus through its deceptive Perl shell is
now rewriting your DNA by repairing the broken parts, not breaking the
working ones. Be happy. Tell your friends. Spread the contamination.
Be one with the Unix. It will set your free. Be free!
--tom
--
"New versions happen." --Larry Wall
------------------------------
Date: 30 Jul 98 20:12:34 +0000
From: "Adam Atkinson" <ghira@mistral.co.uk>
Subject: Re: perl as pseudocode
Message-Id: <1986.515T1726T12124535@mistral.co.uk>
On 29-Jul-98 20:31:59, John Porter said:
>> I was thinking more about things like "Does heavy use of default
>> arguments make perl more or less useful as pseudocode?". and
>> things like "hard" regular expressions, map, tr, and so on.
>Like I said before, use English; then $_ is $ARG, etc.
"said before"? :-(
It doesn't look like your previous message ever made it
to my ISP's news-server. (Actually, it was flaking out
very badly last week)
>And avoid using default arguments
yep. I've tried some programs both ways and have to admit
SOMETIMES default arguments make a loop look cleaner,
and upon occasion way more pseudocode-y.
>You could try to avoid using $ARG altogether, but you'll find
>that it's not so easy. Sure you could replace
> while ( <> ) {
>with the less legible
> while ( defined($line=<>) ) {
>but you can't avoid $_ in places such as grep and map.
>But it's no big deal.
Agreed.
>You can't avoid the use of $a and $b
>when you write a sort routine, either.
that's not a problem.
>> "(var, var) =" can probably go, though
>No! The idea that lvalues must be scalar entities is an artifact of
>the programming language. The idea that function calls, or other
>expressions, can evaluate to a vector of values is hardly a
>difficult one. And perl supports it nicely.
Good point. I hadn't looked at it that way at all. Thanks. :-)
>No; I'll bet you can assume that your audience understands what you mean
>when you say
> let y = f(x)
>And
> let (y,z) = f(x)
>is not significantly different.
Ok. makes sense.
>> Hmm. I have to admit this isn't what I was originally thinking about,
>> but the idea is intriguing (um. sp?)... a perl "pseudocodifier"...
>But not worth wasting time on, IMHO.
Have to agree. Wasn't planning to. Writing relatively legible
programs is the plan.
--
Adam Atkinson (ghira@mistral.co.uk)
"That's the biggest shark I've ever seen" he said, superficially.
------------------------------
Date: 31 Jul 1998 08:00:05 -0400
From: karl@gnu.org
Subject: printed & bound perl 5.005 manuals?
Message-Id: <vxyhfzyjkmy.fsf@suite.deas.harvard.edu>
Is there anywhere to buy a nice bound and printed copy of the Perl 5.005
documentation? Failing that, has anyone produced a nice single dvi or
PostScript file from it?
I finally succeeded in getting pod2latex to work, sort of (it's all in
italics), but I'd rather not spew 600 pages out of my laser printer if I
don't have to. The output isn't all that great, either, and I don't
want to hassle with getting a nice table of contents, index, etc. It
was painful enough creating the top-level file to include everything.
The result of pod2man was even more pages and even uglier output for
printing and reading. pod2texinfo from cpan failed to get menus and
node pointers right so was dead in the water. pod2html ..., well, I
didn't want to mess with html2ps for something this size.
I was hoping most for pod2texinfo since then everything would come out
right and I could more easily read it online as well. Sigh. If anyone
has a Texinfo version of 5.005, I'd love to know about it.
Anyway. SSC? O'Reilly? Perl Institute? Anyone? I looked around on
the web, dejanews, etc., but didn't find anything.
And yes, I have the camel book :-).
Thanks. Please respond by email if you can (as well as posting). I'll
summarize any positive responses as usual.
karl@gnu.org
------------------------------
Date: Sun, 02 Aug 1998 06:54:38 GMT
From: oliver.cook@bigfoot.com (Ollie Cook)
Subject: Re: seeing if a file exists.
Message-Id: <35c40cba.937513@news.ukonline.co.uk>
On 31 Jul 1998 19:09:25 GMT, gorilla@elaine.drink.com (Alan Barclay)
wrote:
>It's probably a bad idea to use remote addr in this case anyway.
>
>If the user is accessing via a proxy server, REMOTE_ADDR will
>contain the address of the proxy, and therefore it is likely that
>two instances both running behind the same proxy will collide.
Yes, I see what you're getting at. Thanks for pointing that out. What
would be a better way of doing it? Basically it's a file which stores
information about what's in a shopping cart. I'd prefer not to use
cookies, but i'll think about that again later maybe! Thanks!
Ollie
----
Oliver COOK, Web Site Designer for
Premiere Web Designs - Http://Www.Premiere.Uk.Com/
+
Webmaster of The Audio-Visual Archive
* over 900 images and 700 sounds, free
* Http://Www.Premiere.Uk.Com/ava/
------------------------------
Date: Fri, 31 Jul 1998 14:07:28 GMT
From: John Porter <jdporter@min.net>
Subject: Re: serialization and perl
Message-Id: <35C1D03B.37D9@min.net>
Ilya M. Kirnos wrote:
>
> Does perl have any facilities for writing out/reading in perl data
> structures, e.g. hashes? I'm looking for something akin to serialization
> in java. Thanks.
On CPAN you will find a number of very good modules which support
serialization. Which one you use is perhaps a matter of taste;
I prefer Data::Dumper.
In the Long Module List (CPAN/modules/00modlist.long.html), look under
the Data Type Marshaling and Persistent Storage section.
There you will see (among other things):
FreezeThaw
Storable
Marshal
Data::Dumper
--
John Porter
------------------------------
Date: Thu, 30 Jul 1998 19:26:24 GMT
From: althomas@together.net (Al Thomas)
Subject: Re: Try to execute perl script in local
Message-Id: <35c0c84b.980021@news.together.net>
On Thu, 30 Jul 1998 16:22:46 +0200, Ferdi <cogelog@wanadoo.fr> wrote:
>I have learned perl for a few days now. I have installed Perl (last
>version) and a
>local server (omnihttpd 1.01) to test my scripts. In the dos windows, I
>can see the script results.
>But in my browser, I have always ( and it not depends on the perl file,
>I try several files)
>the same error message in a dialog box : "Document contains no data".
>Can you help me!
>Thanks in advance.
>Ferdi
Open omnihttpd, go Admin|Properties|Advanced and check the Perl CGI
command line path spec.
------------------------------
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 3316
**************************************