[16285] in Perl-Users-Digest
Perl-Users Digest, Issue: 3697 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 17 18:15:52 2000
Date: Mon, 17 Jul 2000 15:15:28 -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: <963872127-v9-i3697@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 17 Jul 2000 Volume: 9 Number: 3697
Today's topics:
problem adding modules with cpan <bohlmann@uiuc.edu>
Re: problem adding modules with cpan (NP)
Re: problem adding modules with cpan <bohlmann@uiuc.edu>
Re: programming tools and techniques spike1@freenet.co.uk
Re: programming tools and techniques <jschauma@netmeister.org>
Re: Qs for professional Perl/CGI developers schnurmann@my-deja.com
Re: Read a file into a hash ? <lr@hpl.hp.com>
Re: Read a file into a hash ? <sumus@aut.dk>
regular expression - html tag-esque pattern <ab@cd.com>
Re: Shortcut for non-defined variables (Abigail)
Re: Shortcut for non-defined variables (Abigail)
Re: Silly Question? (Abigail)
Suggestion for syntax change <keithmur@mindspring.com>
Re: telephone answering machine (Abigail)
Re: To Schwartz or not to Schwartz? <lr@hpl.hp.com>
Re: Trying to use an array as a hash value (Abigail)
Re: untainting insecure dependancy? (Abigail)
RE: Viewing HTTP headers <nivel33@hotmail.com>
Re: Why $|++ instead of $|=1 ? (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 17 Jul 2000 14:14:14 -0500
From: Brian Bohlmann <bohlmann@uiuc.edu>
Subject: problem adding modules with cpan
Message-Id: <39735B05.696B2CB6@uiuc.edu>
I apologize if this has been answered somewhere already. I am trying to
add
a module using cpan and get the following error. I'm currently running
Solaris8
with their bundled perl and gcc installed. Is there a way to get cpan to
use gcc
instead of cc or do I have some other problem?
cc -c -xO3 -xdepend -DVERSION=\"2.14\" -DXS_VERSION=\"2.14\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE ReadKey.c
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `ReadKey.o'
/usr/ccs/bin/make -- NOT OK
Any help is appreciated.
-Brian
--
___________________________________________________
Brian Bohlmann, University of Illinois-Urbana
email: bohlmann@uiuc.edu phone: 217-244-5409
www: http://www.uiuc.edu/ph/www/bohlmann
------------------------------
Date: Mon, 17 Jul 2000 19:33:25 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: problem adding modules with cpan
Message-Id: <9cJc5.95566$t91.639147@news4.giganews.com>
On Mon, 17 Jul 2000 14:14:14 -0500, Brian Bohlmann <bohlmann@uiuc.edu> wrote:
:
: cc -c -xO3 -xdepend -DVERSION=\"2.14\" -DXS_VERSION=\"2.14\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE ReadKey.c
: /usr/ucb/cc: language optional software package not installed
: *** Error code 1
: make: Fatal error: Command failed for target `ReadKey.o'
: /usr/ccs/bin/make -- NOT OK
Looks like you don't have a working 'cc' installed.
Try this instead:
prompt$ perl Makefile.PL CC=gcc
-OR-
prompt$ CC=gcc ; export CC
prompt$ perl Makefile.PL
--
Nate II
------------------------------
Date: Mon, 17 Jul 2000 16:40:34 -0500
From: Brian Bohlmann <bohlmann@uiuc.edu>
Subject: Re: problem adding modules with cpan
Message-Id: <39737D52.EB2382@uiuc.edu>
I tried your suggestions but it seems that the "cpan" modules want to use cc
and not gcc as I got compiler errors. Does anyone know if cpan modules
can use gcc?
gcc -c -xO3 -xdepend -DVERSION=\"2.14\" -DXS_VERSION=\"2.14\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE ReadKey.c
gcc: unrecognized option `-KPIC'
gcc: language depend not recognized
gcc: ReadKey.c: linker input file unused since linking not done
Running Mkbootstrap for Term::ReadKey ()
chmod 644 ReadKey.bs
LD_RUN_PATH="" cc -o blib/arch/auto/Term/ReadKey/ReadKey.so -G ReadKey.o
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/Term/ReadKey/ReadKey.so'
thanks again
-Brian
NP wrote:
> On Mon, 17 Jul 2000 14:14:14 -0500, Brian Bohlmann <bohlmann@uiuc.edu> wrote:
> :
> : cc -c -xO3 -xdepend -DVERSION=\"2.14\" -DXS_VERSION=\"2.14\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE ReadKey.c
> : /usr/ucb/cc: language optional software package not installed
> : *** Error code 1
> : make: Fatal error: Command failed for target `ReadKey.o'
> : /usr/ccs/bin/make -- NOT OK
>
> Looks like you don't have a working 'cc' installed.
>
> Try this instead:
>
> prompt$ perl Makefile.PL CC=gcc
>
> -OR-
>
> prompt$ CC=gcc ; export CC
> prompt$ perl Makefile.PL
>
> --
> Nate II
------------------------------
Date: Mon, 17 Jul 2000 21:04:45 +0100
From: spike1@freenet.co.uk
Subject: Re: programming tools and techniques
Message-Id: <tsovk8.8ur.ln@ridcully.freenet.co.uk>
In comp.os.linux.misc Dmitri V <dmvo@nospam.artic.net> wrote:
> Thank you, Andrew, that *was* an impressive exposition.
Thanks.
> I'll keep this text for my future reference on how to write educational
> materials.
Just remember to get rid of all the spelling mistakes and gramatical errors.
And the more deliberate inaccuracies.
(Amending the make world example, for example)
:)
--
______________________________________________________________________________
| spike1@freenet.co.uk | "Are you pondering what I'm pondering Pinky?" |
|Andrew Halliwell BSc(hons)| |
| in | "I think so brain, but this time, you control |
| Computer Science | the Encounter suit, and I'll do the voice..." |
------------------------------------------------------------------------------
------------------------------
Date: Mon, 17 Jul 2000 16:42:09 -0400
From: Jan Schaumann <jschauma@netmeister.org>
Subject: Re: programming tools and techniques
Message-Id: <963866529.268701368@news-east.speakeasy.org>
spike1@freenet.co.uk wrote:
>In comp.os.linux.misc acunet3278@my-deja.com wrote:
<snip>
>
>Commone examples are:
>make all (Make all files and executable)
>make world (something only deities tend to be able to do)
>make docs (don't compile the code, just generate the documentation)
>make coffee (This sends a signal to the coffee machine to make coffee)
actually... in an ideal work-environment this one sends an email/pager/be=
eper
message to the intern.
;-)
-Jan
--=20
Jan Schaumann <http://www.netmeister.org>
I know the answer! The answer lies within the heart of all mankind!
The answer is twelve? I think I'm in the wrong building.
=09=09-- Charles Schulz
------------------------------
Date: Mon, 17 Jul 2000 18:08:26 GMT
From: schnurmann@my-deja.com
Subject: Re: Qs for professional Perl/CGI developers
Message-Id: <8kvi2b$3r2$1@nnrp1.deja.com>
This is yet another reason why companies need to learn the value of
telecommutting.
In article <slrn8muvgu.eq3.tadmc@magna.metronet.com>,
tadmc@metronet.com (Tad McClellan) wrote:
> On 14 Jul 2000 20:01:45 GMT, Nobody <nobody@contract.Sun.COM> wrote:
> >>On Fri, 14 Jul 2000 00:01:47 GMT, Pjtg0707 <Pjtg0707@Netscape.net>
wrote:
> >>
>
> >>>What is the general going rate for a Perl developer?
> >>
> >>
> >It varies.
>
> >Note: This is in the Boston area, where the demand is so high (for
Perl
> >and anything web-related) that I could employ a dozen or so
> >of me...if only I could clone myself :-)
>
> One of my clients is in the Boston area.
>
> They looked for Perl programmers (with some help from me and from
> headhunters) for about six months, then gave up and had me come
> teach Perl to several of their employees instead.
>
> Boston must be hot for Perl programmers...
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 17 Jul 2000 12:36:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Read a file into a hash ?
Message-Id: <MPG.13dd002c9af4751398abd6@nntp.hpl.hp.com>
In article <snt96l08.fsf@macforce.sumus.dk> on 17 Jul 2000 13:42:31
+0200, Jakob Schmidt <sumus@aut.dk> says...
...
> > foreach $lines(@users) {
> (while...)
> > chop($lines);
>
> just chop;
Using Perl 5 (and aren't we all?): chomp;
> > @line = split(/\:/,$lines);
>
> just @line = split ':';
>
> > # put users into %users ??
>
> $users{ shift( @line ) } = [ @line ];
Because this statement both copies @line and shifts an element from it,
it shouldn't be done the way you have it, because of ambiguity in the
order in which the operations are performed.
my $login = shift @lines;
$users{$login} = [ @line ];
or
$users{$line[0]} = [ @line[1 .. $#line] ];
One might Benchmark to see which way is faster, if one cared.
> > }
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 17 Jul 2000 23:40:18 +0200
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: Read a file into a hash ?
Message-Id: <k8ektozh.fsf@macforce.sumus.dk>
Larry Rosler <lr@hpl.hp.com> writes:
> In article <snt96l08.fsf@macforce.sumus.dk> on 17 Jul 2000 13:42:31
> +0200, Jakob Schmidt <sumus@aut.dk> says...
>
> > just chop;
>
> Using Perl 5 (and aren't we all?): chomp;
Certainly. But I think I remember that chop is faster (as it would seem
obvious) so it may still be defended in a cas such as this where the input is
very disciplined. You may argue of course that the solutions posted in this
forum serve as general examples as well and ought to be fool proof.
> > $users{ shift( @line ) } = [ @line ];
>
> Because this statement both copies @line and shifts an element from it,
> it shouldn't be done the way you have it, because of ambiguity in the
> order in which the operations are performed.
I missed that one thinking naïvely that perl would evaluate shift( @line )
first. Apparantly that is not the case, sorry and thanks for noticing. So
I learned something too.
Oh and by the way - I think that I ought to have included an explicit close
too:
close PASSWD;
Far as I can see there's no consensus for checking the success of close()
(on filehandles). Maybe because finding that it doesn't is just so embarrassing
that you don't even want to know?
--
Jakob
------------------------------
Date: Mon, 17 Jul 2000 22:00:59 GMT
From: "Blair Heuer" <ab@cd.com>
Subject: regular expression - html tag-esque pattern
Message-Id: <vmLc5.76234$_b3.2277020@newsread1.prod.itd.earthlink.net>
I am writing a message board script that uses templates for the layout of
the output page. In the templates are custom tags which need to be found and
replaced. I originally used the tag format, [out author], to set where and
what was replaced. I was able to use the following code to do what I wanted:
$template =~ s/\Q[\E(\w+)\s(\w+\.*\w*\.*\w*)\Q]\E/&process($1,$2)/gie;
# \Q[\E could probably just have been \[, but I was being verbose
# &process takes the found string, processes it, and returns the
apropriate value
# (\w+\.*\w*\.*\w*) is how it is, since some tags could be [in
text.author.post] or whatever
That worked, but was limited, since I had to remember what word.word.word
orders were for each tag and this is for a service to offer, so I wanted a
simpler format. What I want to be able to do is use a format of: [out
name="author"] that can have more than one attribute as well as qouted and
unqouted values such as: [out name=author value="Not Here"].
The problem is, I cannot figure out how to search/replace to get the values.
What I have come up with so far is:
$template =~ s/\[(\w+)\s*(.*)\]/&process($1,$2)/gie;
sub process() {
my %tag;
foreach $each ( split(/\s+/, $_[1]) ) {
my @tag = split( /\=/, $each );
$tag{ $tag[0] } = $tag[1];
}
...
}
That takes the tag puts the type (such as 'out' used above) into $1 and the
rest of the tag into $2. Then it splits it into values, or at least should.
the way it goes something like name="Blair Heuer" would be split and
everything would be messed up.
So how would I have it split the tag apart without spliting the spaces
within qoutes?
Aso,the code above does not work even with no spaces in the values, any
ideas why?
Also, if two tags are next to each other, it puts them all as one, any way
to fix that?
([out author][out email] would be read from the first [ to the
last ] )
Finally, if anyone knows a better way to do this, please tell me.
Thanks for any help,
Blair Heuer
------------------------------
Date: 13 Jul 2000 16:45:41 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Shortcut for non-defined variables
Message-Id: <slrn8msbkv.dun.abigail@alexandra.delanet.com>
James Weisberg (chadbour@wwa.com) wrote on MMDVIII September MCMXCIII in
<URL:news:Y6mb5.1710$IZ1.13486@iad-read.news.verio.net>:
~~ Here's an extremely simple Perl question. Is there a shorthand for
~~ the statement:
~~
~~ $val = (defined $val) ? $val : -1;
~~
~~ To me, this looks ugly. The || operator is fine for making
~~ statements like:
~~
~~ $val ||= -1;
~~
~~ but $val will be set to -1 if $val is 0, which is not what I want
~~ to do. Have I missed something? I'm surprised there is no way to do
~~ the equivalent of:
~~
~~ $val def= -1;
~~
~~ where $val is set to -1 if $val is not defined.
That has been beaten to death. Many people want it. Some people don't.
Some people deflect each discussion to try to introduce an extremely
generic operator, which, if used, is even more awkward than the defined
statement above - just to move away the discussion from introducing the
new operator.
People prefer to have the pointless 'our' (use a pragma to save one line
of typing!), incomplete Unicode support and obscure regex features.
But Larry is undecided, the pumpking is opposed, and p5p has been falling
apart due to flaming, many of which caused by this proposed operator.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s};;;
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)}; # Perl 5.6.0 broke this...
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: 14 Jul 2000 04:31:14 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Shortcut for non-defined variables
Message-Id: <slrn8mtkvu.dun.abigail@alexandra.delanet.com>
Michael Carman (mjcarman@home.com) wrote on MMDVIII September MCMXCIII in
<URL:news:396E14D9.F47DBB77@home.com>:
##
## No, there isn't such a beast. There has been a (recurring) holy war
## about creating a '??' (hookhook) operator for just that purpose, but it
## hasn't happened. For an in-depth analysis of *why* it hasn't been
## adopted, read the following article by Tom Christiansen:
##
## http://www.perl.com/tchrist/defop/defconfaq.html
I wouldn't call that an in-depth analysis.
An emotional, political document, yes.
If half of the arguments in that document played any role in determining
what goes into Perl and what not, we wouldn't have had "our".
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
Date: 14 Jul 2000 22:23:00 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Silly Question?
Message-Id: <slrn8mvjpf.dun.abigail@alexandra.delanet.com>
Keith Calvert Ivey (kcivey@cpcug.org) wrote on MMDIX September MCMXCIII
in <URL:news:39701117.37152528@nntp.idsonline.com>:
:)
:) You're misunderstanding the return value of an = expression.
:) The condition $A = "" will *always* be false, because "" is
:) false. But you are, of course, right in saying that HiTekHick's
:) answer was completely wrong.
Never say always. After all, this is Perl.
#!/opt/perl/bin/perl
use strict;
sub A::TIESCALAR {bless [] => 'A'}
sub A::FETCH {1}
sub A::STORE {}
tie my $A => 'A';
if ($A = "") {
print "Yippie!\n"
}
__END__
Yippie!
Abigail
--
# Perl 5.6.0 broke this.
%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
------------------------------
Date: Mon, 17 Jul 2000 17:01:37 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Suggestion for syntax change
Message-Id: <39738240.AEA38FF1@mindspring.com>
In the following chunk of code:
my @list = qw(apple boy cow);
print $list[0] . "\n";
print $list[2] . "\n";
print join(',', @list[0..2]) . "\n";
print $list[0] . "\n";
print $list[-1] . "\n";
print join(@list[0..-1]) . "\n";
outputting:
apple
cow
apple,boy,cow
apple
cow
(blank line)
wouldn't it make more sense if the last line were:
apple,boy,cow
?
I.e., letting you use the negative subscripts (meaning distance from end
of the string) inside a slice range might be rather nice.
------------------------------
Date: 14 Jul 2000 04:37:28 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: telephone answering machine
Message-Id: <slrn8mtlbl.dun.abigail@alexandra.delanet.com>
Cheeby (sfox@earthlighttechnologies.com) wrote on MMDVIII September
MCMXCIII in <URL:news:8kknnf$q5i$1@jair.pressenter.com>:
@@ Has anyone out there tried to make a simple voice mail/answering machine in
@@ Perl? I can't find a good program for my Linux box and thought I'd take a
@@ crack at it. So I'm wide open to suggestions.
I'd use Coy.pm to generate the messages.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: Mon, 17 Jul 2000 13:11:17 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: To Schwartz or not to Schwartz?
Message-Id: <MPG.13dd083e16b5250598abd7@nntp.hpl.hp.com>
In article <39732E4D.63C784DC@visv.net> on Mon, 17 Jul 2000 16:03:30
GMT, Michael Fischer <michael@visv.net> says...
> Some co-workers and I recently used the Schwartzian
> transform to do some sorting of keys of hashes by
> the values of a hashref embedded in the former hash.
>
> Something like
>
> my @sorted =
> map { $_->[0] }
> sort { $a-[1] cmp $b->[1] }
> map { [ $_, $$hash{'key1'}{'key2'}{'key3'} ] }
> ( keys %hash );
You mean the first key to be $_, not 'key1', as you show below.
> However, another co-worker pointed out that this was
> unnecessary, and that simply
>
> my @sorted =
> sort { $$hash{$a}{'key2'}{'key3'} cmp $$hash{$b}{'key2'}{'key3'} }
> ( keys %hash );
>
> was both functional and more efficient.
How did you confirm that it was more efficient?
> my @sorted_files = sort { -M $a <=> -M $b } @files;
...
> and found that it works.
But you didn't find out how well it performs. (The answer is that its
performance will be poor if there are many files in the array to be
sorted, because each file is stat-ted O(log N) times instead of once.)
> So, we find ourselves wondering _when_ the Schwartz is
> more appropriate or even necessary compared to this more
> direct method. Is it that if the sorting keys and the
> list to be sorted must be linked together because they
> are originally not part of the same data structure?
> ( or fudgeable as 'the same data structure' as -M is
> when applied to a list of filenames?)
The basic issue is whether the cost of computing and caching each key
once and retrieving it for comparison when needed is less than the cost
of computing each key every time it is needed. This has no general
answer, but is true for all but the most trivial cases. Your
multinested hash lookup may be one of those cases. Only Benchmarking
can decide which is better.
For a much more complete discussion, see the following:
<URL:http://www.hpl.hp.com/personal/Larry_Rosler/sort/>
> Thank you for your time and input.
You're welcome. The actual work was done a year ago. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 15 Jul 2000 05:23:56 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Trying to use an array as a hash value
Message-Id: <slrn8n0cem.ibq.abigail@alexandra.delanet.com>
doglovers@rocketmail.com (doglovers@rocketmail.com) wrote on MMDX
September MCMXCIII in <URL:news:396fc8f2.58675416@news.erols.com>:
`` I'm a little weak on references, but my understanding is that you
`` can't have an array as a hash value, but you can have a reference to
`` an array as a hash value. So if you create the reference to an array:
``
`` $arrayref = \(a,b,c,d), then you put the reference into the the hash:
But that doesn't create a reference to an array. It will make $arrayref
a reference to `d'.
``
`` Message => $arrayref,
``
`` which you then dereference with @$arrayref when
`` you need it. Or you can put in an anonymous array with:
``
`` Message => [a,b,c,d]
``
`` which would work also. I think.
*That* will work, yes.
And so will:
@message = ('a', 'b', 'c', 'd');
%hash = {Message => \@message};
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: 14 Jul 2000 22:26:17 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: untainting insecure dependancy?
Message-Id: <slrn8mvjvk.dun.abigail@alexandra.delanet.com>
pkey@sghms.ac.uk (pkey@sghms.ac.uk) wrote on MMDIX September MCMXCIII in
<URL:news:396ee8e5.7888928@news.sghms.ac.uk>:
$$ Solaris
$$
$$ I have a perl program which I pass a parameter using @ARGV.
$$
$$ The program runs something like this:
$$
$$ $test_user = $ARGV[0];
$$
$$ $quota1 = `quota -v $test_user`;
$$
$$ I then get the following taint error:
$$
$$ Insecure dependency in `` while running with -T switch (referring to
$$ the quota system call.
$$
$$ I know why I'm getting the taint error - how can I untaint the error
$$ so that my program runs?
Eh, if you are going to trust whatever input your program is getting,
why bother with tainting?
Abigail
--
BEGIN {my $x = "Knuth heals rare project\n";
$^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
$y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;
------------------------------
Date: Mon, 17 Jul 2000 20:07:42 +0200
From: "Nivel33" <nivel33@hotmail.com>
Subject: RE: Viewing HTTP headers
Message-Id: <8kvi75$6ps$1@diana.bcn.ttd.net>
i think that a solution is a telnet conexion to port 80 (Net:Telnet) and
you`'ll receive the HTTP Headers
send :
>telnet www.perl.com:80
>GET /index.html HTTP/1.0
>
receive :
HTTP/1.1 403 Forbidden
Date: Mon, 17 Jul 2000 18:03:52 GMT
Server: Apache/1.3.9 (Unix)
Connection: close
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
...
------------------------------
Date: 13 Jul 2000 15:29:53 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Why $|++ instead of $|=1 ?
Message-Id: <slrn8ms76t.dun.abigail@alexandra.delanet.com>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote on MMDVIII September MCMXCIII in
<URL:news:8kkmk2$bfh$1@pegasus.csx.cam.ac.uk>:
[] Abigail <abigail@delanet.com> wrote:
[] >
[] >That's what local is for. Your subs will fail to do the right thing
[] >if $| happens to be -1. Or imagine that some_sub has a fatal error in
[] >it, which is caught by an eval{}. Your entire $| ++ and $| -- will be
[] >hosed.
[]
[] Nope. $| is magical, and can only ever take values 0 or 1. Which
[] means the subroutine is nonsense for other reasons.
[]
[] And that also shows that $|++ is exactly the same as $|=1, so entirely
[] respectable if a little eccentric.
I could just imagine that some time in the past, $| was made magical
because the use of $|++ caused problems....
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT
------------------------------
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 3697
**************************************