[13494] in Perl-Users-Digest
Perl-Users Digest, Issue: 904 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 25 01:07:17 1999
Date: Fri, 24 Sep 1999 22:05:10 -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: <938235910-v9-i904@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 24 Sep 1999 Volume: 9 Number: 904
Today's topics:
${$hashref}[$s] and ${$hashref[$s]} j_chris@sprynet.com
Re: beauty of a Y2K bug <tex@engsoc.carleton.ca>
Re: Calling Mac 'ToolBox' Function via MacPerl (J. Moreno)
Re: can I do this easier? (Kragen Sitaker)
Re: CGI sending email with attachment (Kragen Sitaker)
forwarding to a new page barrytrot@yahoo.com
Re: forwarding to a new page (Kragen Sitaker)
Re: how to put each line of file to a variable? <dheera@usa.net>
Re: Interesting behavior of IO::Handle - bug? (Kragen Sitaker)
Newbie question: Installing XEmacs packages under windo firass@pop.mpls.uswest.net
Re: Perl and Ms Personnal Web server <larkas@eden.rutgers.edu>
Re: Pie and Bar Charts? (Kragen Sitaker)
Re: Q on DB_File <dheera@usa.net>
Re: remove the html tag in the file (Earl Hood)
Re: remove the html tag in the file <madebeer@igc.apc.org>
Replacement "CD" for win32 systems <simon@insanity.org.uk>
Re: Replacement "CD" for win32 systems <jeff@vpservices.com>
Re: REQ: tell-a-friend script (Abigail)
Re: REQ: tell-a-friend script (Abigail)
Re: Still RPC/Taint problems <cassell@mail.cor.epa.gov>
Re: Still RPC/Taint problems (Kragen Sitaker)
Re: Validating forms in javascript before cgi script ru <madebeer@igc.apc.org>
Re: where to write perl??? <garyg@gator.net>
Re: Who is Matt Wright and Why is He Dangerous? (Larry Rosler)
why "system" can not be used in the CGI/Perl? <byuan@eee.hku.hk>
Re: You should be admired (Abigail)
Re: You should be admired (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 25 Sep 1999 03:05:55 GMT
From: j_chris@sprynet.com
Subject: ${$hashref}[$s] and ${$hashref[$s]}
Message-Id: <7she6d$5hd$1@nnrp1.deja.com>
Need to have a better understanding of the two referents in the subject
of this question. Have read relevant parts of the Camel book and the
perlref manpage. Have a grasp of the first (believing that it resolves
the contents of "hashref" to point to an hash and then uses "s" as a
subscript to pick up either a value or another referent). But when
perlref says that ${$hashref[$s]} accesses "a variable called %hashref"
rather than "dereferencing through $hashref to the hash it's presumably
referencing" then I'm lost.
Joe
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 25 Sep 1999 02:01:43 GMT
From: Clayton L. Scott <tex@engsoc.carleton.ca>
Subject: Re: beauty of a Y2K bug
Message-Id: <7shae7$93v$1@bertrand.ccs.carleton.ca>
You, yes you, Jack. Stop writing crap like this:
: Kragen Sitaker (kragen@dnaco.net) wrote:
: > Someone claimed that Larry had a "19$year" bug in an earlier edition of
: > the Camel. (Can anyone confirm or deny?)
: "Programming perl", 1st edition, copyright 1990,
: by Larry Wall and Randal L. Schwartz, p. 317:
: .TH $PROG 1 "$month $mday, 19$year"
: Larry & Randal are clever people. The fact that one of them could be
: tripped up by the localtime() interface makes it clear to me that it's
: not enough to say "it's in the documentation, only morons get it wrong."
: Tricky interfaces lead to bugs, even with the best of programmers.
It just goes to show that there are a fewbumps on anyone's road to
learning Perl.
Clayton
------------------------------
Date: Fri, 24 Sep 1999 23:10:03 -0400
From: planb@newsreaders.com (J. Moreno)
Subject: Re: Calling Mac 'ToolBox' Function via MacPerl
Message-Id: <1dyns9t.1vq1ez91j86pfkN@roxboro0-0025.dyn.interpath.net>
Samuel <sleidy_keinSpam_@_bitte_voicencet.com> wrote:
> I wrote a Perl File to go to a designated Folder and modify the Names of
> the Files in it.
>
> Everything runs as it should.
>
> I then deceided to change the Files Creator Type also.
>
> All I want to do is add '&Change_File_Type($temp_Directory_Path);'
> [where '$temp_Directory_Path' is the Full Path Name] in a SubRoutine I
> already have, and add:
You might want to consider something a bit easier than using the toolbox
directly.
&MacPerl'SetFileInfo("R*ch","TEXT",$file);
--
John Moreno
------------------------------
Date: Sat, 25 Sep 1999 03:48:22 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: can I do this easier?
Message-Id: <aCXG3.670$ru1.50571@typ11.nn.bcandid.com>
In article <7sh2ju$bo1$1@paxfeed.eni.net>,
Cipo Fuzo <cipofuzo@hotmail.com> wrote:
>I would like to load in 8 line cunks from a text file. Is there an
>easier/nicer way, than this:
>
>while (($chunk[0]=<INPUT>) && ($chunk[1]=<INPUT>) && ($chunk[2]=<INPUT>) &&
>($chunk[3]=<INPUT>) && ($chunk[4]=<INPUT>) && ($chunk[5]=<INPUT>) &&
>($chunk[6]=<INPUT>) && ($chunk[7]=<INPUT>))
>{
> ...
>}
@chunk = ();
line: for (1..8) {
push @chunk, scalar <INPUT>;
last line if not defined $chunk[$#chunk];
}
That's one way. HTH.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Sat, 25 Sep 1999 04:36:42 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: CGI sending email with attachment
Message-Id: <ujYG3.787$ru1.60393@typ11.nn.bcandid.com>
In article <6LMG3.28426$I6.491440@typ12.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <FIK5xK.L3@csc.liv.ac.uk>, I.J. Garlick <ijg@connect.org.uk> wrote:
>>Whoever he did get something wrong.
>>
>> print MAIL "\n--gc0y0pkb9ex\n";
>> close MAIL;
>>
>>that last line should be
>>
>> print MAIL "\n--gc0y0pkb9ex--\n";
>>
>>according to everything I have read.
>
>Evidently my post, and the RFC I quoted, are not among "everything you
>have read". Either that, or you think the RFC is mistaken, or I have
>quoted it incorrectly.
>
>I assure you none of the above is true.
Wow, wasn't I nasty. And I was wrong, too:
The encapsulation boundary following the last body part is a
distinguished delimiter that indicates that no further body parts
will follow. Such a delimiter is identical to the previous
delimiters, with the addition of two more hyphens at the end of the
line:
RFC 1521.
Sorry.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Sat, 25 Sep 1999 02:08:56 GMT
From: barrytrot@yahoo.com
Subject: forwarding to a new page
Message-Id: <7sharh$37u$1@nnrp1.deja.com>
I have a perl cgi script which I want to use to send the user to
another html page after doing its thing.
I know how to just use print statements to create the page on the fly
in perl code, but I want to maintain the other page in a seperate file
so that I can better tweak its look and feel.
How do I use a perl cgi to forward the user to a new html page?
(Based on their output, it will send them to a number of different
pages.)
Thanks in advance.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 25 Sep 1999 04:05:58 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: forwarding to a new page
Message-Id: <GSXG3.710$ru1.53731@typ11.nn.bcandid.com>
In article <7sharh$37u$1@nnrp1.deja.com>, <barrytrot@yahoo.com> wrote:
>How do I use a perl cgi to forward the user to a new html page?
>(Based on their output, it will send them to a number of different
>pages.)
This question is off-topic for comp.lang.perl.misc. Please ask future
questions along the same lines in newsgroups about CGI.
The answer is that you output a Location: header with the (full,
absolute) URL you want to redirect to, instead of a Content-Type:
header. If your CGI script is running as NPH, you need to change your
200 response code to some other number.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Sat, 25 Sep 1999 00:21:38 GMT
From: Dheera <dheera@usa.net>
Subject: Re: how to put each line of file to a variable?
Message-Id: <7sh4i9$v69$1@nnrp1.deja.com>
Hi,
If you would like to just go and get all the lines from the file, why
not just the one-liner:
chomp(@yourarray=<GCPREP>);
This would probably be faster since it reads all the data at once. You
could use a foreach loop if you wanted to extract certain lines from
the file...
Dheera Venkatraman
dheera@usa.net
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 25 Sep 1999 04:02:32 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Interesting behavior of IO::Handle - bug?
Message-Id: <sPXG3.704$ru1.53924@typ11.nn.bcandid.com>
In article <7sh2le$to6$1@nnrp1.deja.com>,
Brundle <brundlefly76@hotmail.com> wrote:
>In article <e_LG3.28297$I6.478103@typ12.nn.bcandid.com>,
> kragen@dnaco.net (Kragen Sitaker) wrote:
>> In article <7sfub6$1pn$1@nnrp1.deja.com>,
>> Brundle <brundlefly76@hotmail.com> wrote:
>> >In the both examples $PIPES[$CURRENTPIPE] *IS* a single scalar
>variable
>> >with a filehandle value.
>>
>> No, it's an array element. A scalar variable is something like $asdf.
>
>Since they both exclusively hold a scalar value, what's the
>significance when using either in the same context?
There's a somewhat-outdated prototype of a FMTYEWTK about this very
question at http://www.perl.com/CPAN/doc/FMTEYEWTK/filehandles, which
doesn't explain *why* it matters, but does explain exactly how it does
matter.
The brief answer is that filehandles are brain-damaged and evil,
filehandle operators care whether you give them a scalar variable or an
array element, and you have to put up with it if you're going to use
the rest of the wonderful stuff that is Perl.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Fri, 24 Sep 1999 23:19:29 +0100
From: firass@pop.mpls.uswest.net
Subject: Newbie question: Installing XEmacs packages under windows NT
Message-Id: <37EBF8F0.8A522D5E@pop.mpls.uswest.net>
Hi,
I recently downloaded the XEmacs on my WIndows NT (after I
already downloaded cygwin and X11). I had a slow connection,
so I opted for the small zip file, and then downloaded the
very basic packages and every thing seems to work OK, so far
at least.
Then I wanted to use XEmacs to edit my perl scripts, and
then I found out that perl support is not available, so I
figured out that I need to download the perl support
package. At first, I tried to use the "package update" from
XEmacs itself, only to be faced with all the problems with
FTP/WindowsNT/Cygwin/XEmacs. So I thought I revert to the
other manual method and get the archives myself. Once again,
I had hard times trying to locate the proper perl package.
If anyone knows what is the proper module, where to get it
and where to unzip ti, then I will be very grateful.
Thanks.
Ross
------------------------------
Date: Fri, 24 Sep 1999 20:24:23 -0400
From: Larry Kasoff <larkas@eden.rutgers.edu>
Subject: Re: Perl and Ms Personnal Web server
Message-Id: <37EC1637.9B5CF2C@eden.rutgers.edu>
Do yourself a favor. Give up on Personal Web Server. I have yet to meet a
person that doesn't have problems running CGI apps with it. Instead get Apache
(http://www.apache.org/httpd.html) or Sambar Server (http://www.sambar.com) .
Both are free and can run CGI programs written in Perl and other languages
without a problem once installed.
Karim wrote:
> Hi,
> I am new to Perl. I have recently downloaded Perl for windows and installed
> Microsoft Web Server. I just don't know how to configure Ms Personnal Web
> server to jump into Perl programming. Anybody who knows how to do it or has
> a detailed documentation I need help.
------------------------------
Date: Sat, 25 Sep 1999 03:44:53 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Pie and Bar Charts?
Message-Id: <VyXG3.664$ru1.50079@typ11.nn.bcandid.com>
In article <1zSG3.11$1F3.2154@news.goodnet.com>,
Burt lewis <burt@ici.net> wrote:
>I would really like the ability to turn some numbers into Pie or Bar Charts on
>Unix Perl.
In the past, I've used PostScript for this. Just write a little script
that spits out PostScript, send it to the printer, and there you go.
>I have ActivePerl running also on A PC with a web server which I use for
>development.
Hmm, do you want to draw the pie and bar charts on the Web? Maybe you
need GIFs or PNGs. GD is good for this; unfortunately, GIFs are
covered by patents owned by a financially and morally bankrupt
corporation called Unisys, so GD doesn't support GIF anymore.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Sat, 25 Sep 1999 00:13:33 GMT
From: Dheera <dheera@usa.net>
Subject: Re: Q on DB_File
Message-Id: <7sh435$uqe$1@nnrp1.deja.com>
I think $DB_RECNO is what you want. Check the DB_File documentation for
details and examples. Here's one place you can get it:
http://www.daimi.au.dk/perl/ext/DB_File/DB_File.html
In article <37e96655@news1.prserv.net>,
"tavi" <tavi367@ibm.net> wrote:
> I have a small script that uses DB_File to maintain control over an
array
> and kep it to disk.
>
> This works just fine on my NT machine, but when I try and use it on
my UNIX
> (SunOS 5.0.5) it doesn't quite work right.
>
> The data is retrieved from the submitting web form.
>
> DB_File creates the text file for the data.
>
> The text file is empty.
>
> The array the data should be stored in is empty.
>
> The error and access logs tel me nothing.
>
> Any ideas on what I should look for?
>
> Thanks
>
> Tavi
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 25 Sep 1999 01:46:03 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: remove the html tag in the file
Message-Id: <7sh9gr$5lc@news.service.uci.edu>
In article <EVRG3.18678$m4.75164111@news.magma.ca>,
Samuel Kilchenmann <skilchen@swissonline.ch> wrote:
>> Is anyone know how can I use perl to remove all the HTML TAGs in
>> the html file. Thanks.
>>
>You may want to use a more appropriate tool than Perl for things like
>that
Appropriatness depends on individual needs.
>(see http://www.rebol.com):
>One of their example scripts (slightly modified):
>tags: make block! 100
>text: make string! 8000
>html-code: [
> copy tag ["<" thru ">"] (append tags tag) |
> copy txt to "<" (append text txt)
>]
>; if you don't need to accumulate the tags, use a slight modification
>; html-code: [
>; ["<" thru ">"] |
>; copy txt to "<" (append text txt)
>; ]
Does it properly handle
<IMG SRC="goo.fig" ALT="This is > than that">
Or comment declarations?
I.e. The solution is over simplified. No where does it show Rebol
is better suited for such a task. Also, from the license agreement,
Rebol is not open source.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Fri, 24 Sep 1999 16:13:45 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: remove the html tag in the file
Message-Id: <APC&1'0'50775dc2'36d@igc.apc.org>
This is a FAQ.
perldoc -q html
-Mike
------------------------------
Date: Sat, 25 Sep 1999 01:08:55 +0100
From: "Simon Plant" <simon@insanity.org.uk>
Subject: Replacement "CD" for win32 systems
Message-Id: <7sh3uf$an8$1@gxsn.com>
All,
I need a replacement "CD" command for windows nt
which will accept the directory to change to with
forward slashes in...
IE "cd c:/winnt/system
Now, this obviously doesn't work using the STD NT command
interpreter, so I though I'd use perl. However, I assumed the
following would work...
---START SCRIPT---
die "-=> NO VALID DIR\n" if ((!$ARGV[0]) || (!-d $ARGV[0]));
$myDir = $ARGV[0];
$myDir =~ s/\//\\/g;
exec("cd $myDir");
---END SCRIPT---
Except it doesn't, it leaves me in the directory I started in
when I called the script :( Ayy ideas gratefully received.
Cheers
Si
------------------------------
Date: 25 Sep 1999 01:14:31 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Replacement "CD" for win32 systems
Message-Id: <37EC2034.27F26EA1@vpservices.com>
Simon Plant wrote:
>
> I need a replacement "CD" command for windows nt
> which will accept the directory to change to with
> forward slashes in...
>
> IE "cd c:/winnt/system
>
There is nothing wrong with that. It works fine.
>
> Except it doesn't, it leaves me in the directory I started in
> when I called the script
That is what it is supposed to do.
> :( Ayy ideas gratefully received.
Try reading the perlfaq8 section called (I kid you not):
I {changed directory, modified my environment} in a perl
script. How come the change disappeared when I exited the
script? How do I get my changes to be visible?
--
Jeff
------------------------------
Date: 24 Sep 1999 23:33:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: REQ: tell-a-friend script
Message-Id: <slrn7uoka9.faj.abigail@alexandra.delanet.com>
Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCCXIII September
MCMXCIII in <URL:news:9gdG3.79$8B3.3325@nsw.nnrp.telstra.net>:
!!
!! My point being that elsif is not English. It's Perl.
My point is that people complaining that "Referer" in HTTP talk is
misspelled shouldn't state that "elsif" isn't misspelled. If "elsif" is
correct because it's Perl and not English, then "Referer" is correct by
the same logic, it's HTTP, and not English.
Frankly, I don't really care whether someone argues the words are
misspelled, or that the words are correct. As long as you argue in the
same way for both words. I just cannot understand defending one of the
words as being correct, and not the other.
\begin{Spock}
That is highly illogical.
\end{Spock}
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: 24 Sep 1999 23:47:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: REQ: tell-a-friend script
Message-Id: <slrn7uol3s.faj.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCCXIV September
MCMXCIII in <URL:news:37e97911@cs.colorado.edu>:
$$ [courtesy cc of this posting mailed to cited author]
$$
$$ In comp.lang.perl.misc,
$$ lr@hpl.hp.com (Larry Rosler) writes:
$$ :No, I would tell them that the first "e" is misspelled. "département",
$$ :n'est-ce pas?
$$
$$ That, too. :-)
$$
$$ :What might be the reasons for that particularly choice choice?
$$
$$ 1) You don't want people ever trying to write "else if". No
$$ dangly elses. Ruins the grammar. This is a really important
$$ technical matter.
"else if" doesn't compile, and people can still write "else {if" if
they want, so, I don't see what "elsif" does for us in a technical
sense.
$$ 2) The "ei" combo just doesn't usually sound like the "i" in "if".
$$ It sounds like many things, but that that. Consider kaleidoscope,
$$ freight, albeit, beige, protein, seize, Einstein, feisty, gneiss,
$$ height, heir, seismic, leitmotif, neighbor, weight, either, neither,
$$ reign, veil, formulae, poltergeist, reichsmark, seigneurage, sheik,
$$ stein, their, vein, weird, weissbier, etc. I guess "foreign" and
$$ "forfeit" work, but compared with all the cases, these are rare.
$$ So "elseif" would be "el zaif" or something. It just doesn't sound
$$ right.
That's probably subjective. "elsif" to *me* very much looks like "el sif".
I don't really care how "elseif" and "elsif" sound like. I do know that
"elsif" doesn't *type* right, as I often either type "elif" or "elseif".
But I don't care much whether it's "elif", "elsif" or "elseif". It's just
a token. It could have been named "turkey" for all I care. ;-)
Of course, it's a redundant token. if() should just be a function taking
3 arguments, an expression, and 2 blocks. No need for "else" or "elsif".
But I guess that would be too Lispish....
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== 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, 24 Sep 1999 17:16:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Still RPC/Taint problems
Message-Id: <37EC1450.A4A1AFC3@mail.cor.epa.gov>
R. Brockway wrote:
>
> I am having a very difficult time trying to figure out how I can either
> get backtick'd commands or system calls to actually return with results
> having been called from a server script, which in turn is running the
> function via RPC from the client script. The problem is -T Taint mode
> and the fact that we have external data. Without -T on the server side
> script, everything is peachy. I attempted some un-tainting lines
> (http://www.perl.com/pub/doc/manual/html/pod/perlsec.html) but the calls
> to the system in the server code still don't return. I would rather not
> run the client/server without -T. Do I have a choice here, given the
> nature of external system information combined with a client/server RPC
> model in -T mode?
> #!/usr/bin/perl -wT
> use 5.005;
> use strict;
Good! BTW, do you really need to restrict the version to 5.005?
> $ENV{PATH} = "/bin:/usr/bin";
> delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
And more good -T stuff. Glad to see you've read the docs.
> my $MY_APPLICATION = "User_Mod";
> my $MY_VERSION = 1.0;
>
> # Function get_user
> sub get_user ($$@) {
> # take $username and grep from /etc/passwd
> my ($con, $ref, @args) = @_;
> my $username = shift @args;
Okay, right here. You need to untaint $username as recommended
in the perlsec pages under "Laundering and Detecting Tainted
Data". $username goes into $cmd , so $cmd will be tainted until
$username is cleaned up. Thus the line with system "$cmd" goes
boing under -T.
> print "$username\n";
> # my $get_user = `/bin/grep $username /etc/passwd`;
> my $cmd = "/bin/grep $username /etc/passwd";
> print "before\n";
> ############# Doesn't return from this next line #################
> my $get_user = system "$cmd";
> print "after\n";
> print "$get_user\n";
> (1, $get_user);
> }
[major snip of code - whew! that's way too many lines for me
to read, Rockie!]
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sat, 25 Sep 1999 04:29:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Still RPC/Taint problems
Message-Id: <1dYG3.767$ru1.59104@typ11.nn.bcandid.com>
In article <37EC1450.A4A1AFC3@mail.cor.epa.gov>,
David Cassell <cassell@mail.cor.epa.gov> wrote:
>Good! BTW, do you really need to restrict the version to 5.005?
He has no easy way of knowing unless he is intimately familiar with the
previous versions. Nobody has yet been fanatical enough to add
information to the pods saying when each new feature was added; there's
no way to tell that, say, hex() was there in perl 1, while lookbehind
assertions weren't added until 5.005.
This is rather traditional in software documentation. History is
ignored.
>Okay, right here. You need to untaint $username as recommended
>in the perlsec pages under "Laundering and Detecting Tainted
>Data". $username goes into $cmd , so $cmd will be tainted until
>$username is cleaned up. Thus the line with system "$cmd" goes
>boing under -T.
You might want to verify that $username is sensible while you do this;
matching it with something like /^([-\w\d]{,8})$/ might be sufficient,
depending on what your usernames look like.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Fri, 24 Sep 1999 15:34:29 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Validating forms in javascript before cgi script runs
Message-Id: <APC&1'0'50775dc1'89d@igc.apc.org>
Maybe there is a javascript error, or maybe the browser ignores
javascript.
-Mike
------------------------------
Date: Sat, 25 Sep 1999 00:11:28 -0400
From: "Gary M. Greenberg" <garyg@gator.net>
Subject: Re: where to write perl???
Message-Id: <37EC4B70.995A0CEB@gator.net>
Cameron Dorey wrote:
[Posted and mailed]
> I wrote:
> > I really like the new Perl CD Bookshelf ... And, www.bookpool.com has a
> > great price (we got 2 CDs w/ Perl in a Nutshell for less than $80.00
^^^
> > delivered!)
>
> This should be a great set, but this is a "great price"? List price from
> ORA is $59.95 ($66.45 w/UPS ground shipping). ...
> Perhaps your fingers slipped on the keys?
Obviously, that wasn't clear; we got TWO "Perl CD Bookshelf & Perl in a
Nutshell"
packages for less than $80.00. They were $37.50 each plus S & H.
In my mind that's a great deal NOT just a great CD.
Gary
-=- Avenue Programmers' Reference -=-
Class Hierarchy, Requests, and Hyperlinked Sample Scripts:
http:/www.gator.net/~garyg/aveclass.htm
------------------------------
Date: Fri, 24 Sep 1999 17:18:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Who is Matt Wright and Why is He Dangerous?
Message-Id: <MPG.1255b4acfcdfdf7b989fd8@nntp.hpl.hp.com>
In article <37EBE831.DBFA1B29@mail.cor.epa.gov> on Fri, 24 Sep 1999
14:08:01 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
...
> ... However, on 01/01/2000 a few people will
> find out the embarrassing way that scripts lifted off the web
> are worth every penny they paid for them. :-)
I think you mean on '01/01/19100'. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 25 Sep 1999 12:50:20 +0800
From: byuan <byuan@eee.hku.hk>
Subject: why "system" can not be used in the CGI/Perl?
Message-Id: <37EC548C.CBBDB72A@eee.hku.hk>
Hi all:
I try to use following script, "a" is a C program which has been
compiled using CC, but it seems that
the "system" here can not be actived, anyone can help me?
thanks for your time.
Yuan Bin
#!/usr/bin/perl
print "Content-type: text/html", "\n\n";
system("./a test.dat result.dat");
print "<HTML>", "\n";
print "<HEAD><TITLE>About this Server</TITLE></HEAD>", "\n";
print "<BODY><H1>About this Server</H1>", "\n";
print "<HR><PRE>";
print "Server Name: ", $ENV{'SERVER_NAME'}, "<BR>", "\n";
print "Running on Port: ", $ENV{'SERVER_PORT'}, "<BR>", "\n";
print "Server Software: ", $ENV{'SERVER_SOFTWARE'}, "<BR>", "\n";
print "Server Protocol: ", $ENV{'SERVER_PROTOCOL'}, "<BR>", "\n";
print "CGI Revision: ", $ENV{'GATEWAY_INTERFACE'}, "<BR>", "\n";
print "<HR></PRE>", "\n";
print "</BODY></HTML>", "\n";
exit (0);
------------------------------
Date: 24 Sep 1999 23:57:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: You should be admired
Message-Id: <slrn7uolme.faj.abigail@alexandra.delanet.com>
Henry Penninkilampi (spamfree@metropolis.net.au) wrote on MMCCXIV
September MCMXCIII in <URL:news:spamfree-2309991640540001@d6.metropolis.net.au>:
""
"" Has anyone ever considered CFDing [comp.lang.perl.worthy] and (veteran
"" Perl users) moving serious discussions to that group?
Have you ever read this group? Your suggestion is being made, oh,
about 50 times a year.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
-----------== 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: 25 Sep 1999 00:02:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: You should be admired
Message-Id: <slrn7uom02.faj.abigail@alexandra.delanet.com>
Henry Penninkilampi (spamfree@metropolis.net.au) wrote on MMCCXIV
September MCMXCIII in <URL:news:spamfree-2409990455060001@d6.metropolis.net.au>:
!!
!! Ah, but as society commodifies (?) the Internet (turns Internet access
!! into a commodity item), and some programming languages with it, people
!! will be less and less inclined to RTFM. Just like all other commodity
!! items, you only refer to the manual when _something_goes_wrong_. That
!! means that this problem will only get worse.
Emailing people who don't RTFM untill something goes wrong, all nine faqs
solves the problem of not RTFMing exactly how?
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== 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: 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 904
*************************************