[18883] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1051 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 4 00:05:49 2001

Date: Sun, 3 Jun 2001 21:05:09 -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: <991627509-v10-i1051@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 3 Jun 2001     Volume: 10 Number: 1051

Today's topics:
    Re: Configuring Mod_perl on Windows <ron@savage.net.au>
    Re: Configuring Mod_perl on Windows <ron@savage.net.au>
    Re: Configuring Mod_perl on Windows (Chris L)
    Re: Configuring Mod_perl on Windows <godzilla@stomp.stomp.tokyo>
    Re: Configuring Mod_perl on Windows <godzilla@stomp.stomp.tokyo>
    Re: Flame Target <godzilla@stomp.stomp.tokyo>
    Re: Frustrated people (not) answering questions <comdog@panix.com>
    Re: Frustrated people (not) answering questions (Eric Bohlman)
    Re: How to force CPAN installation configuration <bkennedy99@Home.com>
    Re: perl/cgi and dynamic hyperlink <buggs-clpm@splashground.de>
    Re: perl/cgi and dynamic hyperlink <godzilla@stomp.stomp.tokyo>
    Re: perl/cgi and dynamic hyperlink <godzilla@stomp.stomp.tokyo>
    Re: perl/cgi and dynamic hyperlink (krakle)
        Problem with Capturing Program Output under Win98 matessman@yahoo.com
    Re: Problem with Capturing Program Output under Win98 (Jay Tilton)
    Re: Recursing a directory tree <nwang@shell3.shore.net>
        sendmail script problem <mastronardif@monmouth.com>
    Re: sendmail script problem <theaney@toadmail.toad.net>
    Re: sendmail script problem <tony_curtis32@yahoo.com>
        substing and locating <vtbowes@superaje.com>
    Re: substing and locating <theaney@toadmail.toad.net>
    Re: substing and locating (E.Chang)
    Re: taint + netstat = error <ryantate@OCF.Berkeley.EDU>
    Re: taint + netstat = error <ryantate@OCF.Berkeley.EDU>
    Re: TOY: explore the representation of binary floating  <skilchen@swissonline.ch>
    Re: TOY: explore the representation of binary floating  <nospam-abuse@ilyaz.org>
        which nmake ?? <timster@worldnet.att.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 4 Jun 2001 13:01:35 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Configuring Mod_perl on Windows
Message-Id: <G0CS6.1662$QW4.66393@ozemail.com.au>



--
Cheers
Ron  Savage
ron@savage.net.au
http://savage.net.au/index.html
Antoine Hall <AHALL5@nc.rr.com> wrote in message news:8PAS6.124034$Pp1.32572861@typhoon.southeast.rr.com...
> I have intalled Apache on my windows machine and I want to run Mod_perl but
> I cannot seem to configure it correctly.  Does anyone have easy setup steps
> to do this on a windows machine?  I have done it on a linux machine before,
> but I do not know what to do on the windows machine.
>
> Thanks
>
> AE
>
>
>
>
>




------------------------------

Date: Mon, 4 Jun 2001 13:02:47 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Configuring Mod_perl on Windows
Message-Id: <O1CS6.1663$QW4.66517@ozemail.com.au>

See my posting a minute ago in comp.infosystems.www.servers.ms-windows

--
Cheers
Ron  Savage
ron@savage.net.au
http://savage.net.au/index.html

> I have intalled Apache on my windows machine and I want to run Mod_perl but





------------------------------

Date: Mon, 04 Jun 2001 02:23:38 -0000
From: chrisl_ak[AT]hotmail[DOT]com (Chris L)
Subject: Re: Configuring Mod_perl on Windows
Message-Id: <Xns90B5BB29790AEchrislak@207.126.101.100>

Antoine Hall addressed comp.lang.perl.misc and spake thusly:

> I have intalled Apache on my windows machine and I want to run Mod_perl
> but I cannot seem to configure it correctly.  Does anyone have easy
> setup steps to do this on a windows machine?  I have done it on a linux
> machine before, but I do not know what to do on the windows machine.
> 

If you are using ActiveState, I can probably help... I just got it running 
today using ActiveState Build 626 and ppm install for mod_perl. Give details 
on your configuration at this point wrt perl and Apache.


------------------------------

Date: Sun, 03 Jun 2001 19:48:59 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Configuring Mod_perl on Windows
Message-Id: <3B1AF71B.7809571E@stomp.stomp.tokyo>

Antoine Hall wrote:
 
> I have intalled Apache on my windows machine and I want to run Mod_perl but
> I cannot seem to configure it correctly.  Does anyone have easy setup steps
> to do this on a windows machine?  I have done it on a linux machine before,
> but I do not know what to do on the windows machine.


This is what I am using on a Pentium 3 running Win 98 se
and a very recent Apache version. Haven't encountered any
problems so far.

Godzilla!
--

This is extracted from my Apache httpd.conf file:


# BEGIN MOD_PERL CONFIG
LoadModule perl_module modules/ApacheModulePerl
ScriptAlias /perl-bin/ "perl-bin/"
PerlSendHeader On
<Location /perl-bin> 
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI 
</Location>
# END MOD_PERL CONFIG


------------------------------

Date: Sun, 03 Jun 2001 20:26:45 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Configuring Mod_perl on Windows
Message-Id: <3B1AFFF5.4AA47A91@stomp.stomp.tokyo>


* Fault Suckernews if this posts twice. I am having a lot
  of difficulties with Suckernews this weekend, including
  "out of memory" messages from Suckernews. It is difficult
   for me to know if my articles post or not; most never
   show up on Suckernews.



Antoine Hall wrote:
 
> I have intalled Apache on my windows machine and I want to run Mod_perl but
> I cannot seem to configure it correctly.  Does anyone have easy setup steps
> to do this on a windows machine?  I have done it on a linux machine before,
> but I do not know what to do on the windows machine.


This is what I am using on a Pentium 3 running Win 98 se
and a very recent Apache version. Haven't encountered any
problems so far.

Godzilla!
--

This is extracted from my Apache httpd.conf file:


# BEGIN MOD_PERL CONFIG
LoadModule perl_module modules/ApacheModulePerl
ScriptAlias /perl-bin/ "perl-bin/"
PerlSendHeader On
<Location /perl-bin> 
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI 
</Location>
# END MOD_PERL CONFIG


------------------------------

Date: Sun, 03 Jun 2001 18:58:18 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Flame Target
Message-Id: <3B1AEB3A.A0DEA1CD@stomp.stomp.tokyo>

"E.Chang" wrote:
 
> Godzilla! wrote:
 
> [snip]
 
> >Doesn't matter if a SSI called script is a typical .cgi script.
> >Without at least a partial header print, an error log entry will
> >be generated, at least under an Apache server. Nonetheless,
> >data is returned correctly. For these circumstances, all
> >header prints can be excluded without effecting operation.

> >Test this if you wish to observe this behavior.

> Tested as follows:
> 
> The SSI document
>   <html><body>
>   <!--#include virtual='/~echang/cgi-bin/hello.cgi' -->
>   </body></html>
 
> The script
>   #!/usr/bin/perl
>   #print "Content-Type: text/plain\n\n";
>   print "Hello out there, world!";
 
> The result with Content-type header
>   Hello out there, world!
 
> The result without Content-type header (commented out)
>   [an error occurred while processing this directive]
 
> SERVER_SIGNATURE
> Apache/1.3.9 Server at www.netstorm.net Port 80
 

You are making a virtual include, not calling for
an execution. Regardless, two of my servers create
an error log message without a content type yet still
return correct data to a page making an SSI call.

Why would I lie? I am not of the boys here. I have
pride and dignity, as a woman and, enjoy a well
earned reputation for doing my homework.

Godzilla!


------------------------------

Date: Sun, 03 Jun 2001 21:12:31 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Frustrated people (not) answering questions
Message-Id: <comdog-4C7DE0.21123103062001@news.panix.com>

In article 
<Pine.SUN.4.33.0106032016470.1102-100000@mamba.cs.Virginia.EDU>, David 
Coppit <newspost@coppit.org> wrote:

> Agreed. Matt's code, although it may offend the asthetics of many Perl
> aficiando's, gets the job done. 

often it does not, and creates a tremendous support burden when
malicious people trash the users computer.

> That's all most of his "customers"
> care about. AFAIK, most critics of his work don't provide any
> alternative, or even offer to help him update his code to help reduce
> the support burden.

that's simply not true.  Matt refused help and walked away 
from supporting his stuff when he realized it was beyond his
ability.  still, he distributes the bad code.

> On the other hand, you'd expect Matt to update his own code as he
> learns more Perl. :)

 ...or receives patches from other people.  however, this did not
happen and why he is generally loathed.  there are better versions
of his initial efforts out there, but he continues to distribute
versions that have problems. 

he is not a victim.  he victimizes people who don't know any
better.  he does this not out of any sort of generosity but
the pursuit of fame and fortune.  why people insist on 
defending Matt and not Microsoft is boggling.

-- 
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



------------------------------

Date: 4 Jun 2001 03:45:24 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Frustrated people (not) answering questions
Message-Id: <9ff08k$r0e$1@bob.news.rcn.net>

brian d foy <comdog@panix.com> wrote:
> In article 
> <Pine.SUN.4.33.0106032016470.1102-100000@mamba.cs.Virginia.EDU>, David 
> Coppit <newspost@coppit.org> wrote:

>> Agreed. Matt's code, although it may offend the asthetics of many Perl
>> aficiando's, gets the job done. 

> often it does not, and creates a tremendous support burden when
> malicious people trash the users computer.

To amplify here, "gets the job done" should not be used to mean "works 
under ideal conditions."  You can never guarantee that Mr. Murphy will 
never visit you, but much of Matt's code amounts to buying Mr. Murphy 
first class tickets and booking him at the nearest luxury hotel.  The main 
difference between a programmer and a dabbler is that the programmer 
considers how his code will behave when things go wrong.  Much of Matt's 
code can't even cope with simple contingencies like one person starting an 
instance of a CGI script while someone else's instance is still running.

Some of Matt's code may in fact be an impressive effort for a kid just 
learning to program, but that does *not* imply that it makes good code for 
production use.



------------------------------

Date: Mon, 04 Jun 2001 02:24:56 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: How to force CPAN installation configuration
Message-Id: <YjCS6.27921$lP5.12576507@news1.rdc2.pa.home.com>


"Tim" <timster@worldnet.att.net> wrote in message
news:3B1B1EE4.5B747B7C@worldnet.att.net...
> I ran  "perl -MCPAN -e shell" once and it asked me a whole bunch of
> questions which I just casually hit Return to accept the defaults.  Now
> I want to do it again with specific answers, but it doesn't ask me the
> questions again.  How do I force it to go through the configuration ALL
> over again?  On a Linux box, it created ~/.cpan/CPAN/MyConfig.....or
> some such, but I couldn't figure out where it keeps that info in
> Windows98.  [I'd rather not use the 'o conf' command at the cpan>
> prompt.]

CPAN.pm creates a file called Config.pm, which gets stored in @INC.  See the
"configuration" section in "perldoc CPAN" to get the details about it.  The
short answer is that you should delete this file to force CPAN.pm to ask all
the config questions again.  Hope this helps--

--Ben Kennedy





------------------------------

Date: Mon, 4 Jun 2001 03:17:50 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <9fenmd$d9h$00$1@news.t-online.com>

krakle wrote:

> By anychance are you a woman?
 
Newbies bitching is even worse than regulars bitching.

I personally cannot see any reason
for critcizing Godzilla! for telling you to post
the question in a way that she can help.

Please stop it.

-- 
Immature flaming is the cause of grief.


------------------------------

Date: Sun, 03 Jun 2001 18:50:44 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <3B1AE974.C85092A3@stomp.stomp.tokyo>

E.Chang wrote:
 
> krakle@visto.com (krakle) wrote in
 
> > Godzilla burped:

> > "Forgive my terse wording but what is it with so many of
> > you using an expression "...something like" in your
> > articles? Do you want to contruct something like this
> > rule or construct this rule precisely as stated?"

> > I read a few of your previous postings and it seems like all you do
> > is nit pick at the way people post. Geesh you nit picked at my
> > posting because I provided the code I was having trouble on to be
> > very specific. Not everyone is going to use the words YOU want them
> > to use, and post how YOU want them to post.
 
> > By anychance are you a woman?
 
> I do not agree with many of the statements in Godzilla!'s articles, and
> find some of her (yes, her) language rather coarse.  But *that* is  the
> most offensive line I have seen in my time on this newsgroup.


Obviously you were not around when regulars here subjected
my family and myself to absolutely abhorrent and vulgar racial
slurs and death wishes for my entire family, in copious amounts.
These statements made were of such a serious nature, an Assistant
U.S. Attorney General offered to prosecute for hate crimes.

Male chauvinist pigs are a dime a dozen. These racists
populating this group, are of no worth but inflict very
serious injury upon all peoples, not just thier victims.

You are surprised I have an attitude in view of all the
crass remarks, insults and such directed at me, daily,
by regulars here. Get real.

Godzilla!


------------------------------

Date: Sun, 03 Jun 2001 19:17:48 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <3B1AEFCC.BE8D7A09@stomp.stomp.tokyo>

buggs wrote:
 
> krakle wrote:
 
> > By anychance are you a woman?
 
> Newbies bitching is even worse than regulars bitching.
 
> I personally cannot see any reason
> for critcizing Godzilla! for telling you to post
> the question in a way that she can help.
 
> Please stop it.


You are wasting your time although your motivation
and intent are both good. This is commendable.

After an analysis of his header information upon 
reading his first article, I recognize this one
for the troll he is. Subsequent articles confirm
he is known to me via recognizable style and
troll methodology.

Socratic Irony is an art I well practice. There
are times I do string along this troll until he
is suckered into exposing himself for being just
that, a troll.

Should he leave here, the amount of articles posted
here would be reduced by sixty-percent or more and
trolling would be reduced to near zero.

* shrugs *

This is just one aspect of internet anonymity;
it affords an infinite supply of fake personalities.


Godzilla!


------------------------------

Date: 3 Jun 2001 20:05:13 -0700
From: krakle@visto.com (krakle)
Subject: Re: perl/cgi and dynamic hyperlink
Message-Id: <237aaff8.0106031905.5f3eac49@posting.google.com>

<li>name <b><a href=names/$in{'username'}.htm></a></b>

---Just wanted to point out one thing that you perhaps may already
know. That particular HTML line of code will output name in bold and
no hyperlink because there is no descriptor and as Godzilla pointed
out it is idea to quote your HTML values...

print "<li>name <b><a href=\"names/$in{'username'}.htm\">Click
Here</a></b>\n";

---krakle


------------------------------

Date: Mon, 04 Jun 2001 02:31:56 GMT
From: matessman@yahoo.com
Subject: Problem with Capturing Program Output under Win98
Message-Id: <3b1af2de.29527371@news.erols.com>

i am running activestate perl 5.6 on a win98 2e system and i am trying
to run a program and capture the output that is otherwise written to
the screen.  my understanding on how to do this from o'reilly's is to
open a filehandle using a program with a pipe that redirects the
output:

   :
   :
open (PROCOUTPUT, "programname data.file | ");

$output = <PROCOUTPUT>;

close (PROCOUTPUT);

print $output;
   :
   :

when i do this no output is captured from the program and i get an
error message saying that $output is uninitialized.  the program is
capable of generating output because when i use the statement

system ("programname data.file");

the output is generated as expected.  also,  when i use the statement

system ("programname data.file >output.dmp");

the file output.dmp is created but has size 0, indicating that no
output was captured.

is there a known problem with redirection under windows, or is the
method for windows different?

suggestions?

thanks much...

 ...mke tessman
matessman@yahoo.com


------------------------------

Date: Mon, 04 Jun 2001 03:53:23 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Problem with Capturing Program Output under Win98
Message-Id: <3b1afb17.129933106@news.erols.com>

On Mon, 04 Jun 2001 02:31:56 GMT, matessman@yahoo.com wrote:

>i am running activestate perl 5.6 on a win98 2e system and i am trying
>to run a program and capture the output that is otherwise written to
>the screen.  my understanding on how to do this from o'reilly's is to
>open a filehandle using a program with a pipe that redirects the
>output:
>
>open (PROCOUTPUT, "programname data.file | ");
>$output = <PROCOUTPUT>;
>close (PROCOUTPUT);
>print $output;

That should work if the external program writes to standard output.
Backticks could work too.

>when i do this no output is captured from the program and i get an
>error message saying that $output is uninitialized.  the program is
>capable of generating output because when i use the statement
>
>system ("programname data.file");
>
>the output is generated as expected.  also,  when i use the statement
>
>system ("programname data.file >output.dmp");
>
>the file output.dmp is created but has size 0, indicating that no
>output was captured.

The zero-length file created when standard output is redirected to
output.dmp strongly suggests the program is writing to its own
filehandle opened directly to the console.  If the output is appearing
on screen during redirection, it's a certainty.

I don't know if there's a Perl-ish solution to this problem, but there
is a small freeware DOS program named TCAP that captures to a file
anything written to the console.  It can run as a tsr, but it can also
be invoked to run another program and capture whatever it spews to the
console.  It's worked well for me for those times when I needed it,
from inside a Perl program or otherwise.  Google can find it for you.

>is there a known problem with redirection under windows, or is the
>method for windows different?

Not a Windows problem.  The external program is just being rude about
where it sends its output.


------------------------------

Date: Mon, 04 Jun 2001 02:45:03 GMT
From: Nan Wang <nwang@shell3.shore.net>
Subject: Re: Recursing a directory tree
Message-Id: <PCCS6.442$cN.47212@news.shore.net>

Benjamin Goldberg <goldbb2@earthlink.net> wrote:
> Nan Wang wrote:
>> 
>> Arun Horne <a.b.horne@nospamexeter.ac.uk> wrote:
>> > Does anyone have some simple code to recurse a directory tree please?? Best
>> > regards Arun Horne.
>> 
>> Sure here's one, I did this a while ago without using Find:
>> 
>> sub traverse {
>>         no strict 'refs';
>>         my ($startdir,$i)=@_;
>>         $i++;
>>         my $FH="FH"."$i";
>>         opendir ("$FH",$startdir) or die "blah";
>>         my @allfiles=grep !/^\.\.?$/, readdir $FH;
>>         closedir ($FH);
>>         my $file='';
>>         foreach $file (@allfiles) {
>>                 chomp $file;
>>                 my $file="$startdir/$file";
>>                 if (-f $file) {
>>                         # do whatever
>>                 } elsif (-d $file) {
>>                         &traverse ($dir,$i);
>>                 }
>>         }
>> }

> Umm, what's the point of the $i ?  Since it is closed almost right after
> it is opened, does it matter at all if nested traverse() calls use the
> same filehandle?  Also, is there anything wrong with just using a normal
> glob/filehandle here, or better yet, something which will automatically
> close when it goes out of scope?  And where does $dir come from?

$dir = $file.  It's part of a much larger program I did, so I snipped out
the irrelevant parts and I guess something got lost in the translation.

It's possible $i is unnecessary, it's too long ago I can't remember why I
did it this way.



------------------------------

Date: Sun, 3 Jun 2001 22:11:23 -0400
From: "FxM" <mastronardif@monmouth.com>
Subject: sendmail script problem
Message-Id: <9feqff$3n5$1@news.monmouth.com>


What is this newbie doing wrong.

I get the following message
   No recipient addresses found in header

when i run the following script.

#!/usr/bin/perl5 -w
open(SENDMAIL, "|/usr/sbin/sendmail -oi -t")
                        or die "Can't fork for sendmail: $!\n";
    print SENDMAIL "From: mastronardif\@monmouth.com";
    print SENDMAIL "To: mastronardif\@monmouth.com";
    print SENDMAIL "Subject: A relevant subject line";
    print SENDMAIL "Body he message goes here, in as many lines as you
like.";
    close(SENDMAIL)     or warn "sendmail didn't close nicely";




------------------------------

Date: 03 Jun 2001 22:42:21 -0400
From: Tim Heaney <theaney@toadmail.toad.net>
Subject: Re: sendmail script problem
Message-Id: <871yp1ufsi.fsf@susie.watterson>

"FxM" <mastronardif@monmouth.com> writes:

> What is this newbie doing wrong.
> 
> I get the following message
>    No recipient addresses found in header
> 
> when i run the following script.
> 
> #!/usr/bin/perl5 -w
> open(SENDMAIL, "|/usr/sbin/sendmail -oi -t")
>                         or die "Can't fork for sendmail: $!\n";
>     print SENDMAIL "From: mastronardif\@monmouth.com";
>     print SENDMAIL "To: mastronardif\@monmouth.com";
>     print SENDMAIL "Subject: A relevant subject line";
>     print SENDMAIL "Body he message goes here, in as many lines as you
> like.";
>     close(SENDMAIL)     or warn "sendmail didn't close nicely";

You forgot the newlines...

     print SENDMAIL "From: mastronardif\@monmouth.com\n";
     print SENDMAIL "To: mastronardif\@monmouth.com\n";
     print SENDMAIL "Subject: A relevant subject line\n";

You didn't have a To: line (or a Subject: line), just one big From:
line.

I hope this helps,

Tim


------------------------------

Date: 03 Jun 2001 22:09:14 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: sendmail script problem
Message-Id: <87ofs5uejp.fsf@limey.hpcc.uh.edu>

>> On 03 Jun 2001 22:42:21 -0400,
>> Tim Heaney <theaney@toadmail.toad.net> said:

> "FxM" <mastronardif@monmouth.com> writes:
>> What is this newbie doing wrong.
>> 
>> I get the following message No recipient addresses
>> found in header
>> 
>> when i run the following script.
>> 
>> #!/usr/bin/perl5 -w open(SENDMAIL, "|/usr/sbin/sendmail
>> -oi -t") or die "Can't fork for sendmail: $!\n"; print
>> SENDMAIL "From: mastronardif\@monmouth.com"; print
>> SENDMAIL "To: mastronardif\@monmouth.com"; print
>> SENDMAIL "Subject: A relevant subject line"; print
>> SENDMAIL "Body he message goes here, in as many lines
>> as you like."; close(SENDMAIL) or warn "sendmail didn't
>> close nicely";

> You forgot the newlines...

>      print SENDMAIL "From:
> mastronardif\@monmouth.com\n"; print SENDMAIL "To:
> mastronardif\@monmouth.com\n"; print SENDMAIL "Subject:
> A relevant subject line\n";

> You didn't have a To: line (or a Subject: line), just
> one big From: line.

Nor was there a blank line between the headers and the
text of the message.

A module such as Mail::Sendmail would help here.  Let it
talk the appropriate RFC format, so you (the OP) can get
on with solving your real problem.

    http://search.cpan.org/Catalog/Mail_and_Usenet_News/

hth
t
-- 
Just reach into these holes.  I use a carrot.


------------------------------

Date: Sun, 3 Jun 2001 21:38:25 -0500
From: "Tom Bowes" <vtbowes@superaje.com>
Subject: substing and locating
Message-Id: <7UBS6.11118$%R3.309382@e420r-sjo3.usenetserver.com>

I am making a simple databasing program and have concluded that it should be
easy if only I can get someone to explain to me how to do two things.
First off how to find the location(as a numerica value) of a particular
character in a string?
and secondly how only take part of a string for instance the last three
characters. As an extension of that is thier a command to find the length of
a string





------------------------------

Date: 03 Jun 2001 22:46:15 -0400
From: Tim Heaney <theaney@toadmail.toad.net>
Subject: Re: substing and locating
Message-Id: <87y9r9t11k.fsf@susie.watterson>

"Tom Bowes" <vtbowes@superaje.com> writes:

> I am making a simple databasing program and have concluded that it should be
> easy if only I can get someone to explain to me how to do two things.
> First off how to find the location(as a numerica value) of a particular
> character in a string?
> and secondly how only take part of a string for instance the last three
> characters. As an extension of that is thier a command to find the length of
> a string

I think you want index, substr, and length. For example,

  $string = 'This is a string';
  print "string is [$string]\n";

  $index = index $string, 'i';
  print "index of first i is $index\n";

  $index = index $string, 'i', $index + 1;
  print "index of second i is $index\n";

  $index = index $string, 'i', $index + 1;
  print "index of third i is $index\n";

  $last3 = substr $string, -3;
  print "last three characters are $last3\n";

  $length = length $string;
  print "length is $length\n";

I hope this helps,

Tim


------------------------------

Date: Mon, 04 Jun 2001 02:49:22 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: substing and locating
Message-Id: <Xns90B5E899234E5echangnetstormnet@207.106.93.86>

"Tom Bowes" <vtbowes@superaje.com> wrote in
<7UBS6.11118$%R3.309382@e420r-sjo3.usenetserver.com>: 

> I am making a simple databasing program and have concluded that it
> should be easy if only I can get someone to explain to me how to do
> two things. First off how to find the location(as a numerica value)
> of a particular character in a string?
> and secondly how only take part of a string for instance the last
> three characters. As an extension of that is thier a command to
> find the length of a string
> 
First, look up the index function with perldoc -f index (or look at 
http://www.perldoc.com/perl5.6/pod/perlfunc.html, which lists all the 
functions)

             index STR,SUBSTR,POSITION 
             index STR,SUBSTR 
                  The index function searches for one string within 
another, but without the wildcard-like behavior of a full regular-
expression pattern match. It returns the position of the first 
occurrence of SUBSTR in STR at or after POSITION. If POSITION is 
omitted, starts searching from the beginning of the string. The return 
value is based at 0 (or whatever you've set the $[ variable to--but 
don't do that). If the substring is not found, returns one less than 
the base, ordinarily -1. 

The SUBSTR can be a single character.

Then look up the substr and length functions the same way.

-- 
EBC


------------------------------

Date: Mon, 4 Jun 2001 03:52:54 +0000 (UTC)
From: Ryan Travis Tate <ryantate@OCF.Berkeley.EDU>
Subject: Re: taint + netstat = error
Message-Id: <9ff0mm$vp2$1@agate.berkeley.edu>


 | nobull@mail.com writes:
 |> Actually it appears you've found a bug but are barking up the
 |> wrong tree.  

wow, nobull, thanks. this is the first script i'd written in taint
mode, so i never would have let myself think it was a bug.

Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
 | Bug confirmed on linux w/ 5.00503 and 5.6.1:

running the same commands as joe on SunOS 5.7 i get the same result:

famine [50] perl5.00503 -wTe 'undef %ENV; `true`;`true`'
famine [51] perl5.00503 -wTe 'undef %ENV; `true`,`true`'
Insecure dependency in `` while running with -T switch at -e line 1.

also, rewriting the script as shown below allows it to run without
warning. 

has anyone formally reported this bug? i don't know how that
works, if anyone else does and has time, please do, or post how it is
done. thanks nobull for discovering this one ...

cheers
ryan

---

#!/opt/local/bin/perl5.005 -wT

use strict;

$ENV{PATH}='/usr/bin';

unique_id();



sub unique_id{
    my $id = join("." => (
			   $0,
			   $$,
			   time(),
			   unpack("%32L*", `ps -al`)
			   ));

    $id .= "." . unpack("%32L*", `netstat -in`);
    $id; 
}


---




------------------------------

Date: Mon, 4 Jun 2001 03:59:08 +0000 (UTC)
From: Ryan Travis Tate <ryantate@OCF.Berkeley.EDU>
Subject: Re: taint + netstat = error
Message-Id: <9ff12c$vp2$2@agate.berkeley.edu>

PS another reason i am surprised this is an (apparently unreported)
bug is that the original unique id code was written by merlyn (i
copied it out of a newgroup post he wrote in response to someone
else's question). i figured someone else would have tried running it
in taint mode before now ...

cheers
r


------------------------------

Date: Mon, 4 Jun 2001 03:11:08 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: TOY: explore the representation of binary floating point numbers
Message-Id: <9fengi$3n3n3$1@ID-13368.news.dfncis.de>

"Ilya Zakharevich" <nospam-abuse@ilyaz.org> wrote in
news:9fe9h5$jnd$1@agate.berkeley.edu...
> <skilchen@swissonline.ch>] wrote in article
<9fdj0k$3igj2$1@ID-13368.news.dfncis.de>:
> > To explore the internal representation of binary floating-point
> > doubles i have written the following toy script. It shows the bits
> > of a double (on a little-endian machine). Then it interprets those
> > bits according to the IEEE-754 specification.
>
> IIRC, there is no IEEE specification of the bit representation of
> f.p. numbers.  So all you know is that your script works on your
> machine.
>
Hopefully its not as bad as that. Do you think that the following is
_not_ the IEEE specification of what the 64 bits of a double represent?
(see: ttp://www.psc.edu/general/software/packages/ieee/ieee.html)

-----------%<---------------------------------

Double Precision

The IEEE double precision floating point standard representation
requires a 64 it word, which may be represented as numbered from 0 to
63, left to right. The first bit is the sign bit, S, the next eleven 
bits are the exponent bits, 'E', and the final 52 bits are the 
fraction 'F':

  S EEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
  0 1        11 12                                                63

The value V represented by the word may be determined as follows:

If E=2047 and F is nonzero, then V=NaN ("Not a number")
If E=2047 and F is zero and S is 1, then V=-Infinity
If E=2047 and F is zero and S is 0, then V=Infinity
If 0<E<2047 then V=(-1)**S * 2 ** (E-1023) * (1.F)
            where "1.F" is intended to represent the binary number
            created by prefixing F with an implicit leading 1 and
            a binary point.
If E=0 and F is nonzero, then V=(-1)**S * 2 ** (-1022) * (0.F)
                         These are "unnormalized" values.
If E=0 and F is zero and S is 1, then V=-0
If E=0 and F is zero and S is 0, then V=0

-----------%<---------------------------------

There is evidently the byte-ordering issue on little- and big-endian
machines. I think this issue is localized to my get_double_bits()
routine which is only appropriate on little-endians. I assume that 
on big-endians only the following line needs to be changed:
  my $bits = reverse(unpack("b*", pack("d", $double)));

on big-endians (i don't have access to such a beast, so i am just
guessing) that should probably be:
  my $bits = unpack("B*", pack("d", $double));

The remainder of my toy script shouldn't be affected as long as the
paragraph cited above is indeed the specification of the IEEE 64 bit
doubles.





------------------------------

Date: Mon, 4 Jun 2001 02:38:34 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: TOY: explore the representation of binary floating point numbers
Message-Id: <9fesba$tb1$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
buggs 
<buggs-clpm@splashground.de>], who wrote in article <9feack$ss6$00$1@news.t-online.com>:
> > IIRC, there is no IEEE specification of the bit representation of
> > f.p. numbers.  So all you know is that your script works on your machine.
> > 
> > Hope this helps,

> could you explain a bit more what that does mean ?
> I seldom work with floats with more than to digits after the comma ;-)
> Is that a big endian / little endian issue ?

IEEE specifies *which* real numbers are exactly representable by the
IEEE floats.  AFAIK, there is no requirement on the mapping of the
real number to the bitfield representation.

In "the real world" (tm) there are some really weird ways to represent
this info (on some rare architectures).  Do not remember the details;
was it that the mantissa was big-endian, but the magnitude
little-endian?

Ilya


------------------------------

Date: Mon, 04 Jun 2001 04:00:46 GMT
From: Tim <timster@worldnet.att.net>
Subject: which nmake ??
Message-Id: <3B1BAFEA.3CED47CA@worldnet.att.net>

I downloaded nmake.exe from microsoft's support site, but I placed it in
my C:\gnu\bin directory.  When I run:  "perl -MCPAN -e shell" and then
typed:   install XML::DOM, it chugged along pretty happily, but then
when it came time for it to do an nmake, it failed.  It said:

Stop.
  C:\GNU\bin\nmake.exe  -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible

Where do I get the right nmake.exe that will satisfy CPAN's install?





------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 1051
***************************************


home help back first fref pref prev next nref lref last post