[19495] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1690 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 4 14:05:31 2001

Date: Tue, 4 Sep 2001 11: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: <999626709-v10-i1690@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 4 Sep 2001     Volume: 10 Number: 1690

Today's topics:
    Re: ActivePerl says Out of Memory, but I'm not out of m <godzilla@stomp.stomp.tokyo>
    Re: ActivePerl says Out of Memory, but I'm not out of m (Jonadab the Unsightly One)
    Re: ActivePerl says Out of Memory, but I'm not out of m <joe+usenet@sunstarsys.com>
    Re: ActivePerl says Out of Memory, but I'm not out of m (Jonadab the Unsightly One)
    Re: Black Perl (Martien Verbruggen)
    Re: Black Perl (Randal L. Schwartz)
        capture output from all pages of top? (Ron Hartikka)
    Re: capture output from all pages of top? <jonni@ifm.liu.nospam.se>
    Re: capture output from all pages of top? <philippe.perrin@sxb.bsf.alcatel.fr>
    Re: HASH question <pilsl_@goldfisch.at>
        Help with installing a module, Win32::SerialPort <nials@britain.agilent.com>
    Re: Help with installing a module, Win32::SerialPort <thedannunn@yahoo.com>
    Re: Help with installing a module, Win32::SerialPort <nials@britain.agilent.com>
    Re: Help with installing a module, Win32::SerialPort <nials@britain.agilent.com>
        How can I find the PID's of my children? (Stan Brown)
    Re: I get all links, but no not want the picture links <stumo@bigfoot.com>
    Re: ignoring lines in file using array of phrases to sk (Tad McClellan)
    Re: Is element in array <wizard@psychodad.com>
    Re: OT: Re: Recommendations for a PERL editor (Jonadab the Unsightly One)
    Re: performing commands through perl.. <djberge@qwest.com>
    Re: Perl and DBI <cpryce@pryce.net>
        Perl2EXE for Windows <Crazydj@web.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 04 Sep 2001 08:27:57 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ActivePerl says Out of Memory, but I'm not out of memory?  Is this  a  limitation in the Perl build I have?
Message-Id: <3B94F2FD.515129B6@stomp.stomp.tokyo>

Jonadab the Unsightly One wrote:
 
> Bob Walton wrote:

(snipped)

> > Please whittle your script down to the smallest number of
> > lines that will execute verbatim if copy/pasted and will
> > also illustrate the problem you have having, and repost.
 
> Okay, I've got it under 100 lines, and if I try to make it any
> shorter it'll be obfuscated; already it's lacking comments...
 
> To recap, what's happening is, Perl is using roughly 112MB
> of memory but I still have about 50MB free (as reported by
> mem) but ActivePerl says 'Out of memory!' and bails.


I find your claim of excessive memory usage to be rather
odd considering your script contains a fatal syntax error
and will not compile.


Godzilla!


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

Date: Tue, 04 Sep 2001 14:37:26 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: ActivePerl says Out of Memory, but I'm not out of memory?  Is this a  limitation in the Perl build I have?
Message-Id: <3b94e468.7606434@news.bright.net>

#!perl
$_="
Bob Walton wrote:
> Please whittle your script down to the smallest number of 
> lines that will execute verbatim if copy/pasted and will 
> also illustrate the problem you have having, and repost. 

Okay, I've got it under 100 lines, and if I try to make it any
shorter it'll be obfuscated; already it's lacking comments...  

To recap, what's happening is, Perl is using roughly 112MB 
of memory but I still have about 50MB free (as reported by 
mem) but ActivePerl says 'Out of memory!' and bails.  What
I want to know is why Perl can't use the other 50MB and/or
the virtual memory Windoze provides, and whether using a
different Perl binary will help me.  Here's the script...";

sub stackpush; sub stackpop; sub stacktop; sub workfrom; 
sub winning; sub trytoplay; sub canplay; 

$nothing=0; %cell=(1=>0,2=>0,3=>0,4=>0);
%sabr=(0=>"h",14=>"d",28=>"c",42=>"s");
%cabr=(10=>"t",11=>"j",12=>"q",13=>"k"); foreach $c (0..9) {
$cabr{$c}="$c";}
%cardsuit=reverse(%sabr);%cardval=reverse(%cabr);$cardval{"a"}=1;
%stack=(0=>"7c8hasqdqs6cah",1=>"2djctsjs9h8dqh",2=>"tc3had7h5d2h8c",
        3=>"ks6d9d3c3d2c5h",4=>"7s8s4ckc4d9c",  5=>"5c9s2skh6h6s",
        6=>"jhkdjd7d5s4h",  7=>"ac4htdth3sqc"); #25160
workfrom($stack{0}, $stack{1}, $stack{2}, $stack{3}, $stack{4}, 
    $stack{5}, $stack{6}, $stack{7}, 0, 0, 0, 0, 0, 0, 0, 0, "");
print "No solution found!\n"; exit 1;

sub workfrom { local $card;
    ( $stack{0}, $stack{1}, $stack{2}, $stack{3}, $stack{4},
$stack{5}, 
      $stack{6}, $stack{7}, $cell{1},  $cell{2},  $cell{3},
$cell{4},
      $build{0}, $build{14}, $build{28}, $build{42},
      $moves) = @_;
    $p = $stack{0} .".". $stack{1} .".". $stack{2} .".". $stack{3}
"."
       . $stack{4} .".". $stack{5} .".". $stack{6} .".". $stack{7}
"."
       . $cell{1}  .".". $cell{2}  .".". $cell{3}  .".". $cell{4};

    if (winning()) { print $moves; exit 0; }
    elsif ($catalog{$p}) { return; } else { $catalog{$p} += 1; 
        foreach $showing (0 .. 7)  {
            $card=stackpop($showing);
            if (not ($card==$nothing)) { trytoplay($card, $showing);
}}
        foreach $showing (1 .. 4)   {
            $card=$cell{$showing};
            if ($card 
                != $nothing) 
            { trytoplay($card, 100); }}}}

sub canplay {
    (local $ctp, local $stp) = @_;
    local $stackcard = stacktop($stp);
    if ($stackcard==$nothing) { return 1; } 
    if (($ctp % 14) + 1 == ($stackcard % 14))  {
        return ((($ctp - ($ctp % 14))>14) xor 
                (($stackcard - ($stackcard % 14))>14));}}

sub trytoplay {
    (local $card, $origloc) = @_; local $sta; $avail=0;
    foreach $sta (0 .. 7) {
        if (canplay($card, $sta)>0)  {
            $other = stacktop($sta); stackpush($sta, $card);
            $moves .= "put " . $cabr{$card % 14} . $sabr{$card -
($card % 14)} . " on ";
            if ($other==$nothing) { $moves .= "an empty column\n"; } 
            else { $moves .= $cabr{$other % 14} . $sabr{$other -
($other % 14)} . "\n"; }
            workfrom($stack{0}, $stack{1}, $stack{2}, $stack{3},
$stack{4}, $stack{5}, 
                     $stack{6}, $stack{7},     $cell{1}, $cell{2},
$cell{3}, $cell{4},
                     $build{0}, $build{14}, $build{28}, $build{42},
                     $moves);
            $card = stackpop($sta); }}
    $buildval = $card % 14; 
    $buildsuit = $card - $buildval;
    if ($build{$buildsuit}+1==$buildval) {
        $moves .= "build " . $cabr{$buildval} . $sabr{$buildsuit} . 
            " on the " . $sabr{$buildsuit} . " pile;\n";  
        $build{$buildsuit}=$buildval;
        workfrom($stack{0}, $stack{1}, $stack{2}, $stack{3},
$stack{4}, $stack{5}, 
                 $stack{6}, $stack{7},     $cell{1}, $cell{2},
$cell{3}, $cell{4},
                 $build{0}, $build{14}, $build{28}, $build{42},
                 $moves);    }
    foreach $a (1..4) { if ($cell{$a}==$nothing) { $avail = $a; }}
    if ($avail) {
        $moves .= "set aside " . $cabr{$buildval} . $sabr{$buildsuit}
 . "\n";
        $cell{$avail} = $card;
        workfrom($stack{0}, $stack{1}, $stack{2}, $stack{3},
$stack{4}, $stack{5}, 
                 $stack{6}, $stack{7},     $cell{1}, $cell{2},
$cell{3}, $cell{4},
                 $build{0}, $build{14}, $build{28}, $build{42},
                 $moves); }
    if ($origloc==100) { $avail = 0;
        foreach $a (1 .. 4) { if ($cell{$a}==$nothing) { $avail = $a;
}  }
        if ($avail) {
            $cell{$avail} = $card;  
            $moves .= "leave ". $cabr{$buildval} .
$sabr{$buildsuit}."\n"; }
        else {
            $moves .= "pocket " . $cabr{$buildval} .
$sabr{$buildsuit} . "\n";}}
    else { $moves .= "leave " . $cabr{$buildval} . $sabr{$buildsuit}
 . 
            " on column " . ($origloc-1) . " where you got it\n";  
           stackpush ($origloc, $card);  }}

sub stackpush 
{ ($s, $c) = @_; $stack{$s} .= $cabr{$c % 14} . $sabr{$c - ($c %
14)};  }
sub stackpop 
{ $s = $_[0]; $c = stacktop($s); $stack{$s} =~ s/ *..$//; return $c;
}
sub stacktop { 
    if ($stack{$_[0]} =~ /(.)(.) *$/)  { 
        return $cardval{$1} + $cardsuit{$2}; }
    else { return $nothing; }}
sub winning {
    foreach $i (0..7) { 
        if ($stack{$i} =~ /[0-9aAtTjKqQkK][hHdDcCsS]/) { return 0; }}
    return 1; }
# TIA,
# --jonadab



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

Date: 04 Sep 2001 11:54:32 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: ActivePerl says Out of Memory, but I'm not out of memory?  Is this a  limitation in the Perl build I have?
Message-Id: <m34rqjj6iv.fsf@mumonkan.sunstarsys.com>

jonadab@bright.net (Jonadab the Unsightly One) writes:

> #!perl
> $_="
> Bob Walton wrote:
> > Please whittle your script down to the smallest number of 
> > lines that will execute verbatim if copy/pasted and will 
> > also illustrate the problem you have having, and repost. 
> 
> Okay, I've got it under 100 lines, and if I try to make it any
> shorter it'll be obfuscated; already it's lacking comments...  
> 
> To recap, what's happening is, Perl is using roughly 112MB 
> of memory but I still have about 50MB free (as reported by 
> mem) but ActivePerl says 'Out of memory!' and bails.  What
> I want to know is why Perl can't use the other 50MB and/or
> the virtual memory Windoze provides, and whether using a
> different Perl binary will help me.  Here's the script...";

Well, it's hard to follow what you are doing, but I would have
expected to see a lot more usage of the "my" keyword in your
script.  My best guess is that one of your ".=" expressions
in the workfrom -> trytoplay -> workfrom ... recursion sequence
is making a *very* long string, and by the time your script
consumes 112MB, it's looking to malloc over 50 MB of additional
RAM before crapping out.

I think a stack trace would help you, but I don't think a script 
like this should be consuming more than a couple of MB in the first 
place.  I'd bet the problem boils down a logic error coming from 
the overuse of globals variables.

Sorry I can't be of more help.

-- 
Joe Schaefer       "The man who sets out to carry a cat by its tail learns
                something that will always be useful and which never will grow
                                      dim or doubtful."
                                               --Mark Twain



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

Date: Tue, 04 Sep 2001 16:35:46 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: ActivePerl says Out of Memory, but I'm not out of memory?  Is this a  limitation in the Perl build I have?
Message-Id: <3b94fe71.14272899@news.bright.net>

Joe Schaefer <joe+usenet@sunstarsys.com> wrote:

> Well, it's hard to follow what you are doing, 

I know; the longer version was more legible, but it
was also more general and... lengthy.

What it's doing is working out a solution to a FreeCell
position, by brute force of trying every possible move,
recursively.  

> but I would have expected to see a lot more usage of 
> the "my" keyword in your script.  

I come from a lisp background, so I was using local instead.
(I associate lexical scoping with C++ and other forms of evil.)
However, now that you mention it...

> My best guess is that one of your ".=" expressions
> in the workfrom -> trytoplay -> workfrom ... recursion sequence
> is making a *very* long string, and by the time your script
> consumes 112MB, it's looking to malloc over 50 MB of additional
> RAM before crapping out.

This made sense, so I added a couple of lines to write out
the contents of $moves to sequentially-numbered files each
iteration.  At the longest, right before the bailout, file
3446 is 149027 bytes.  Still, that's bit longer than I 
would have expected it to be at that level of iteration, 
and I think...  

No, I changed the beginning of workfrom to this:
sub workfrom { local $card;
    ( $stack{0}, $stack{1}, $stack{2}, $stack{3}, 
      $stack{4}, $stack{5}, $stack{6}, $stack{7}, 
      $cell{1},  $cell{2},  $cell{3},  $cell{4},
      $build{0}, $build{14}, $build{28}, $build{42},
      local $moves) = @_;

It still bails at the same place, after examining
only 3446 positions.  The largest is still 149027 bytes.
Still, arithmetic tells me that's probably going to
add up to a total of about 256773521 bytes -- 256MB -- 
between all the copies.  Maybe mem is inaccurate.  I 
should fire up a bash prompt and see what free says...

> I think a stack trace would help you, but I don't think a script 
> like this should be consuming more than a couple of MB in the first 
> place.  I'd bet the problem boils down a logic error coming from 
> the overuse of globals variables.

I'll see what I can do along those lines...  after work.
And I'll examine the contents of those $moves files and
see if there are any clues there.

- jonadab


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

Date: Tue, 4 Sep 2001 23:40:42 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Black Perl
Message-Id: <slrn9p9meq.7k6.mgjv@martien.heliotrope.home>

On Tue, 04 Sep 2001 00:04:36 GMT,
	Elaine Ashton <elaine@chaos.wustl.edu> wrote:
> On 9/2/01 6:16 AM, in article slrn9p41nr.3ga.mgjv@martien.heliotrope.home,
> "Martien Verbruggen" <mgjv@tradingpost.com.au> wrote:
> 
>> On 2 Sep 2001 02:52:34 -0700,
>> N01937 <N01937@hushmail.com> wrote:
>>> Does anyone know the author of the Black Perl poem found in the Camel Book?
>> 
>> Larry Wall, of course.
>> 
>> Reread the first paragraph of the Perl Poetry section, and you'll notice
>> that that is what it says. Of course, you could also just use Google.
> 
> No, it's written by 'anonymous'. It was an april fool's day forgery in 1990.
> 
> The Perl Timeline covers this but the box that hosts it will be down until
> tomorrow at the earliest. http://history.perl.org/

I cancelled this article, and posted another one.

The only source (on a site that was actually responding) that I could
find was this one:

http://internet.ls-la.net/comppoems/black-perl.html

It attributes it to Sharon Hopkins, and states that it has been used
with permission.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | We are born naked, wet and hungry.
Commercial Dynamics Pty. Ltd.   | Then things get worse.
NSW, Australia                  | 


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

Date: 04 Sep 2001 07:05:44 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Black Perl
Message-Id: <m17kvf830n.fsf@halfdome.holdit.com>

>>>>> "Martien" == Martien Verbruggen <mgjv@tradingpost.com.au> writes:

Martien> The only source (on a site that was actually responding) that I could
Martien> find was this one:

Martien> http://internet.ls-la.net/comppoems/black-perl.html

Martien> It attributes it to Sharon Hopkins, and states that it has been used
Martien> with permission.

Well, it attributes *that* poem to Larry, as taken from an article
that Sharon wrote on the Perl poetry.

Or are you reading this differently than I am?  The presence of
Larry's name immediately below the poem seems to attribute it
(properly) to him.

And using my Sekret Klub-Member Decoder Ring, I'd say that attribution
is accurate. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 4 Sep 2001 07:35:31 -0700
From: ronh@iainc.com (Ron Hartikka)
Subject: capture output from all pages of top?
Message-Id: <7d3dfb10.0109040635.2a260da4@posting.google.com>

Hi Group,

I'd like to run top from perl and capture all the output. This...

print `top -d 1`; 

 ...gives me (HPUX, perl 5.6) only page 1 of top's output.

Any ideas on how to get the contents of the subsequent pages into perl?

Ron


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

Date: Tue, 4 Sep 2001 16:47:01 +0200
From: "Jonas Nilsson" <jonni@ifm.liu.nospam.se>
Subject: Re: capture output from all pages of top?
Message-Id: <9n2pg8$bva$1@newsy.ifm.liu.se>

"Ron Hartikka" <ronh@iainc.com> wrote in message
news:7d3dfb10.0109040635.2a260da4@posting.google.com...

| print `top -d 1`;
|
| ...gives me (HPUX, perl 5.6) only page 1 of top's output.

print `top -b 10000`;
will give you the top 10000 processes in batch mode.
/jN




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

Date: Tue, 04 Sep 2001 17:14:07 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Re: capture output from all pages of top?
Message-Id: <3B94EFBF.27A8D16C@sxb.bsf.alcatel.fr>

Ron Hartikka wrote:
> I'd like to run top from perl and capture all the output. This...
> print `top -d 1`;
> ...gives me (HPUX, perl 5.6) only page 1 of top's output.
> Any ideas on how to get the contents of the subsequent pages into perl?

not sure about what you want to do... try use "-b" as another option
(batch mode)
you should get the whole list of processes.

-- 
PhP

($r1,$r2,$r3,$r4)=("19|20","0|1","28|29","5|24");($r5,$r6)=("9|10|15|16|$r1|$r2","9|10|$r3");%h=("1|",$r6,"1=","[1-5]|2[0-4]","1/","0|19","1\\","6|25","2|","0|6|19|25|$r6","2/","1|20","2\\",$r4,"3|","$r2|6|$r1|25|$r6","3/",$r4,"4|","$r2|$r1|$r6","4=","2|3|4|11|12|13|14|21|22|23","4/",$r4,"4\\",15,"5|","$r2|9|15|$r1|20|$r3","5/",10,"6|",$r5,"7|",$r5,"7/",$r3);for($l=1;$l<8;$l++){b:for($i=0;$i<30;$i++){c:foreach(keys
%h){next c if(!(/^$l(.*)$/));$a=$1;if($i=~/^($h{$_})$/){print $a;next
b;}}print " ";}print "\n";}


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

Date: Tue, 4 Sep 2001 16:43:54 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: HASH question
Message-Id: <3b94e8ae@e-post.inode.at>

Tassilo von Parseval wrote:

> peter pilsl wrote:
> 
>> Usenet should be a place where I can ask really sophisticated questions
>> and discuss about heavy things (like unicodeimplementation in perl.
>> unfortunately not many people joined the thread then)
>> 
>
>> 
>> This is the advice of the real guru:
>> "other people dont telling you the truth, they lie at you. I know the
>> truth, but I wont tell you, cause you need to learn by finding out on
>> your own"
> 
> It is, for one very good reason: self-protection.

if he is afraid that his answer will be folded into small pieces, he 
shouldt post that he knows the answer, he should just ... be quit.

I post information that I'm highly sure about that its true. Of course 
there can be a mistake in it. There is no 100% sure.  Not even when the 
gurus post it. I post and I'm not afraid to be folded :) (my personality is 
strong enough to stand it)

> 
> It is not wrong to answer, it is just wrong to answer in the wrong way.
> :-)
> 

If all people follow the definitions of the right way declared above there 
would be very less traffic in usenet. 

hand on the heart: did you never post a question to comp.something at 5am 
cause you needed the project be finished at 8am and simply didnt have 
enough time and power left to do deeper researchs on your own.
I dont think this is good, but I did it sometimes and I was very happy that 
almost ever some nice soul out there posted a hint on the fly.
This is what usenet makes very valueable also. People that just helps and 
dont care about all the rules and forms ...

peter


-- 
mag. peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at



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

Date: Tue, 04 Sep 2001 14:49:58 +0100
From: Nial Stewart <nials@britain.agilent.com>
Subject: Help with installing a module, Win32::SerialPort
Message-Id: <3B94DC06.EFD0B384@britain.agilent.com>

I'm a hardware engineer who's just discovered Perl,
and would like to be able to knock up quick scripts
to allow initial hardware debugging (by hand) before
software support is available.

To this end I have downloaded the Win32::SerialPort
module and have tried to install it.

I've read as much as I can find in perldoc etc about
installing modules, but am having problems with this
one. I'm using ActivePerl 5.6.1 on a PC running Win98
(and I've tried it on an NT box too).

I've extracted the .gz file to 

c:\Perl\SerialPort-0.19\

then ran the makefile. This generates an install.pl and
test.pl script.

I ran the install script and it appeared to be installing
components in the right places.

When I ran the test.pl script nothing appeared to work and
I got a series of errors saying 

"Can't locate Win32:API.pm in @INC (@INC contains "

then the paths that are included in @INC (I think) are
displayed.


Can anyone tell me what's going wrong? I realise that the
path to the new modules needs to be indicated somehow, but
from what I've read @INC is generated when Perl is compiled
and I don't have a compiler.

If there's some other mechanism for defining the path I thought
the test scripts would have implemented them.

Thanks for any help,

Nial.


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

Date: Tue, 04 Sep 2001 14:13:34 GMT
From: "Dan Nunn" <thedannunn@yahoo.com>
Subject: Re: Help with installing a module, Win32::SerialPort
Message-Id: <ik5l7.11062$KV3.893860@bgtnsc04-news.ops.worldnet.att.net>

"Nial Stewart" <nials@britain.agilent.com> wrote in message
news:3B94DC06.EFD0B384@britain.agilent.com...

> "Can't locate Win32:API.pm in @INC (@INC contains "

> Can anyone tell me what's going wrong?

You need to install the Win32::API module. Get it at this URL, then in DOS,
type 'ppm install Win32-API.ppd' to install it:
http://www.activestate.com/PPMPackages/5.6plus/Win32-API.ppd

Dan




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

Date: Tue, 04 Sep 2001 16:27:25 +0100
From: Nial Stewart <nials@britain.agilent.com>
Subject: Re: Help with installing a module, Win32::SerialPort
Message-Id: <3B94F2DD.A508C2B@britain.agilent.com>

Dan Nunn wrote:
> 
> "Nial Stewart" <nials@britain.agilent.com> wrote in message
> news:3B94DC06.EFD0B384@britain.agilent.com...
> 
> > "Can't locate Win32:API.pm in @INC (@INC contains "
> 
> > Can anyone tell me what's going wrong?
> 
> You need to install the Win32::API module. Get it at this URL, then in DOS,
> type 'ppm install Win32-API.ppd' to install it:
> http://www.activestate.com/PPMPackages/5.6plus/Win32-API.ppd
> 
> Dan

Great,

Thanks Dan.


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

Date: Tue, 04 Sep 2001 18:41:05 +0100
From: Nial Stewart <nials@britain.agilent.com>
Subject: Re: Help with installing a module, Win32::SerialPort
Message-Id: <3B951231.7CC4E67E@britain.agilent.com>

Dan Nunn wrote:
> 
> "Nial Stewart" <nials@britain.agilent.com> wrote in message
> news:3B94DC06.EFD0B384@britain.agilent.com...
> 
> > "Can't locate Win32:API.pm in @INC (@INC contains "
> 
> > Can anyone tell me what's going wrong?
> 
> You need to install the Win32::API module. Get it at this URL, then in DOS,
> type 'ppm install Win32-API.ppd' to install it:
> http://www.activestate.com/PPMPackages/5.6plus/Win32-API.ppd


I've tried doing what David suggested above. Initially I got the
message 

"Installing package 'Win32-API.ppd'..."

but then got 

"Error installing package 'Win32-API.ppd':Error reading...
 ..(path to file Win32-API.tar.gz at www.activestate.com)"

I managed to get this file manually and unzip it, but there
is no install.pl unlike the serial package.

I also managed to find a windows .zip version of the 
package on line. This appears to unzip correctly 
producing a makefile.pl etc. I ran 

perl makefile.pl 

and it created a makefile so I presume I need a compiler
to install the package this way.

Help anyone. Where can I get this package and install
it on a win32 system withought a compiler?

Thanks for any more help,

Nial Stewart.


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

Date: 4 Sep 2001 13:31:37 -0400
From: stanb@panix.com (Stan Brown)
Subject: How can I find the PID's of my children?
Message-Id: <9n335p$9hv$1@panix1.panix.com>

I'm writing a perlTK script, which will spawn at least one child task to do
some long runing processing.

However, I'm going to leave the user the option of canceling from an "exit"
button on the main window. So I need to be able to send a kill() signal to
my children.

Short of making these PID's global variables, when they are spwned, how can
I detrmine what children, my runing perl process is the parent of?




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

Date: Tue, 4 Sep 2001 16:07:05 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: I get all links, but no not want the picture links
Message-Id: <m46l7.810$zi3.409360@news2-win.server.ntlworld.com>

confused <thing2b@yahoo.com> wrote in message
news:53a7a4f1.0108311722.72b47e41@posting.google.com...
> I am using the code below to get a random link from a webpage. The
> problem is that this gives any random link, pictures or to html. How
> do i use this to only get links to other text pages?

Not a 100% foolproof method, but why not get the random link generator to run
again if the extension is .gif or .jpg or .jpeg - should catch most examples.




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

Date: Tue, 04 Sep 2001 14:33:27 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: ignoring lines in file using array of phrases to skip
Message-Id: <slrn9p9lo5.qbl.tadmc@tadmc26.august.net>

Mike Solomon <mike_solomon@lineone.net> wrote:

>What I can't work out how to do is put end of line character ($) into
>the array and make it work


dollar sign is NOT the end of line character.

\n is the end of line character (perl will add \r's on input/output
if your system requires it).

dollar sign, as you are using it, _matches_ end of line (kinda),
but it is not an end of line "character".


>The line I am having problems filtering is
>
>"Mar  5 23:20:19 dmgww-bls1 /kernel: "
>
>I need to use something like /kernel:\s$/ but I cant make this work
 ^^^^^^
>from the array


You "want". There are other approaches where you wouldn't need that.


>Any help would be welcome


If you had followed the simple coding style of:

   Never use double quotes when single quotes will do.

or, rephrased:

   Only use double quotes when you require one of the two extra
   things (interpolation and backslash escapes) that double quotes
   give you beyond what single quotes give you.

then you would never have spent time on the bug your coding
style introduced.


>my @ignore = ( 
>				"kernel: timecounter",
>		"kernel: support",

[snip]

>            "kernel:\s\$"                    #this line does not work
>);


Every string there starts with the same 8 characters, so you
can factor that part out of the array strings and put the 8
chars directly in the pattern:

   my @ignore = qw/ timecounter support ... /;
   push @ignore, '';     # empty string for that last one


>open FILE, "myfile.txt" or die "cant open file";


Help yourself debug by giving yourself as much information
as possible when unexpected things happen. Include the
name of the file and the reason for failure:

   open FILE, 'myfile.txt' or die "can't open 'myfile.txt'  $!";
                                                            ^^
                                                            ^^

>while (<FILE>) {
>      chomp;
>      $line = $_;


Why copy it to $line?

Either use $_:

   print if $_ !~ /$ignore/i;
   or
   print unless /$ignore/i;

or put the value directly into $line:


   while ( $line = <FILE> ) {


>      print if $line !~ /$ignore/i;


   print unless $line =~ /^kernel: ($ignore)$/i; # factored out 1st 8 chars


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 04 Sep 2001 08:21:53 -0500
From: "Michael D. Kirkpatrick" <wizard@psychodad.com>
Subject: Re: Is element in array
Message-Id: <3B94D571.8DE7759D@psychodad.com>

Joe Schaefer wrote:

> "Michael D. Kirkpatrick" <wizard@psychodad.com> writes:
>
> > You must be slipping...
>
> You mean, I can go lower?
>
> > Why end it with a comma and not the period.  You need to change
> > "hacker," to "hacker."
> >
>
> Or perl to Perl?  Hey man, it's just a sig :)
>
> Joe Schaefer
> --
> %ENV=(); $A="\rr jpeurls ht\ba \rcankotehe"x666;END{ system
> "$^X -wT $0 $^S";print"r\n"}sub foo{$_=pop||exit;/$_/;print
> eval 'BEGIN{$^H='. ($^H+=666) .'}$_[-(()=$A=~//g)+$[]';}@_=
> reverse$A=~/./g;&foo while$ARGV[0]=~//g;#evil mess for *nix

Just giving you a little shit...  ;)




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

Date: Tue, 04 Sep 2001 14:48:11 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: OT: Re: Recommendations for a PERL editor
Message-Id: <3b94e7ae.8445029@news.bright.net>

tim@vegeta.ath.cx (Tim Hammerquist) wrote:

> I usually have no more running than MSIE, Netscape, WS_FTP, (PWS ||
> Apache), AIM, and.... well, you see why I had to switch. ;)

In some ways I would like to switch, but I can't give up 
Pegasus Mail.  I do have a linux box I can ssh into and
do stuff, but if I need to use X I have to reboot my main
system and run Linux there for however long I need X.  I
tried running pmail in WINE, and I had *some* success, but
it just wasn't a workable solution for everyday.

> > Linux stability is compromised by (what I've discovered so far):
> >     - running out of swap space
> 
> Never experienced this. What distro? Mine's Linux-Mandrake 7.1.

At the time, RedHat 6.0.  I only had 32MB of physical RAM, 
and only 32MB of swap, and I was trying to run Gnome and
WINE, and it just wasn't working.  (Ever see Enlightenment 
take an hour to close a window?)  I redid a partition and 
made room for 128MB of swap space instead of 32, and that 
totally solved the problem.  Since then I've added more 
RAM and picked up a newer distro...

- jonadab


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

Date: Tue, 4 Sep 2001 08:47:46 -0500
From: "Mr. Sunblade" <djberge@qwest.com>
Subject: Re: performing commands through perl..
Message-Id: <XT4l7.10$Jx2.159288@news.uswest.net>


"Whatevah" <webmaster@remove...this....whatevah.com> wrote in message
news:9mv3pq$4c3ej$1@ID-94865.news.dfncis.de...
> I need to perform a few commands using perl...
>
> specifically, I need to use tar and gunzip...
>
> I'm guessing that I have to use a certain module... but, which one?

Archive::Tar.  It's on CPAN (search.cpan.org)




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

Date: Tue, 4 Sep 2001 12:28:26 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: Perl and DBI
Message-Id: <f88l7.18346$x84.4619254@ruti.visi.com>


"Chris Fedde" <cfedde@fedde.littleton.co.us> wrote in message
news:lJWk7.92$Owe.171086848@news.frii.net...
> In article <IoVk7.67396$f01.18381188@news3.rdc1.on.home.com>,
> christian <carrazola@home.com> wrote:
> >Hello,
> >
> >I'm looking for either a good Book or Documentation on all the mysql
> >functions that perl can use.
> >
>
> If the documentation that is part of the DBI and DBD:: interfaces is not
> enough then there are a couple other sources. There might be good pointers
> for you at http://dbi.symbolstone.org/.
>

I'm not sure why that's an either/or question. I highly recommend that you
use both the book and the POD documentation. The book that is available at
the above Web address (through Amazon.com) is written by the author of the
DBI module and is the best on the market, IMHO.

--
cp




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

Date: Tue, 04 Sep 2001 18:39:48 +0200
From: Crazydj <Crazydj@web.de>
Subject: Perl2EXE for Windows
Message-Id: <3B9503D4.D0F9B3B9@web.de>

Hi @ll!!! =)
Does anyone know the program perl2exe? I have got a problem in
converting scripts that use modules. The perl2exe program always tells
me that he cant find the modules, but my scripts work so the modules can
be found in the @INC paths...
How can I tell perl2exe were those modules are? I have tried to just
copy them to the perl2exe directory but this doesnt work...
Thanx and greets

Bastian Ballmann

--
Djz rule the world! ...and some other staff ;-p Find out at http://www.crazydj.de





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

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 1690
***************************************


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