[18871] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1039 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 1 18:11:29 2001

Date: Fri, 1 Jun 2001 15:10:19 -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: <991433419-v10-i1039@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 1 Jun 2001     Volume: 10 Number: 1039

Today's topics:
        Learning perl - llama book (Chuck)
    Re: Learning perl - llama book <godzilla@stomp.stomp.tokyo>
    Re: Learning perl - llama book <lmoran@wtsg.com>
    Re: Learning perl - llama book (Steve)
    Re: Learning perl - llama book <krahnj@acm.org>
    Re: Learning perl - llama book (Tad McClellan)
        Namespace assistance needed <skpurcell@hotmail.com>
    Re: Namespace assistance needed (Tad McClellan)
    Re: Overriding builtin functions (Tad McClellan)
    Re: Overriding builtin functions <iltzu@sci.invalid>
    Re: Overriding builtin functions <simonmcc@nortelnetworks.com.nospam>
    Re: parsing an output of httpQ (dave)
    Re: parsing an output of httpQ <daniel304@planet.nl>
    Re: parsing an output of httpQ <daniel304@planet.nl>
    Re: parsing an output of httpQ <godzilla@stomp.stomp.tokyo>
    Re: Perl and Unicode <elijah@workspot.net>
        perlcc <me@don't.bother>
    Re: Posting Etiquette nobull@mail.com
    Re: Posting Etiquette <lmoran@wtsg.com>
    Re: Posting Etiquette <mischief@velma.motion.net>
    Re: releasing array memory nobull@mail.com
    Re: releasing array memory <dan@tuatha.sidhe.org>
        SARGE (Igal Corcos)
    Re: time (Craig Berry)
    Re: UPDATE & for loop <bkennedy99@Home.com>
        Why this substitution doesn't work? <cadmcse@hotmail.com>
    Re: Why this substitution doesn't work? <krahnj@acm.org>
    Re: Workgrounds for perl2exe ?? <lmoran@wtsg.com>
    Re: Workgrounds for perl2exe ?? <carvdawg@patriot.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 1 Jun 2001 11:31:14 -0700
From: ctewksbury@mediaone.net (Chuck)
Subject: Learning perl - llama book
Message-Id: <3c36ac2c.0106011031.6d967d6a@posting.google.com>

I am just starting into Perl and have the Llama book and the Camel
book... I am totally stuck on "regular expressions" and just want to
know if I should

a- re-read over and over and suddenly get it

b- forge ahead and hope it sinks in later

you pros and non-pros alike have thoughts on this?


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

Date: Fri, 01 Jun 2001 11:53:49 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Learning perl - llama book
Message-Id: <3B17E4BD.8FD7F0CA@stomp.stomp.tokyo>

Chuck wrote:
 
> I am just starting into Perl and have the Llama book and the Camel
> book... I am totally stuck on "regular expressions" and just want to
> know if I should
 
> a- re-read over and over and suddenly get it

No, you should enhance your reading by experimenting
with code. We built high performance Corvette Mako
Sharks as a hobby. We have every manual available
for these classic Corvettes. Those manuals are very
helpful but are no substitute for having grease under
my French cut nails, much to my consternation.

 
> b- forge ahead and hope it sinks in later

Classic Titantic philosophy.

 
> you pros and non-pros alike have thoughts on this?

My personal belief is there are very few pros here
and those who are here, have very few thoughts.


Godzilla!  Queen Of The Thoughtless.


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

Date: Fri, 01 Jun 2001 15:19:14 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Learning perl - llama book
Message-Id: <gupfhtk3k9ueqvnfef2qfmb8u5911qp5cq@4ax.com>

On 1 Jun 2001 11:31:14 -0700, ctewksbury@mediaone.net (Chuck) wrote
wonderful things about sparkplugs:

>I am just starting into Perl and 
SNIP
> just want to
SNIP
>know if I should
>
>a- re-read over and over and suddenly get it

This won't happen.  until you actually *need* to use regex it won't
really make sense.  They won't make a lot of sense when you need to
use them either but then you'll have the patience to figure them out.

I had project recently that this group helped (a lot) with.
Ultimately this is the code I (we) produced:

 $pwd =~ tr  [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]
             [2223334445556667778889990022233344455566677788899900] ;

writing the regex out in this _long hand_ allows you to figure out
what it is doing.  As opposed to:

$pwd =~
y/A-Za-z/2223334445556667778889990022233344455566677788899900/;

Do you have any specific regex questions?

>
>b- forge ahead and hope it sinks in later

this will probably help

>
>you pros and non-pros alike have thoughts on this?

not a pro but I can offer this advice...

use diagnostics;

so the top of your code looks like this:

#!/usr/bin/prl -w
use strict;
use diagnostics;

diagnostics will explain what the erro messages mean and make your
like easier.
--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com


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

Date: 1 Jun 2001 20:07:04 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: Learning perl - llama book
Message-Id: <slrn9hftal.54a.steve@zero-pps.localdomain>

On 1 Jun 2001 11:31:14 -0700, Chuck wrote:
>I am just starting into Perl and have the Llama book and the Camel
>book... I am totally stuck on "regular expressions" and just want to
>know if I should

As others have suggested experiment.  Think of a simple program that 
you would like to write, (preferably something that will be useful to 
yourself), and tackle the various tasks as you come to them with the 
books, perldoc and the NGs to help you along.  

If there's a specific point that you're getting stuck on with regex, 
then post a question to this thread and I'm sure someone will be able
to help you.  We all started off not knowing anything, you've shown the
willingness to put the legwork in which goes a long way round here.  

-- 
Cheers
Steve              email mailto:steve@zeropps.uklinux.net

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  8:46pm  up 119 days, 21:35,  2 users,  load average: 1.36, 1.32, 1.33


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

Date: Fri, 01 Jun 2001 21:09:05 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Learning perl - llama book
Message-Id: <3B180491.B6EE6EFB@acm.org>

Lou Moran wrote:
> 
> On 1 Jun 2001 11:31:14 -0700, ctewksbury@mediaone.net (Chuck) wrote
> wonderful things about sparkplugs:
> 
> >I am just starting into Perl and
> SNIP
> > just want to
> SNIP
> >know if I should
> >
> >a- re-read over and over and suddenly get it
> 
> This won't happen.  until you actually *need* to use regex it won't
> really make sense.  They won't make a lot of sense when you need to
> use them either but then you'll have the patience to figure them out.
> 
> I had project recently that this group helped (a lot) with.
> Ultimately this is the code I (we) produced:
> 
>  $pwd =~ tr  [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]
>              [2223334445556667778889990022233344455566677788899900] ;
> 
> writing the regex out in this _long hand_ allows you to figure out
> what it is doing.  As opposed to:

tr/// and y/// do NOT use regular expressions. This is an example of
character (tr)anslation.


> $pwd =~
> y/A-Za-z/2223334445556667778889990022233344455566677788899900/;
> 
> Do you have any specific regex questions?



John
-- 
use Perl;
program
fulfillment


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

Date: Fri, 1 Jun 2001 16:05:33 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Learning perl - llama book
Message-Id: <slrn9hftcd.9up.tadmc@tadmc26.august.net>

Lou Moran <lmoran@wtsg.com> wrote:

>Ultimately this is the code I (we) produced:
>
> $pwd =~ tr  [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]
>             [2223334445556667778889990022233344455566677788899900] ;
>
>writing the regex out in this _long hand_ 


Err, that is NOT a regular expression. 

tr/// does not utilize regexs, it uses merely strings of characters.


>>you pros and non-pros alike have thoughts on this?


"Mastering Regular Expressions", published by O'Reilly.


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


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

Date: Fri, 1 Jun 2001 14:52:19 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Namespace assistance needed
Message-Id: <3b17f2d5$0$170@wodc7nh6.news.uu.net>

Hello,
I am playing with some code from PerlEx that I am attempting to understand.
I have loaded the PerlEx module but I am not putting in a 'use PerlEx' line.
But since my file is named with a .plex, I guess it knows to use that
module.

But my question and where I am searching for some clarity is in the
following line:
$PerlEx::Samples::spell::words{$_} = 1;
Now I know this is making  hash of all the words from a text file called
"wordstwo" from the $url statement. I have printed out that hash and have
verification that it is a good hash.
Where I could use some clarity is the name spaces following the
PerlEx::Samples:: etc. I opened up the PerlEx.pm module, and searched for
Samples, but did not find any subs or even words named Samples:

I then tried to make that hash just in the PerlEx namespace eg: PerlEx{$_} =
1; but I get an error: I have been told that the actual module name would be
the name before the last ::, but I searched my system and never found a
words.pm or any words modules or anything like that.

How does this work? How does one know where they can put variables in to a
namespace?

Also, and lastly, I wanted to put in a sub routine that I could pass in
variables and receive back some new result, and want to put that sub into
the above namespace. How would this be accomplished?

Thanks
Scott


############################ CODE ##########################
use CGI;
use CGI::Carp "fatalsToBrowser";
use LWP::UserAgent;
use HTTP::Request::Common;
use strict;
BEGIN {
    my $url = "http://www.vb.vision-bank.com/PerlEx/wordstwo";
    my $ua = LWP::UserAgent->new;
    my $response = $ua->request(GET $url);
    if ($response->is_success) {
        foreach $_ (split(".\n", $response->content)) {
            $PerlEx::Samples::spell::words{$_} =  1;
        }
    }
    else {
        print STDERR "Error getting $url: " .
        $response->code . " " . $response->message . "\n";
    }


}

Scott Purcell






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

Date: Fri, 1 Jun 2001 16:29:42 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Namespace assistance needed
Message-Id: <slrn9hfupl.9up.tadmc@tadmc26.august.net>

spurcell <skpurcell@hotmail.com> wrote:

>
>But my question and where I am searching for some clarity is in the
>following line:
>$PerlEx::Samples::spell::words{$_} = 1;


I dunno about PerlEx, and I'm not likely to. But I know how
packages and modules in Perl work...


>Now I know this is making  hash of all the words from a text file called
                                    ^^^

No it isn't (unless it is inside of a loop, but you haven't shown that).

It is adding *one* entry to the %words hash in the PerlEx::Samples::spell
package (namespace).


>Where I could use some clarity is the name spaces following the
>PerlEx::Samples:: etc. I opened up the PerlEx.pm module, and searched for
>Samples, but did not find any subs or even words named Samples:


Now you are talking about modules rather than simply packages.

There should be a directory structure like this somewhere 
(under one of the @INC dirs):

   PerlEx/
      Samples/
         spell.pm

Inside of spell.pm is dynamic (not lexical) hash named %words.


>I then tried to make that hash just in the PerlEx namespace eg: PerlEx{$_} =
>1; but I get an error: 


I wonder what it said? ...


>I have been told that the actual module name would be
>the name before the last ::, 


Right.


>but I searched my system and never found a
>words.pm or any words modules or anything like that.


Because that is the _last_ name, not the "name before the last".

There ought to be a spell.pm somewhere...


>How does this work? How does one know where they can put variables in to a
>namespace?


Reading the documentation for packages will go a long way towards
understanding packages  :-)

Simlarly for understanding modules.

   perldoc perlmod


>Also, and lastly, I wanted to put in a sub routine that I could pass in
>variables and receive back some new result, and want to put that sub into
>the above namespace. How would this be accomplished?


By modifying the file that corresponds to the package (namespace).

For _writing_ modules, see:

   perldoc perlmodlib


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


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

Date: Fri, 1 Jun 2001 13:50:38 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Overriding builtin functions
Message-Id: <slrn9hflfe.9of.tadmc@tadmc26.august.net>

Simon McCaughey <simonmcc@nortelnetworks.com.nospam> wrote:
><SNIP>
>#> at compile time, for instance in a module you "use" or in a begin
>#> block.  I believe you are asking if the overriding can be done at
>#> run time, and the answer to that is no.  You can, however, replace
>#> time() with a function whose behavior can change at runtime, like so:
>#>
><SNIP CODE>
>
>Thanks for that : you firgured out the real question 
                   ^^^
                   ^^^

Who you?

It is customary to include an attribution when you quote someone.


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


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

Date: 1 Jun 2001 19:07:44 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Overriding builtin functions
Message-Id: <991422005.13470@itz.pp.sci.fi>

In article <9f85cj$5ke$1@bmerhc5e.ca.nortel.com>, Simon McCaughey wrote:
>My problem is in unit-testing modules, I want to stub out all external
>function calls, so for example I want the function time() to always return
>991401617 (for example)

Note, however, that this may or may not be a useful approach to unit
testing.  It could well be useful for, say, providing canned user input
or something like that.  You example of overriding time(), on the other
hand, seems a pretty bad idea.  In particular, code that expects the
time to pass at the usual rate would be very very surprised.  So would
code using the Time::HiRes version of time().

It may be better to work around the variation instead, by either a) only
testing the parts that don't vary, b) testing that the variation remains
within expected bounds, or c) computing what the variable output should
be and testing against that.

As an example, you might want to grab the module Time::Stopwatch from
CPAN and take a look at its test suite.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.


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

Date: Fri, 1 Jun 2001 22:52:20 +0100
From: "Simon McCaughey" <simonmcc@nortelnetworks.com.nospam>
Subject: Re: Overriding builtin functions
Message-Id: <9f92m4$piv$1@bmerhc5e.ca.nortel.com>


#Ilmari Karonen <iltzu@sci.invalid> wrote in message
news:991422005.13470@itz.pp.sci.fi...
#> In article <9f85cj$5ke$1@bmerhc5e.ca.nortel.com>, Simon McCaughey wrote:
#> >My problem is in unit-testing modules, I want to stub out all external
#> >function calls, so for example I want the function time() to always
return
#> >991401617 (for example)
#>
#> Note, however, that this may or may not be a useful approach to unit
#> testing.  It could well be useful for, say, providing canned user input
#> or something like that.  You example of overriding time(), on the other
#> hand, seems a pretty bad idea.  In particular, code that expects the
#> time to pass at the usual rate would be very very surprised.  So would
#> code using the Time::HiRes version of time().
#>
#> It may be better to work around the variation instead, by either a) only
#> testing the parts that don't vary, b) testing that the variation remains
#> within expected bounds, or c) computing what the variable output should
#> be and testing against that.
#>
#> As an example, you might want to grab the module Time::Stopwatch from
#> CPAN and take a look at its test suite.
#>
#> --
#> Ilmari Karonen - http://www.sci.fi/~iltzu/
#> Please ignore Godzilla / Kira -- do not feed the troll.

yip, thanks for that, it certainly is an option, but say for example I want
to test the function for a variety of specific times, then I can set my
dummy time function to return those specific values, and check the results.

That example is perhaps slightly contrived, but for the unit testing that we
are considering I think this is a problem that will reoccur many times

Thanks

Simon.




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

Date: 1 Jun 2001 13:13:25 -0700
From: usted@cyberspace.org (dave)
Subject: Re: parsing an output of httpQ
Message-Id: <e2c00ae.0106011213.5016a93d@posting.google.com>

"Daniel van den Oord" <daniel304@planet.nl> wrote in message news:<9f86l7$7motj$1@reader02.wxs.nl>...
> I'm making a script that can control winamp with the httpQ plugin..
> You can call for output like this
> http://Your.server.ip:port/getplaylisttitle?p=password
> The output is simply
> 
> Artist-title song<br>Artist-title song<br>Artist-title song<br>Artist-title
> song<br>Artist-title song<br>Artist-title song<br>
> 
> I want to be able to parse this into an useable array
> is this possible ?!?
> 
> Thanks in advance !!!
> 
> p.s. trying to make a web-based-winamp

Parse which part?  If it is the output, then just do a:

split('<br>', @output);

Give us more info.

dave


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

Date: Fri, 1 Jun 2001 23:30:33 +0200
From: "Daniel van den Oord" <daniel304@planet.nl>
Subject: Re: parsing an output of httpQ
Message-Id: <9f91cp$7f73e$1@reader01.wxs.nl>

okay..
httpQ is a a little server that shows information of winamp (music program)
The information you want you can ask by going to this url
http://your.server.ip:port/getplaylisttitle?p=password
a page opens and show you all the titles in winamp's playlist. the catch is
that
the source of this page is just this in one long sentence

----------------source------------------
Artist-title song<br>Artist-title song<br>Artist-title song<br>Artist-title
song<br>Artist-title song<br>Artist-title song<br>
--------------end source----------------

because the fact it isn't really an existing file your opening I am not able
to open it and read it as a normal file because then it is simpel...
I hope you understand what I'm trying to tell ?!?

thanks in advance !!!
Daniel




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

Date: Fri, 1 Jun 2001 23:33:41 +0200
From: "Daniel van den Oord" <daniel304@planet.nl>
Subject: Re: parsing an output of httpQ
Message-Id: <9f91im$7fkb8$1@reader01.wxs.nl>

scuse me the problem is not splitting this thing up the problem is to be
able to read it because it isn't text that commes from a file but it is
generated on demand !!!!
This way I can not treat it as a file and open and read it like one !!!

I'm not a newbie in cgi/perl. I have my own homepage that is being build up
according the used client using 3 or 4 different files (this includes
cookies and 2 mysql databases)

Thank you !!!

"Godzilla!" <godzilla@stomp.stomp.tokyo> schreef in bericht
news:3B17A7C9.F7AAD2B7@stomp.stomp.tokyo...
> Daniel van den Oord wrote:
>
> (snipped)
>
> > Artist-title song<br>Artist-title song<br>Artist-title
song<br>Artist-title
> > song<br>Artist-title song<br>Artist-title song<br>
>
> > I want to be able to parse this into an useable array
> > is this possible ?!?
>
>
> You will do yourself a greater service by reading about
> and researching arrays along with how arrays can be
> created, rather than coming here to ask. This basic
> nature of your question indicates you really need
> to do your homework.
>
>
> Godzilla!




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

Date: Fri, 01 Jun 2001 14:55:10 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: parsing an output of httpQ
Message-Id: <3B180F3E.2F44B4A2@stomp.stomp.tokyo>

Daniel van den Oord wrote:
 

> scuse me the problem is not splitting this thing up...

Then why did you ask how to create an array?


> the problem is to be able to read it...

What problem? Obviously you can read it; you posted
it here.


> because it isn't text that commes from a file but it is
> generated on demand !!!!

Looks like text to me and, I don't find it quite
as exciting as you do.


> This way I can not treat it as a file and open and read it like one !!!

Reads to me your brains are on the verge of exploding.

 
> I'm not a newbie in cgi/perl.

If you are not a Perl newbie, then you are a troll.


> I have my own homepage that is being build up
> according the used client using 3 or 4 different files
> (this includes cookies and 2 mysql databases)

Boy Howdy, you are some wingdinger for sure.
Bet this homepage of yours took years to build.


You say you are not a Perl newbie. Why are you not
using LWP Simple to fetch this song list?

So which are you, Perl newbie or troll?


Godzilla!


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

Date: 1 Jun 2001 20:12:26 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Perl and Unicode
Message-Id: <eli$0106011600@qz.little-neck.ny.us>

In comp.lang.perl.misc, Christian Koch <c.ko@gmx.de> wrote:
> I want to insert data in unicode format into an oracle-db. My input is a
> file with unicode-values. All these values must be converted into the
> unicode-signs.

I don't understand what you mean by "unicode-values" and "unicode-signs".
It seems really easy to misunderstand things related to unicode, so
being too explicit about what you want is rarely a problem.

> Is it possible to use Perl and Unicode? How can I use it? What functions are
> available to transform unicode-signs and values?

There are lots of ways perl can use unicode. Some seem to work better
than others, what have you looked at? I've used the Unicode::String
module for converting between utf16 and utf8 successfully. It seems
like it might be able to do what you want, but again, I'm not sure
what you want.

Elijah
------
dealing with utf16 coming out of Oracle and utf8 going to a web browser


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

Date: Fri, 1 Jun 2001 15:31:04 -0600
From: "Matt Freel" <me@don't.bother>
Subject: perlcc
Message-Id: <9f919h$1q71$1@msunews.cl.msu.edu>

I'm getting a fatal error 11 after about a half our of compiling.  Does
anyone have any suggestions on this.  My code is about 5000 lines broken
into 8 or 9 packages.  I need to get this into a stand alone binary.  Thanks
for the help





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

Date: 01 Jun 2001 19:11:59 +0100
From: nobull@mail.com
Subject: Re: Posting Etiquette
Message-Id: <u9ofs8ul1s.fsf@wcl-l.bham.ac.uk>

"Jürgen Exner" <jurgenex@hotmail.com> writes:

> "Rob" <"relaxedrob@optushome.com.au"> wrote in message
> news:S0ER6.5468$25.19644@news1.eburwd1.vic.optushome.com.au...
> > > I did not threaten you.
> > > What is threatening in the above?
> > > Do you know what "killfile" means?
> > >
> > > >If my style is not acceptable to you, do not reply to my posts.
> > >
> > > I (and I expect, many others) will not be seeing any of your posts.
> > > That is what "killfile" means.
> >
> > That is what 'threat' means.
> 
> Excuse me???

He's abolutely right you know.  The statement "if you alienate me I'm
not listen to your requests for help you in future" _is_ a threat.

> Do you seriously demand that everyone must listen to your poor manners?

No, he appears to demand that he should be killfiled _without_
_warning_.  It's not the sanction that he objects to, it is the
warning that he objects to.

Where do we find these trolls?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 01 Jun 2001 14:34:37 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Posting Etiquette
Message-Id: <o0ofhtciagj1p1d4gfi96e09kf3gemshuh@4ax.com>

On 01 Jun 2001 19:11:59 +0100, nobull@mail.com wrote wonderful things
about sparkplugs:

SNIP
>
>Where do we find these trolls?

comp.lang.perl.misc.trolls
--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com


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

Date: Fri, 01 Jun 2001 20:59:45 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Posting Etiquette
Message-Id: <thg0i1quhdah6e@corp.supernews.com>

nobull@mail.com wrote:

> He's abolutely right you know.  The statement "if you alienate me I'm
> not listen to your requests for help you in future" _is_ a threat.

Yes, but a threat of action and a threat of action directed towards
someone are different.

>> Do you seriously demand that everyone must listen to your poor manners?

> No, he appears to demand that he should be killfiled _without_
> _warning_.  It's not the sanction that he objects to, it is the
> warning that he objects to.

Perhaps he feels that talking about killfiling him is adding insult
to injury. Personally, I haven't killfiled him yet, and since he's
kind enough to reply in context after he was asked to do so, I will
not be killfiling him in this thread. I may killfile this thread
itself, though, since it's been off-topic longer than it's been
on-topic.

> Where do we find these trolls?

For once, nobull, I actually disagree with you, and this is fairly
rare. I don't think Rob is a troll, and I think calling him such
is a bit of an overstatement. This thread is getting annoying, but
to me ROb's part in all of this seems to be from misudnerstanding
the group he's thrust himself into by posting here, and I think
he's willing to try to understand us if we'll just be quiet about
whether or not we want to killfile him. On this, I think Kira made
a good point. Why do we (yes, "we" -- I've been known to do it too)
publicly announce killfiling people on such a regular basis? I mean,
if someone has been so blatantly rude that they deserve a slap in
the face along with being ignored, that's one thing. Often, though,
people get a public *plonk* for things which seem a trifle.

At least Rob is trying to do something to get along, which is more
than I can say for most of the people in my killfile. He's not a
model clpmisc poster right now, but he did alter his quoting style
to match the preference of the group. That should be good for
something. Of course, I'd also appreciate it if he'd ignore the
'threat'/'not a threat' argument. One person can ignore posts as
easily as another, after all.

Have a <insert adjective here> day.
Chris 

-- 
Programming is a tool. A tool is neither good nor evil. It is
the user who determines how it is used and to what ends.



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

Date: 01 Jun 2001 18:48:50 +0100
From: nobull@mail.com
Subject: Re: releasing array memory
Message-Id: <u9u220um4d.fsf@wcl-l.bham.ac.uk>

aperrin@telocity.com (Andrew J. Perrin) writes:

> My understanding, also, is that even letting variables go out of scope
> won't return memory to the OS, although I suspect that's to some
> extent a function of the OS, not of perl. Can anyone verify?

In principle you can release heap memory to Unix using brk(2) but very
few things written in C ever do because of heap fragmentation.  I
don't know about other OSs.  Some things (but not perl) have
defragmentable heaps instead of or as well as the C heap.  A
defragmentable heap in a mmap()ed memory segment can give back memory
to the OS when it shrinks.

If Perl had proper garbage collection then giving it a defragmentable
heap would be possible but would mean you couldn't use the pack/unpack
trick on a refrence to get at the internals of an object.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 01 Jun 2001 18:30:39 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: releasing array memory
Message-Id: <jbRR6.44243$v5.3671055@news1.rdc1.ct.home.com>

nobull@mail.com wrote:
> aperrin@telocity.com (Andrew J. Perrin) writes:

>> My understanding, also, is that even letting variables go out of scope
>> won't return memory to the OS, although I suspect that's to some
>> extent a function of the OS, not of perl. Can anyone verify?

> In principle you can release heap memory to Unix using brk(2) but very
> few things written in C ever do because of heap fragmentation.

It depends on the way that malloc and free are implemented if you're not
using perl's built-in malloc. On some Unix systems, large memory requests
are granted via anonymous mmap, and freeing that large chunk then releases
the mmap segment and your process' memory space will shrink. Other OSes
(VMS and MacOS spring to mind) do similar things.

					Dan


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

Date: 1 Jun 2001 12:45:54 -0700
From: corcos@metalink.com (Igal Corcos)
Subject: SARGE
Message-Id: <23e89631.0106011145.4cc6fafd@posting.google.com>

Hello,
 
I am currently using Sarge to monitor the activity of some machines.
However, I have another machine which cannot be connected to using
remote commands (i.e. rsh, remsh) .  As such, does anyone know of a
version of Sarge that monitors the activity of a machine but which
runs locally on that machine...using sh to connect to the machine
rather than rsh or remsh.

If no such version exists, can anyone tell me how to get this to work
by modifying the existing script written by Ed Finch.

Any help would be greatly appreciated.


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

Date: Fri, 01 Jun 2001 21:26:38 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: time
Message-Id: <thg24ebllhok83@corp.supernews.com>

Rob ("relaxedrob@optushome.com.au") wrote:
: I want to get the current time in this format:
:   DD-MM-YYYY HH:MI AM

  use POSIX qw(strftime);
  print strftime('%d-%m-%Y %I:%M %p', localtime);

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "God becomes as we are that we may be as he is."
   |               - William Blake


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

Date: Fri, 01 Jun 2001 19:14:35 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: UPDATE & for loop
Message-Id: <vQRR6.22495$lP5.9811313@news1.rdc2.pa.home.com>


"bin" <givemeonly@hotmail.com> wrote in message
news:ac020fec.0106010532.350cdf27@posting.google.com...
> I have a problem with updating values in a mysql database. When I
> execute the perl script the it will only update the last value in the
> for loop into the database (everything else in the script works fine
> except for the update bit..)
>
> First it gets values out of the database and then it creates values in
> a loop which it has to insert into a different table.
>
> while (@rows = $sth5->fetchrow_array){
> my $periodid = $rows[0];
> my @park = $rows[1];

One thing is that perhaps you want something more like

my $periodid = shift(@rows);
my @park = @rows;

With what you currently have, you will never have more than one thing in
@park, which may be the source of your error.  Another potential snafu is
that fetchrow_array only returns the columns of a single row, you may
actually be looking for fetchall_array, which returns an array reference to
all the rows in the result set.  Hope this helps --

--Ben Kennedy







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

Date: Fri, 1 Jun 2001 13:35:12 -0700
From: "cadfei" <cadmcse@hotmail.com>
Subject: Why this substitution doesn't work?
Message-Id: <9f8tre$pkl$1@taliesin.netcom.net.uk>

I have a txet file need to modify ;

whenever line start begin from "R", only keep first ,second,third and last
element
and remove the least ;
like this example , 113.29 , 495.66,462.2 should remove .

to test s///, I simplify the condition remove the element before "$[po]"  if
match;
but even this doesn't work, can eveybody show me why ??


open(DATA,"c:/temp/except.txt");
while(<DATA>) {
   s/(\S+) $[po]/$[po]/;
 print;

}


### except.txt ###
MN209 n1 gnd gnd GND hn w=2.4 l=0.9
MP204 vdd ADDPAD NP1 vdd hp w=6 l=1.1
R96 CEBPAD net375 113.29 $[po]
R97 net375 CEBPADR 495.66 $[po]
R98 net369 OEBPADR 495.66 $[po]
MP202 vdd ADDPAD NP1 vdd hp w=20 l=1.1
R99 OEBPAD net369 113.29 $[po]
R103_0 APAD<0> net367<0> 462.2 $[po]
R103_1 APAD<16> net367<1> 462.2 $[po]




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

Date: Fri, 01 Jun 2001 22:04:40 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Why this substitution doesn't work?
Message-Id: <3B181164.7F4D7617@acm.org>

cadfei wrote:
> 
> I have a txet file need to modify ;
> 
> whenever line start begin from "R", only keep first ,second,third and last
> element
> and remove the least ;
> like this example , 113.29 , 495.66,462.2 should remove .
> 
> to test s///, I simplify the condition remove the element before "$[po]"  if
> match;
> but even this doesn't work, can eveybody show me why ??
> 
> open(DATA,"c:/temp/except.txt");
> while(<DATA>) {
>    s/(\S+) $[po]/$[po]/;

You need to escape certain characters in regular expressions for them to
match the literal character. 

$ perl -MO=Deparse -e 's/(\S+) $[po]/$[po]/;'
-e syntax OK
s/(\S+) 0po]/0po]/;

Perl reads the character sequence '$[' as the special variable $[ and
interpolates it so you have to escape the dollar sign. Next the regex
engine sees [po] and interprets it as a character class so you have to
escape the '[' to get a literal [ character.

s/(\S+) \$\[po]/\$[po]/;


>  print;
> 
> }


John
-- 
use Perl;
program
fulfillment


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

Date: Fri, 01 Jun 2001 14:32:54 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Workgrounds for perl2exe ??
Message-Id: <1snfht09un0ch7qlp9oj56nhlclff5dadl@4ax.com>

On Fri, 01 Jun 2001 12:40:35 -0700, Darius <> wrote wonderful things
about sparkplugs:
SNIP
>>
>Uhhhhh ..... no.
>I was asking for another way to get rid of the console window from
>executable perl apps, or an alternative to perl2exe.
>I was not asking for a crack :P

I'm not trying to flame you but I read your original post exactly like
Helgi did.

Remember we have no idea what you mean only what you write.  Ask the
question and skip the explanations next time.

--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com


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

Date: Fri, 01 Jun 2001 17:39:55 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Workgrounds for perl2exe ??
Message-Id: <3B180BAB.597E67C0@patriot.net>

> I was asking for another way to get rid of the console window from
> executable perl apps, or an alternative to perl2exe.
> I was not asking for a crack :P

Why not do this?  Compile your program (what's the site, BTW...I'd like to
see how
you're doing with the Tk programming), and include a batch file that starts
the
GUI program with the 'start' command.



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

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


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