[9808] in Perl-Users-Digest
Perl-Users Digest, Issue: 3401 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 9 20:07:15 1998
Date: Sun, 9 Aug 98 17:00:19 -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, 9 Aug 1998 Volume: 8 Number: 3401
Today's topics:
ActiveState 5.005: Where are the threads? <mschilli@blaxxun.com>
Re: Binary pattern matching (Ronald J Kimball)
CGI for managing web site??? <mmosher@ibm.net>
Checking if URL is valid/exist using PERL vanja@siamrelay.com
Re: Checking if URL is valid/exist using PERL <merlyn@stonehenge.com>
chown -h (Sweth Chandramouli)
Re: clp.misc etiquette question <mgregory@asc.sps.mot.com>
Re: clp.misc etiquette question (Gary L. Burnore)
Re: comp.lang.perl.announce redux <pgunn01@ibm.net>
Re: Cronjob and Perl "qq" command (I R A Aggie)
Re: Disrib. with other apps? (Andrew M. Langmead)
Re: Good Book? tarik@alkasab.com
HTTP Header (using IO::Socket) <Brandon@xmission.com>
Re: HTTP Header (using IO::Socket) <merlyn@stonehenge.com>
Re: HTTP Header (using IO::Socket) <Brandon@xmission.com>
Re: math error <T.Bridgwater@mindgear.com>
Re: mirroring CPAN thru socks proxy? (Martien Verbruggen)
perl -w compile and run time checking (RonaldWS)
perl and ftp <sam_ansari@hotmail.com>
printing remote host <temery@crocker.com>
Starting a new script to run in BG <Brandon@xmission.com>
strings (EkimicraD)
Re: strings (Craig Berry)
Re: strings (EkimicraD)
Re: strings (Matthew Bafford)
Re: strings (Craig Berry)
SUID Perl script (taintperl) blues <apollock@bit.net.au>
Trouble compiling 5.004_04 (Brian Springstead)
USE Order ! (Hansjvrg Beck)
Re: USE Order ! (Alastair)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 09 Aug 1998 10:42:45 -0700
From: Michael Schilli <mschilli@blaxxun.com>
Subject: ActiveState 5.005: Where are the threads?
Message-Id: <35CDDF95.721732A1@blaxxun.com>
Hi all,
unfortunately, the only binary 5.005 distribution for Win32
(ActiveState) doesn't support the new threads features. Anyone knows of
a binary distribution that includes them?
-- Michael
------------------------------
Date: Sun, 9 Aug 1998 19:23:39 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Binary pattern matching
Message-Id: <1ddhvoj.np5upkwh79j4N@bay1-189.quincy.ziplink.net>
REUBEN LOGSDON <rlogsdon@io.com> wrote:
> If you are looking for non-standard characters, like chr(21), you can't
> just paste that into your $pat string. You have to do something like:
>
> $pat = chr(21).chr(4).chr(3); # etc.
Ick! You don't have to do it like that.
$pat = "\x15\x4\x3"; # hexadecimal
or
$pat = "\025\04\03"; # octal
or
$pat = "\cU\cD\cC"; # control characters
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 9 Aug 1998 17:30:44 -0500
From: "Michael Mosher" <mmosher@ibm.net>
Subject: CGI for managing web site???
Message-Id: <35ce2408.0@news1.ibm.net>
Does anyone know of a script for uploading and deleting files without using
FTP? I'd like one that's easy to set up. Please post or email your
suggestions.
Thanks,
Mike Mosher
mmosher@ibm.net
------------------------------
Date: Sun, 09 Aug 1998 17:41:56 GMT
From: vanja@siamrelay.com
Subject: Checking if URL is valid/exist using PERL
Message-Id: <6qkn14$sbd$1@nnrp1.dejanews.com>
Is it possible to check if URL is valid (if it exists) using PERL?
I am sure that I have seen something about that topic on Dejanews few days
ago, but there's no way in hell I can find that message again.
If someone can point me to any direction...
Thanks in advance,
Vanja
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sun, 09 Aug 1998 18:16:21 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Checking if URL is valid/exist using PERL
Message-Id: <8chfzmvx5i.fsf@gadget.cscaper.com>
>>>>> "vanja" == vanja <vanja@siamrelay.com> writes:
vanja> Is it possible to check if URL is valid (if it exists) using
vanja> PERL? I am sure that I have seen something about that topic on
vanja> Dejanews few days ago, but there's no way in hell I can find
vanja> that message again.
vanja> If someone can point me to any direction...
Yes:
use LWP::Simple;
print "it's valid" if get $url;
Can't be much simpler than that.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 09 Aug 1998 20:37:11 GMT
From: sweth-usenet@astaroth.nit.gwu.edu (Sweth Chandramouli)
Subject: chown -h
Message-Id: <sweth-usenet-0908981637470001@alex-va-n013c081.moon.jic.com>
is there some way to have the chown function in perl work like the
chown program itself does when invoked with the -h flag (i.e. affect a
symlink if that is its target, rather than the file to which that symlink
points)? alternately, can chown be given device and inode info (as
obtained from lstat) to define its target, to get around the problem
entirely?
tia,
sweth.
--
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@gwu.edu> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>
------------------------------
Date: 09 Aug 1998 21:43:36 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: clp.misc etiquette question
Message-Id: <r8ww8ibbf3.fsf@asc.sps.mot.com>
"Matthew O. Persico" <mpersico@erols.com> writes:
> When the answer to a question posed here is conceptually:
>
> perldoc yadayady | grep conceptInQuestion
>
> what is the general feeling in the group about posting the answer and/or
> mailing the answer?
As others said, just post a polite answer that says "The answer is <>,
and you can find it in <>".
You can rely on the other flamers to make sure the person knows not to
do it again, so you don't have to worry about that aspect yourself!
Isn't this a great group - all the services laid on!
Cheers,
Martin.
------------------------------
Date: Sun, 09 Aug 1998 20:25:29 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: clp.misc etiquette question
Message-Id: <35ce0576.252808011@nntpd.databasix.com>
On 09 Aug 1998 21:43:36 +0930, in article <r8ww8ibbf3.fsf@asc.sps.mot.com>,
Martin Gregory <mgregory@asc.sps.mot.com> wrote:
>"Matthew O. Persico" <mpersico@erols.com> writes:
>
>> When the answer to a question posed here is conceptually:
>>
>> perldoc yadayady | grep conceptInQuestion
>>
>> what is the general feeling in the group about posting the answer and/or
>> mailing the answer?
>
>As others said, just post a polite answer that says "The answer is <>,
>and you can find it in <>".
I agree with Martin on this. Politely saying here's your answer and it's in
the faq.
>
>You can rely on the other flamers to make sure the person knows not to
>do it again,
And you can rely on still others to tell them to eat it. :)
> so you don't have to worry about that aspect yourself!
And he doesn't have to be a jerk.
>Isn't this a great group - all the services laid on!
Indeed.
--
I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
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
Special Sig for perl groups. | Official Proof of Purchase
===========================================================================
------------------------------
Date: Sun, 09 Aug 1998 13:59:30 -0400
From: Pat Gunn <pgunn01@ibm.net>
Subject: Re: comp.lang.perl.announce redux
Message-Id: <35CDE382.5D0B@ibm.net>
Greg Bacon wrote:
>
> In article <35C7A699.68E3@ibm.net>,
> Pat Gunn <pgunn01@ibm.net> writes:
> : This isn't to say that you can't have a new newsgroup with a
> : different moderator created, or to say that you can't express
> : displeasure to him...
>
> You're mistaken in the first part. tale won't accept an RFD for the
> removal of a moderator. An RFD for another .announce group wouldn't
> be likely to fly either.
You misread me. I said
This isn't to say that you can't have a new newsgroup with a different
moderator created
Let's break this down
This isn't to say that you can't have [a new newsgroup with a different
moderator] created.
I never suggested that removal of moderators was possible. I'm saying
that making new moderated newsgroups is possible :)
--
---------------------------------------------------
Pat Gunn, moderator:comp.sys.newton.announce
comoderator:comp.os.os2.moderated
"You can always judge a man by the quality of his enemies." -- Dr Who
http://junior.apk.net/~qc
------------------------------------------------
------------------------------
Date: Sun, 09 Aug 1998 13:29:43 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Cronjob and Perl "qq" command
Message-Id: <fl_aggie-0908981329580001@aggie.coaps.fsu.edu>
In article <6qftl1$t1d$1@nnrp1.dejanews.com>, edwardv@jps.net wrote:
+ Can any one tell me why my scripts work when i run them manually but when i
+ run them in a cron i get errors? I think it has to do with perl's "qq"
+ command because if i take out everything associated with the 'qq' command, my
+ error goes away and the scripts work.
Actually, not. cron provides a rather limited environment. I suspect that
cron doesn't know where 'dbaccess' exists. I suspect that if you just
provide it with /full/path/to/dbaccess, it may work.
James
------------------------------
Date: Sun, 9 Aug 1998 15:57:52 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Disrib. with other apps?
Message-Id: <ExFJ0G.B3@world.std.com>
"Steve Serrell" <foursuns@inetport.com> writes:
>Andrew M. Langmead wrote in message ...
>>Do you think it is really a bright idea to trust your business to what
>>people on Usenet tell you?
> Do you think it is a really bright assumption to equate automatic
>trust with inquery?
Maybe not, but sometimes its hard to tell what is going on in someones
head above the relatively small amount of information that they
posted. An analogy to a more concrete example is when someone posts a
question like "How do I access a variable whose name is stored in
another variable?" If you just answer with a description of symbolic
references, you might be doing the poster a diservice, since there are
few situations where symbolic references are actually needed. If you
just tell them to use a hash instead, you aren't answering their
question, and you may not be giving them the information that they
need for their specific problem. Best to give them the answer they
asked for, plus a gentle nudge towards the answer to the bigger
question they didn't ask.
[stuff deleted]
>Thanks for your feedback and your feelings...
Sometimes you have to take both when you ask for one or the other.
--
Andrew Langmead
------------------------------
Date: Sun, 09 Aug 1998 16:39:57 GMT
From: tarik@alkasab.com
Subject: Re: Good Book?
Message-Id: <6qkjct$n7k$1@nnrp1.dejanews.com>
In article <35CB5088.36D2@ford.com>,
dparrott@ford.com wrote:
> I tend not to refer people to the books like "Perl for
> Simpletons and Foofs" or "Learn Perl in 27 Microseconds
> or Less" because they tend not to deliver what they
> claim as well as mislead people into believing that they
> can really master some reasonably complicated things
> (like Perl) in a few, painless days.
In general, I agree with you. However, I must say that I was able to learn
enough of Perl 4 in a few (not quite painless) days from a book called "Learn
Perl in 21 Days" to write some useful programs. (Some of which are still in
use, unfortunately; it physically hurts me to look at them now. But they
work!)
I think that's actually one of the strengths of Perl: even if you don't get
the complicated stuff, you can "baby talk" your way through some pretty
useful tasks more easily than using other tools. (And then you can read the
more serious books, which I also did. :-)
Terry
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sun, 09 Aug 1998 10:51:37 -0600
From: Brandon Pulsipher <Brandon@xmission.com>
Subject: HTTP Header (using IO::Socket)
Message-Id: <35CDD398.7D21CCCF@xmission.com>
I got the following code to work fine for regular http requests.
Howevr, now I want to make and HTTP request for a page that is password
protected. I was instructed to add: "Authorization: Basic
base64-encoded-string" to the request, where "base64-encoded-string" is
the base64 of "username:password". I still get an access denied,
however. Below is the code I am using.
Thank your for any help you can offer.
-Brandon
-Brandon@xmission.com
--------CODE----------
print "Host: $host<BR>\n";
print "Document: $document<BR>\n";
use IO::Socket;
$remote = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => $host,
PeerPort => "http(80)",
);
unless ($remote)
{
die "cannot connect to ftp daemon on $host"
}
$remote->autoflush(1);
print "<BR>Making request...<BR>";
# print $remote "GET $document HTTP/1.0\n\n";
print $remote "GET $document HTTP/1.0 Authorization: Basic
base64-encoded-string\n\n";
while ( <$remote> ) { print }
close $remote;
------------------------------
Date: Sun, 09 Aug 1998 18:15:26 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: HTTP Header (using IO::Socket)
Message-Id: <8clnoyvx70.fsf@gadget.cscaper.com>
>>>>> "Brandon" == Brandon Pulsipher <Brandon@xmission.com> writes:
Brandon> I got the following code to work fine for regular http
Brandon> requests. Howevr, now I want to make and HTTP request for a
Brandon> page that is password protected. I was instructed to add:
Brandon> "Authorization: Basic base64-encoded-string" to the request,
Brandon> where "base64-encoded-string" is the base64 of
Brandon> "username:password". I still get an access denied, however.
Brandon> Below is the code I am using.
Brandon> Thank your for any help you can offer.
Yes. Stop reinventing LWP. Go get LWP. LWP is your friend.
It's bloated for a reason -- it does sooooooo much!
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 09 Aug 1998 17:36:23 -0600
From: Brandon Pulsipher <Brandon@xmission.com>
Subject: Re: HTTP Header (using IO::Socket)
Message-Id: <35CE3277.E7A0320B@xmission.com>
Problem solved. I am now using LWP.
Brandon Pulsipher wrote:
> I got the following code to work fine for regular http requests.
> Howevr, now I want to make and HTTP request for a page that is password
> protected. I was instructed to add: "Authorization: Basic
> base64-encoded-string" to the request, where "base64-encoded-string" is
> the base64 of "username:password". I still get an access denied,
> however. Below is the code I am using.
>
> Thank your for any help you can offer.
>
> -Brandon
> -Brandon@xmission.com
>
> --------CODE----------
>
> print "Host: $host<BR>\n";
> print "Document: $document<BR>\n";
> use IO::Socket;
>
> $remote = IO::Socket::INET->new( Proto => "tcp",
> PeerAddr => $host,
> PeerPort => "http(80)",
> );
> unless ($remote)
> {
> die "cannot connect to ftp daemon on $host"
> }
> $remote->autoflush(1);
> print "<BR>Making request...<BR>";
> # print $remote "GET $document HTTP/1.0\n\n";
> print $remote "GET $document HTTP/1.0 Authorization: Basic
> base64-encoded-string\n\n";
>
> while ( <$remote> ) { print }
> close $remote;
------------------------------
Date: Sun, 09 Aug 1998 22:10:04 -0700
From: Tom Bridgwater <T.Bridgwater@mindgear.com>
Subject: Re: math error
Message-Id: <35CE80AC.7A354A3A@mindgear.com>
M.J.T. Guy wrote:
> You're failing to understand the nature of floating point arithmetic
> and rounding errors. The first entry in perldoc perlfaq4 is
> relevant.
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq4/Why_isn_t_my_octal_data_interpre.html
is the first article but doesn't seem to apply.
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq4/Does_perl_have_a_round_function_.html
is the second article and is relevant in the suggestion to use sprintf
(instead of int).
The question is not about whether there are rounding errors (which there
are) or about how to round numerical data (using sprintf), but why does
a number that has been forced to an integer (and prints as an integer)
not behave properly in an addition expression. If the int function would
sometimes yield a number that was one higher/lower than expected I could
understand the rounding error, but that's not the case here.
---
Tom Bridgwater
Product Development
mindgear
T.Bridgwater@mindgear.com
find mindgear at: http://www.mindgear.com
------------------------------
Date: 9 Aug 1998 23:32:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: mirroring CPAN thru socks proxy?
Message-Id: <6qlbj2$nqh$1@nswpull.telstra.net>
In article <35CACB89.F2EBE643@fc.hp.com>,
Derek <dereks@fc.hp.com> writes:
> Perhaps a "SOCKS version of perl" is just one that has been "soxified" using
> the tools that come with SOCKS distribution?
Yes.
I use perl regularly with the runsocks script. Works fine.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 9 Aug 1998 19:21:46 GMT
From: ronaldws@aol.com (RonaldWS)
Subject: perl -w compile and run time checking
Message-Id: <1998080919214600.PAA18403@ladder01.news.aol.com>
The following short code snippet
$x = 1;
$y = ${ 'x' };
print "$y\n";
yields the following error when run with perl -w
Name "main::x" used only once: possible typo at c:\temp.pl line 1.
This is understandable in terms of perl doing compile time error
detection but does not really appear to be desireable behavior.
Is there any way to control perl's selection of warnings (eg turn
them off as with some 'C' compilers. Can this be construed as
a bug?
Ron Schmidt
The Software Path
RonaldWS@software-path.com
Please cc all replies to RonaldWS@software-path.com
------------------------------
Date: Sun, 09 Aug 1998 19:41:21 GMT
From: "sam ansari" <sam_ansari@hotmail.com>
Subject: perl and ftp
Message-Id: <BXmz1.1628$uA4.1030069@news.inreach.com>
Hello fellow perlinskis,
I am currently working on setting up a perl script that uses a ftplib.pl to
ftp files to a number of different servers. The problem that I' m running
into has to do with changing the source directory for ftp. I'm trying to use
a 'socksified' directory to launch ftp from. So the question:
Do you know of a way to redirect perl to launch ftp from a special
directory, either by specifying the full path somewhere in the perl script
or by modifying the ftplib.pl to point to the proper directory. Please
include the right perl commands or functions to use.
Thanks in advance,
Sam , (The stuck-in-perl man)
------------------------------
Date: Sun, 09 Aug 1998 15:22:37 -0100
From: Thomas Emery <temery@crocker.com>
Subject: printing remote host
Message-Id: <35CDCCCC.F21688DC@crocker.com>
I have a message board (and the people) want to list all poster's IP
address. I am assuming that it is as simple as finding the file that
right now generates the messages and put in a line that says something
like print Remote_Host or something like that.
Am I that far over my head?
------------------------------
Date: Sun, 09 Aug 1998 17:35:58 -0600
From: Brandon Pulsipher <Brandon@xmission.com>
Subject: Starting a new script to run in BG
Message-Id: <35CE325D.7AA16EE5@xmission.com>
I am running AS Perl on WinNT 4.0. I am hoping there is solution
to my dilemma. I would like to have a webpage (Perl Script) load and
when it does, spawn another process (Perl script, or subroutine) that
runs in the background until it finishes. Basically, the first time
each day that a certain script on my site is called up, I want it to run
a maintenance script. I don't want this to run and have the user wait,
however, as it could take a while.
Any suggestions here? I hope I made sense. Please CC me on a
response. I only get the digest. Thanks!
-Brandon
------------------------------
Date: Sun, 09 Aug 1998 18:41:01 GMT
From: EkimicraD@xxx.xxx (EkimicraD)
Subject: strings
Message-Id: <35cdec51.0@news.wgn.net>
Ok, I am new to perl, But do make a good effort I think.
Anyways, here is my problem:
$price = "2,450";
if ($price <= "99")
{
....
....
}
what happend is it thinks 2,450 is smaller than 99, i know this is
becouse of the comma.
My question is how do i remove the comma from a string?
please, any help would help.
Mike
------------------------------
Date: 9 Aug 1998 19:00:18 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: strings
Message-Id: <6qkrk2$q49$1@marina.cinenet.net>
EkimicraD (EkimicraD@xxx.xxx) wrote:
: Anyways, here is my problem:
:
: $price = "2,450";
:
: if ($price <= "99")
:
: what happend is it thinks 2,450 is smaller than 99, i know this is
: becouse of the comma.
:
: My question is how do i remove the comma from a string?
$price =~ tr/,//d;
Or, if you want to keep groups of three digits separated, Perl ignores _
inside numbers. So you can do
$price =~ tr/,/_/;
to turn $price into '2_450', then work with that. That makes doing a
reverse tr back to commas trivial, should you need to redisplay $price
later with commas again.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Sun, 09 Aug 1998 19:37:43 GMT
From: EkimicraD@xxx.xxx (EkimicraD)
Subject: Re: strings
Message-Id: <35cdf9a0.0@news.wgn.net>
>:
>: My question is how do i remove the comma from a string?
> $price =~ tr/,//d;
Thank you! this did it perfect!
Mike
------------------------------
Date: Sun, 09 Aug 1998 20:11:46 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: strings
Message-Id: <MPG.1037c4342707af22989694@news.scescape.net>
In article <6qkrk2$q49$1@marina.cinenet.net> on 9 Aug 1998
19:00:18 GMT, Craig Berry (a) felt the following information to
be of use:
> EkimicraD (EkimicraD@xxx.xxx) wrote:
>
> Or, if you want to keep groups of three digits separated, Perl ignores _
> inside numbers. So you can do
>
> $price =~ tr/,/_/;
>
> to turn $price into '2_450', then work with that. That makes doing a
> reverse tr back to commas trivial, should you need to redisplay $price
> later with commas again.
>
>From Programming Perl, page 39:
...The underscore only works within literal numbers
specified in your program, not for strings functioning
as numbers or data read from somewhere else...
$_ = 2_345; # A number, not a string
print $_+1; # Prints 2346
$_ = '2_345'; # A string, not a number
print $_+1; # Prints 3
It's my understanding that the _ is removed at assignment (or
compile time?)...
Hope this helps!
--Matthew
------------------------------
Date: 9 Aug 1998 19:48:43 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: strings
Message-Id: <6qkuer$q49$2@marina.cinenet.net>
Matthew Bafford (dragons@scescape.net) wrote:
: In article <6qkrk2$q49$1@marina.cinenet.net> on 9 Aug 1998
: 19:00:18 GMT, Craig Berry (a) felt the following information to
: be of use:
: > Or, if you want to keep groups of three digits separated, Perl ignores _
: > inside numbers. So you can do
: >
: > $price =~ tr/,/_/;
: >
: > to turn $price into '2_450', then work with that. That makes doing a
: > reverse tr back to commas trivial, should you need to redisplay $price
: > later with commas again.
:
: From Programming Perl, page 39:
:
: ...The underscore only works within literal numbers
: specified in your program, not for strings functioning
: as numbers or data read from somewhere else...
Oops, right you are. Seems a silly way to have implemented things, but
that's the way it is. Ignore my tr/,/_/ recommendation, please.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Mon, 10 Aug 1998 07:26:44 +1000
From: "Andrew Pollock" <apollock@bit.net.au>
Subject: SUID Perl script (taintperl) blues
Message-Id: <6ql46j$fst$1@hermes.bit.net.au>
Hi,
I've got a CGI script that's running setuid root (because it needs to) and
Perl's barfing at the following subroutine saying it's got an insecure
dependency (the chown() line):
sub chown_by_name {
local($user, $pattern)=@_;
chown((getpwnam($user))[2,3], <${pattern}>);
}
I'm calling it like this:
&chown_by_name($ENV{'REMOTE_USER'},
"/home/$ENV{'REMOTE_USER'}/public_html/$local_filename");
and I've previously "untainted" $ENV{'REMOTE_USER'} by going
$ENV{'REMOTE_USER'} =~ /(^.*$)/;
$ENV{'REMOTE_USER'} = $1;
and I've also done a
$< = $>;
earlier in the code.
Any ideas what I'm doing wrong? The book doesn't go into a colossal amount
of detail on setuid scripts.
Thanks in advance.
Andrew
------------------------------
Date: 9 Aug 1998 23:01:48 GMT
From: bspring@j51.com (Brian Springstead)
Subject: Trouble compiling 5.004_04
Message-Id: <slrn6ssb7o.hb8.bspring@j51.com>
I'm having trouble compiling perl 5.004_04. Well to be exact the Configure
script gives up. Here's the problem:
Checking your choice of C compiler, libs, and flags for coherency...
I've tried to compile and run a simple program with:
cc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include -L/usr/local/lib -o try try.c -ln
et -lnsl -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
./try
and I got the following output:
/usr/lib/libnet.so: undefined reference to `threadedAccept'
/usr/lib/libnet.so: undefined reference to `makeJavaString'
/usr/lib/libnet.so: undefined reference to `threadedWrite'
/usr/lib/libnet.so: undefined reference to `AllocArray'
/usr/lib/libnet.so: undefined reference to `threadedConnect'
/usr/lib/libnet.so: undefined reference to `threadedRecvfrom'
/usr/lib/libnet.so: undefined reference to `AllocObjectArray'
/usr/lib/libnet.so: undefined reference to `javaString2CString'
/usr/lib/libnet.so: undefined reference to `SignalError'
/usr/lib/libnet.so: undefined reference to `threadedSocket'
/usr/lib/libnet.so: undefined reference to `AllocObject'
/usr/lib/libnet.so: undefined reference to `threadedRead'
I can't compile the test program.
(The supplied flags might be incorrect with this C compiler.)
You have a BIG problem. Shall I abort Configure (and explain the problem)
[y]
Ok. Stopping Configure.
So what are the right flags? (This was generated with Configure -d) If I remove
-lnet will this solve my problem? Will perl be adversly affected if I take out -lnet?
What's the best way to fix this? Thanks in advance.
Brian
--
Brian Springstead | ...My words but a whisper - your deafness a SHOUT. I may
Tull fan | make you feel but I can't make you think. Your sperm's in
bspring@j51.com | the gutter - your love's in the sink... Jethro Tull
------------------------------
Date: Sun, 9 Aug 1998 23:04:09 +0100
From: hbeck@hochtaunus.net (Hansjvrg Beck)
Subject: USE Order !
Message-Id: <MPG.10382d33a6dcad5f989683@nntp.server.uni-frankfurt.de>
Hello !
Can anyone tell me an alternative to the USE-Order ?
On the Server of my Provider, the usage of this order reults in
an SERVER ERROR ! Why ???
H.Beck
------------------------------
Date: Sun, 09 Aug 1998 22:11:38 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: USE Order !
Message-Id: <slrn6ssb9s.1rc.alastair@calliope.demon.co.uk>
Hansjvrg Beck <hbeck@hochtaunus.net> wrote:
>Hello !
>
>Can anyone tell me an alternative to the USE-Order ?
>On the Server of my Provider, the usage of this order reults in
>an SERVER ERROR ! Why ???
>
>H.Beck
I suppose the best thing to do is find out why the server is doing this. It is
worth ;
Adding the '-w' flag to perl
Checking your web server's error log
Making sure that whatever you're 'using' is installed on the server machine (and
can be found by perl)
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
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 3401
**************************************