[9960] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3553 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 26 17:05:33 1998

Date: Wed, 26 Aug 98 14:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 26 Aug 1998     Volume: 8 Number: 3553

Today's topics:
    Re: _reverse_ lookahead? <aqumsieh@tigre.matrox.com>
    Re: _reverse_ lookahead? <aqumsieh@tigre.matrox.com>
    Re: _reverse_ lookahead? (Ilya Zakharevich)
    Re: comp.lang.perl.windows.misc (Bob Trieger)
    Re: comp.lang.perl.windows.misc (Mike Stok)
    Re: comp.lang.perl.windows.misc (Kenneth Loafman)
    Re: comp.lang.perl.windows.misc <dan@fearsome.net>
    Re: comp.lang.perl.windows.misc (Michael J Gebis)
    Re: comp.lang.perl.windows.misc (Greg Bacon)
    Re: comp.lang.perl.windows.misc (Greg Bacon)
    Re: comp.lang.perl.windows.misc (Greg Bacon)
    Re: how can I count number of line in file which has a  (Mike Stok)
    Re: how can I count number of line in file which has a  (Honza Pazdziora)
    Re: How to update an input file? <aqumsieh@tigre.matrox.com>
        html and perl <pang38@www.hotmail.com>
    Re: Is there a size limit on $ vars? (Tye McQueen)
    Re: Memory Leaks (remove)readysite.net (Rob Zimmerman)
    Re: Multi-proc/multi-thread support in Perl/Unix <george.kuetemeyer@mail.tju.edu>
        pack and unpack big float (Dave Scott)
    Re: Perl compiler (John Moreno)
    Re: Perl compiler <yong@shell.com>
    Re: Perl compiler (Nathan V. Patwardhan)
    Re: Perl Cookbook, does anyone have it? (Patrick Timmins)
    Re: Perl Cookbook, does anyone have it? (Rufus Xavier Sarsaparilla)
    Re: Playing with file handles <rootbeer@teleport.com>
        print:location woes <dan@fearsome.net>
        Problems with system call <bmiller@newbridge.com>
        Rename a file? <wlin@pip974.aud.alcatel.com>
        Renaming files from a directory list <no@spam.com>
    Re: Renaming files from a directory list (Matt Knecht)
    Re: signal handlers (Charles DeRykus)
    Re: solution to broken require/use, weird current dir p (Greg Bacon)
        why no true/false keywords? <nonspammers.start.after.this.period.hot_redox@hotmail.com>
    Re: why no true/false keywords? (brian d foy)
    Re: why no true/false keywords? (Greg Bacon)
    Re: why no true/false keywords? <tchrist@mox.perl.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 26 Aug 1998 15:16:16 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: _reverse_ lookahead?
Message-Id: <x3yiujfy2nz.fsf@tigre.matrox.com>


thartman@xxxx.xx (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman) writes:

> 
> Does Perl have a RE feature that does reverse-lookahead (or look-behind)?
> I didn't see any reference to it in ed. 2 of the Camel in the RE extensions
> section (pp. 58-69).  Is there a way to accomplish this?

I read somewhere in the Owl book ("Mastering Regular Expressions" by
Jeffrey Friedl, published by O'Reilly) that the author thinks this is
one of the limitations of Perl Regexps (I believe no regexp engine
contains a look-behind function .. but I don't have the Owl book handy
to confirm). But always remember TIMTOWTDI! Refer to that book for
more information.

> 
> For example, I want to match a string of digits not preceded by
> the character 'a':
> 
>   12345       -- matches "12345"
>   b12345      -- matches "12345"
>   a12345      -- doesn't match
>   joe123456   -- matches "123456"
> 
> Is there some way to massage the current RE extensions to do this?
> 

I was able to come up with the following regexp that works for the
above examples .. but might not work for others:

/\b(?:[^a0-9])*(\d+)/

This would only work if the letter "a" immediately preceded the
digits. Another way of doing it (but a bit slower) would be:

if (/(\D)*(\d+)/) {
	if ($1 =~ /a/) {
		print "No good";
	} else {
		print "Okay $2\n";
	}
}

or something similar.

> 
> todd.
> 

Hope this helps

-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: 26 Aug 1998 15:50:37 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: _reverse_ lookahead?
Message-Id: <x3yg1ejy12q.fsf@tigre.matrox.com>

ilya@math.ohio-state.edu (Ilya Zakharevich) writes:

> 
> [A complimentary Cc of this posting was sent to Todd "Waxahachiefortudinouslyexportitionismistically" Hartman
> <thartman@xxxx.xx>],
> who wrote in article <6s18l2$11vk$1@ausnews.austin.ibm.com>:
> > Does Perl have a RE feature that does reverse-lookahead (or look-behind)?
> 
> Yes.
> 
> Ilya

It does? Could you elaborate please?

-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: 26 Aug 1998 20:18:39 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: _reverse_ lookahead?
Message-Id: <6s1qiv$boc$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Andrew Johnson 
<ajohnson@gpu.srv.ualberta.ca>],
who wrote in article <35E44DBB.22470FA7@gpu.srv.ualberta.ca>:
> that's still only for fixed width look-behinds, correct? are
> there any plans to implement any sort of variable width 
> look-behinds?

Plans?!  You mean as in five-year-plan?!

//r should come first (meaning: match in reverse direction).

Ilya


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

Date: Wed, 26 Aug 1998 18:50:19 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1ljf$7l1$1@strato.ultra.net>

Greg Bacon <gbacon@cs.uah.edu> wrote:
-> In article <6s1aak$6cj$1@strato.ultra.net>,
->         sowmaster@juicepigs.com (Bob Trieger) writes:
-> : How will this help solve the problem with all the *nix and Mac people that 
-> : don't know how to read FAQs?
-> 
-> I don't believe that there is nearly the proportion of such rude Unix
-> users.  Regardless of the proportion for Mac users, they're very small
-> in number compared to Unix and Win32.

Could that be because there are more POBs than there are Eunichs?

-> When you consider that Win32 people are mostly rude or clueless (usually
-> both) and that there are lots of them, we lose doubly.  I'd be more than
-> happy to set aside a place just for them. :-)

Are you saying that most people that use Win32 are rude and clueless or am I 
reading it wrong? I've seen the same thing said about people posting from .edu 
domains. Wait a week and see what kind of crap hits the newsgroups.

I personally feel that those of you that are anti-windows, are just frustrated 
because you only know 1 OS/platform. Pick up a book on Windows and stop 
being so afraid of it. Variety is the spice of life.

-> Too bad X-Newsreader: doesn't always tell the real truth, or we might
-> be able to count.

Win32 people either don't know how to or are too courteous to screw with the 
X-Newsreader, unlike those that use *nix platforms and can't keep from 
screwing with `everything'.


Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: 26 Aug 1998 19:14:07 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1mpv$dnc@news-central.tiac.net>

In article <6s1k9q$mlt$5@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <6s1he0$cg$1@msunews.cl.msu.edu>,
>	Dan Nguyen <nguyend7@msu.edu> writes:
>: How about comp.lang.perl.illiterate.misc
>
>Some groups I'd like to see (but not necessarily read)

I'd still love to see comp.lang.perl.guts which Jon Orwant (I think)
suggested and the humourless conformist powers that be rejected :-(

>Maybe those would help kill the noise. :-)

Ever the optimist!

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 26 Aug 1998 19:23:03 GMT
From: loafman@gte.net (Kenneth Loafman)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1naj$38n$1@news-2.news.gte.net>

On 26 Aug 1998 18:31:22 GMT, gbacon@cs.uah.edu (Greg Bacon) wrote:

>In article <6s1he0$cg$1@msunews.cl.msu.edu>,
>	Dan Nguyen <nguyend7@msu.edu> writes:
>: How about comp.lang.perl.illiterate.misc
>
>Some groups I'd like to see (but not necessarily read)
>
>    comp.lang.perl.bedtime-faqs
>    comp.lang.perl.bedtime-docs
>    comp.lang.perl.hold-my-hand-i-dont-wanna-read-the-docs
>    comp.lang.perl.i-want-to-fellate-bill-gates
>    comp.lang.perl.handouts
>    comp.lang.perl.mungers
>    comp.lang.perl.pacifists
>    comp.lang.perl.bitch-about-abigail
>    comp.lang.perl.burnore.die.die.die
>    comp.lang.perl.tchrist-vs-merlyn
>    comp.lang.perl.faqs
>    comp.lang.perl.newbie
>    comp.lang.perl.wizards
>    comp.lang.perl.cgi.wizards
>
>Maybe those would help kill the noise. :-)
>
>Greg

And more seriously:

    comp.lang.perl.i-want-to-defenistrate-bill-gates

although the group could be in most any hierarchy.

 ...Kenneth




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

Date: Wed, 26 Aug 1998 20:12:15 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <904160237.11666.0.nnrp-08.c2deb1c5@news.demon.co.uk>


Greg Bacon wrote in message <6s1k9q$mlt$5@info.uah.edu>...
>In article <6s1he0$cg$1@msunews.cl.msu.edu>,
> Dan Nguyen <nguyend7@msu.edu> writes:
>: How about comp.lang.perl.illiterate.misc
>
>Some groups I'd like to see (but not necessarily read)
>
>    comp.lang.perl.bedtime-faqs
>    comp.lang.perl.bedtime-docs
>    comp.lang.perl.hold-my-hand-i-dont-wanna-read-the-docs
>    comp.lang.perl.i-want-to-fellate-bill-gates
>    comp.lang.perl.handouts
>    comp.lang.perl.mungers
>    comp.lang.perl.pacifists
>    comp.lang.perl.bitch-about-abigail
>    comp.lang.perl.burnore.die.die.die
>    comp.lang.perl.tchrist-vs-merlyn
>    comp.lang.perl.faqs
>    comp.lang.perl.newbie
>    comp.lang.perl.wizards
>    comp.lang.perl.cgi.wizards


Perhaps while you're at it you might want to add, for the sake of balance
and completion:

comp.lang.perl.rude.arrogant.perl.afficionados
comp.lang.perl.hotheaded.perl.gurus
comp.lang.perl.i-want-to-fellate-larry-wall
comp.lang.perl.fuck.people.who.are.trying.to.learn.perl
comp.lang.perl.what.the.hell.makes.you.think.this.is.a.perl.newsgroup.fuck.o
ff.newbie
comp.lang.perl.bitch.bitch.bitch

I'm not saying I even agree with the sentiments expressed in the above
groups, or disagree with those expressed in Greg's, but there are always two
sides to every coin. Three if you read Terry Pratchett. ;-)

--

Dan Adams
dan@fearsome.net




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

Date: 26 Aug 1998 19:31:21 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1nq9$pga@mozo.cc.purdue.edu>

gbacon@cs.uah.edu (Greg Bacon) writes:

}In article <6s1aak$6cj$1@strato.ultra.net>,
}	sowmaster@juicepigs.com (Bob Trieger) writes:
}: How will this help solve the problem with all the *nix and Mac people that 
}: don't know how to read FAQs?

}I don't believe that there is nearly the proportion of such rude Unix
}users.

Unix users are just as rude as anybody else.  It's just that we
usually read the FAQ, so we find other ways to express our rudeness.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 26 Aug 1998 19:53:47 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1p4b$mlt$8@info.uah.edu>

In article <6s1mpv$dnc@news-central.tiac.net>,
	mike@stok.co.uk (Mike Stok) writes:
: I'd still love to see comp.lang.perl.guts which Jon Orwant (I think)
: suggested and the humourless conformist powers that be rejected :-(

Agreed.  Maybe now that *tale == *rra, we can convince him to do a favah
forda fam'ly. :-)

Greg, who watched Donnie Brasco recently
-- 
I considered atheism but there weren't enough holidays.


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

Date: 26 Aug 1998 20:04:13 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1pnt$mlt$9@info.uah.edu>

In article <6s1ljf$7l1$1@strato.ultra.net>,
	sowmaster@juicepigs.com (Bob Trieger) writes:
: Greg Bacon <gbacon@cs.uah.edu> wrote:
: -> When you consider that Win32 people are mostly rude or clueless (usually
: -> both) and that there are lots of them, we lose doubly.  I'd be more than
: -> happy to set aside a place just for them. :-)
: 
: Are you saying that most people that use Win32 are rude and clueless or 
: reading it wrong? I've seen the same thing said about people posting fro
: domains. Wait a week and see what kind of crap hits the newsgroups.

Yes, and your long lines illustrated my point nicely.

Please provide evidence for the claim that people who post from the
 .edu TLD are rude and clueless.

: I personally feel that those of you that are anti-windows, are just frus
: because you only know 1 OS/platform. Pick up a book on Windows and stop 
: being so afraid of it. Variety is the spice of life.

See that thing attached to your leg with five other wiggly things
sticking off of it?  Try to eat it.  Do this every time you fire off
an ill-begotten opinion on things about which you know very little.
I have the unfortunate burden of administering NT at work.  I know
from personal experience how badly NT sucks.

Wouldn't it be silly or even stupid of me to formulate an opinion when
I have very few facts on the matter at my disposal?  Careful how you
answer, because you will also speak about yourself.

: -> Too bad X-Newsreader: doesn't always tell the real truth, or we might
: -> be able to count.
: 
: Win32 people either don't know how to or are too courteous to screw with
: X-Newsreader, unlike those that use *nix platforms and can't keep from 
: screwing with `everything'.

That's not what I meant.  X-Newsreader: isn't always an accurate
reflection of someone's culture, opinions, and cluefulness.  Unix
people may read with a lose32 client.  lose32 people may read with
a Unix client.

Besides, if not munging X-Newsreader: is the best courtesy that the
Win32 crowd can muster, you've just made another contribution to my
Win32 Culture Sucks collection.

Greg
-- 
Why do people give each other flowers? To celebrate various important
occasions, they're killing living creatures? Why restrict it to plants?
"Sweetheart, let's make up.  Have this deceased squirrel."
    -- Jerry Seinfeld


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

Date: 26 Aug 1998 20:36:54 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s1rl6$mlt$12@info.uah.edu>

In article <6s1nq9$pga@mozo.cc.purdue.edu>,
	gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
: gbacon@cs.uah.edu (Greg Bacon) writes:
: }I don't believe that there is nearly the proportion of such rude Unix
: }users.
: 
: Unix users are just as rude as anybody else.  It's just that we
: usually read the FAQ, so we find other ways to express our rudeness.

That's what I meant by `such rude', as in not reading the FAQ and
unashamedly asking for handouts and insulting the group by trying to
turn it into a free helpdesk.

Greg
-- 
Bluto: My advice to you is to start drinking heavily.
Otter: Better listen to him, Flounder. He's pre-med.


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

Date: 26 Aug 1998 19:10:21 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: how can I count number of line in file which has a EOF in the middle of it.
Message-Id: <6s1mit$5u0@news-central.tiac.net>

In article <6s1kgp$41b$1@pheidippides.axion.bt.co.uk>,
Dermot McKay <Dermot.McKay@bt.com> wrote:
>I have a problem with trying to count the number of lines in a file.
>
>I'm using the method described in the Perl FAQ
>
>                open(FILE, "$file");
>                while (sysread FILE, $buffer, 4086) {
>                        $lines += ($buffer =~ tr/\n//);
>                }
>                close FILE;
>
>the only problem is there seems to be a EOF in the file I wish to count.

use binmode FILE before doing any IO on the handle.  In real code
you'd normally check that the open worked etc.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 26 Aug 1998 19:13:28 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: how can I count number of line in file which has a EOF in the middle of it.
Message-Id: <slrn6u8nio.ak7.adelton@aisa.fi.muni.cz>

On Wed, 26 Aug 1998 18:29:46 GMT, Dermot McKay <MCKAYD@aplbt1.agw.bt.co.uk> wrote:
> I have a problem with trying to count the number of lines in a file.

[...]

> the only problem is there seems to be a EOF in the file I wish to count.
> 
> Using UNIX wc -l I get the correct value, but can't using my PERL script
> 
> Is there anyway I can do this using PERL as I what to run the script on an 
> WIN32 machine so can't include wc -l to get the no of lines from within my 
> perl script.

Files + EOF + Windoze? binmode FILE is the answer in like 75 % of the
cases.

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 26 Aug 1998 15:43:35 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: How to update an input file?
Message-Id: <x3yhfyzy1eg.fsf@tigre.matrox.com>

John Warner <support@ichat.com> writes:

This is one of the scariest posts I have seen ...
 
> I am trying to update a series of HTML files.  I need to
> update all the files in a directory from referencing an IP
> address to a DNS host name.  I am running Perl on NT.  I
> tried using:
> 
> perl -p -i -e s/xxx\.xxx\.xxx\.233/dns.hostname.com/g;
> *.html
> 

Hmmm ... I am not NT expert ... but why don't you try single quotes
instead of those \223 and \224 ?? it works for me (I'm on Unix).

perl -pi.bak -e 's/xxx\.xxx\.xxx\.233/dns.hostname.com/g' *.html

> but Perl tells me that it doesn't understand character 233.
> I have not been able to understand why yet.  Time for a
> different approach.  I tried the following but it causes the
> first two lines of the file to be repeated endlessly at the
> end of the file.

Hmmm... 

> 
> #process each file
> foreach $path (@paths){
>  opendir CURRDIR, $path or die "Directory specified does not
> exist!\n $!";
>  @allfiles= readdir CURRDIR;
>  &ProcessFiles1;
>  #unlink @allfiles; # delete the now obsolete files...should
> work on Unix
> 
> }

Please indent your code properly! It's good for everybody.

What is the following chunk of code? Is it the body of ProcessFiles1()
??

> @allfiles = readdir

Didn't you read the files already? what is that lines? where does it end?

>  foreach $file (@allfiles){
>   $fullname = "$path/$file";
>   open INFILE, "+<$fullname";

check the return value or open().

>    print "Working on file $fullname\n";
>    while (<INFILE>){
>    $currpos = tell INFILE;
>     #xxx.xxx.xxx.233 has an actual value in the script
>     #I left it out to protect the customer's identity.

I am not interested anyway.

>    s/xxx\.xxx\.xxx\.233/dns.hostname.com/g;
>    seek INFILE, $currpos, 0;
>    printf INFILE $_;
>   }
>   sleep 3;

Is the script too fast for your application? Do you have 3 seconds to
waste for each loop?

>   seek INFILE,0,1;  #set file marker back to BOF
>   close INFILE;
>  }
> 
> What am I doing wrong?
> 

I have no clue. I don't see how this code behaves the way you told us
it did. Are you hiding any more code from us?

-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: Wed, 26 Aug 1998 16:12:32 -0400
From: Samuel Pang <pang38@www.hotmail.com>
Subject: html and perl
Message-Id: <35E46C30.7059FCFF@www.hotmail.com>

I'm writing a HTML page where backend is using perl. I wondering is
there a way that I can call a new HTML page.

I mean in my perl program, once a user click on submit button it started
process the perl script. During that period I would like to print
"Please Wait" on the screen. Then at the end of process I would like to
print "Thank You". But currently both sentence are printed on the same
page at the same time. Is there a way to invoke another HTML page at the
end of my process???






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

Date: 26 Aug 1998 14:44:08 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: Is there a size limit on $ vars?
Message-Id: <6s1oi8$cfb@fumnix.metronet.com>

rjk@coos.dartmouth.edu (Ronald J Kimball) writes:
) 
) If you want to avoid a shell, that's not the way to do it.  As perlfunc
) says, glob() is the internal function that implements the <*.c>
) operator, which is documented in perlop.  And according to perlop,
) globbing invokes a shell.
) 
) Instead, perlop suggests using readdir() to avoid invoking a shell.

I keep seeing this suggestions and I keep thinking that a much
better idea would be to use a module that implments glob() using
readdir().  There are several.  If you have problems with one,
spend your effort fixing it rather than reinventing it.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Wed, 26 Aug 1998 23:49:44 GMT
From: rob@(remove)readysite.net (Rob Zimmerman)
Subject: Re: Memory Leaks
Message-Id: <6s1e8k$j5h$1@newsy.ncia.net>

Yes its Unix, Solaris 2.5.1 and I have watched TOP but I was looking
for something to run against the script or something that watches the
script specificly as it executes.

Thanks again,
Rob
----


lr@hpl.hp.com (Larry Rosler) wrote:

>In article <6s131q$5hs$1@newsy.ncia.net> on Wed, 26 Aug 1998 20:38:20 
>GMT, rob@(remove)readysite.net (Rob Zimmerman) <rob@(remove)readysite.net 
>(Rob Zimmerman)> says...
>> Is there an effective way to test scripts for memory leaks? I have
>> several scripts running on my server and it seems one of them is
>> robbing ram. How can I determine which it is without removing one at a
>> time....

>If your system is Unix-based, you might try the 'top' command.  For 
>Windows NT, the three-fingered salute brings up the Task Manager, and the 
>Processes tab will give you memory usage on the running processes.

>No Perl here, though...

>-- 
>(Yet Another Larry) Rosler
>Hewlett-Packard Laboratories
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com




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

Date: Wed, 26 Aug 1998 16:40:01 -0400
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Re: Multi-proc/multi-thread support in Perl/Unix
Message-Id: <35E472A1.9DD4BE03@mail.tju.edu>



Greg Bacon wrote:

> In article <Pine.LNX.3.96.980818162506.924A-100000@js.prysm.net>,
>         James Schmidt <james@js.prysm.net> writes:
> : I've got an app that I am developing using Perl 5 on a Sun Ultra
> : Enterprise 5500 with 6 300MHz Ultra-SPARC II processors in it.  Since this
> : application is going to be chewing vast amounts of data and multiple large
> : files at any given time,  I would like to know is if there is a way
> : to bind certain commands, or functions to idle CPU's?
>
> This happens at the operating system level.  Perl has no notion of
> CPU or handing some task to a CPU.

We're experiencing a strange problem which we think may belie the concept that
Perl doesn't have a notion about CPU switching - or, to be more exact - that Perl
is not affected by CPU switching. We recently added a second processor to  an
HP-UX box (running OS version 10.10). Since that upgrade, we've been noticing
that  various programs run via a perl "system" call sometimes return a bogus
return code (always FFFFFF). We're thinking that the Perl script runs on one
processor and the system-called program occasionally runs on the second processor,
resulting in a lost return code. It's a very intermittent problem - everyone's
favorite kind of problem!! We are preparing to use an HP utility to get processor
switching info and the error code problem into logs so we can see if our guess is
correct.



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

Date: 26 Aug 1998 19:24:31 GMT
From: scott@iastate.edu (Dave Scott)
Subject: pack and unpack big float
Message-Id: <6s1ndf$884$1@news.iastate.edu>

I would like to pack and unpack 4-byte floating point data.
Is there a way to do this?  "d" seems too small :).

Thanks,

dave scott
iowa state university
-- 
dave scott
iowa state university
515-294-4057



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

Date: Wed, 26 Aug 1998 15:08:17 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: Perl compiler
Message-Id: <1dedgu8.1gh8pxp4dmbawN@roxboro0-013.dyn.interpath.net>

Honza Pazdziora <adelton@fi.muni.cz> wrote:

>John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
> 
> > All security is via obscurity, as I have been told by someone who claims

Yes, indeed and although I've been staying out of /this/ thread, I
believe I've pointed out the fallacy of this before to this group and
specifically to Tom (I wince every time someone comes out with this
canard).  *BUT* - although all security is through obscurity (well you
/could/ destroy it and everybody that knows about, but that's going a
little too far for most people), if it's not obscure then it's not
secure.

> True. But most of widely used security systems are based on obscurity
> produced by NP-complete problems, not by sticking plain passwords into
> binary.

I.e. - sticking plain passwords in binary files isn't very obscure.

Mangling the password would give a bit of extra obscurity - but not
enough to protect anything worth protecting.

-- 
John Moreno


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

Date: Wed, 26 Aug 1998 14:28:04 -0500
From: yong <yong@shell.com>
Subject: Re: Perl compiler
Message-Id: <35E461C4.60F66CA0@shell.com>

Nathan V. Patwardhan wrote:

> Now, let's run `strings` on it:
>
> $ strings authen
> foobar
> authenticated
> they do not match.  sorry.
>
> One might argue that "the person who looks at this output doesn't know
> the real password", but my guess is that if they want to know, they'll
> try each string that appears in the output.  :-)

This is an interesting example. But in reality, no program is so simple. If you
get a 10 pages long output by running strings (or use adb to look at the symbol
table, etc.), there's a significant amount of obscurity which may be more than
enough. Remember nothing is absolutely secure if you consider "social
engineering"; an employee may give the password to an outsider if he wants.

There're many ways to password-protect a document on the Web. I don't know what
the original poster needs. But one of these may fit her bill:

1. In a HTML form the user has to enter the password "foobar" which is part of
the URL leading to foobar.html. (Use frames or other method to avoid showing
the URL once you get there)
2. The password is stored in a database and authentication is done by checking
the entry in there.
3. Use .htaccess to protect a directory.
4. (not sure about this but it's interesting; I need comments!!!) Web accesses
a script mycgi.pl, which is all readable and executable. This mycgi.pl reads a
file (maybe plain text) containing the password. But this passwd file is not
all readable.

(There may be other ways I can't think of now)

Yong



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

Date: Wed, 26 Aug 1998 19:58:36 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl compiler
Message-Id: <MNZE1.58$wf3.497577@shore>

yong (yong@shell.com) wrote:

: This is an interesting example. But in reality, no program is so
: simple. 

Yes, but let's not bullshit.  It's plain dumb to hardcode passwords
for many reasons.

: 1. In a HTML form the user has to enter the password "foobar" which
: is part of the URL leading to foobar.html. (Use frames or other method
: to avoid showing

I'll read the document source for each frame to get the URL.  That's
hardly obscure.  Is the above what you really meant to convey?

: 4. (not sure about this but it's interesting; I need comments!!!)
: Web accesses a script mycgi.pl, which is all readable and
: executable. This mycgi.pl reads a file (maybe plain text) containing
: the password. But this passwd file is not all readable.

But if 'nobody' or your the user your server is running as is unable
to read the file?

--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>


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

Date: Wed, 26 Aug 1998 19:14:05 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <6s1mps$tad$1@nnrp1.dejanews.com>

In article <6s1aau$1g4i$1@ausnews.austin.ibm.com>,
  "John Call" <johnc@interactive.ibm.com> wrote:
> Has anyone gotten a copy of this yet? I'm dying to get it and it doesn't
> seem to have reached Georgia yet.
>
> If you do have it, do you like it? From what I've seen on the ORA site it
> looks good.
>
> --
> John Call
> IBM Interactive Media

It's not in Omaha yet either, and I'm sure I'm starting to really irritate
the folks at the various Barne's & Noble stores around town!

I "don't need no stinking review" ... I *know* it will be good. I don't think
Tom C. is capable, morally, of putting his name on anything that isn't first
rate.

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 26 Aug 1998 13:06:06 -0700
From: kirbyk@best.com (Rufus Xavier Sarsaparilla)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <6s1pre$6l3$1@shell2.ba.best.com>

In article <6s1mps$tad$1@nnrp1.dejanews.com>,
Patrick Timmins <ptimmins@netserv.unmc.edu> wrote:
>In article <6s1aau$1g4i$1@ausnews.austin.ibm.com>,
>  "John Call" <johnc@interactive.ibm.com> wrote:
>> Has anyone gotten a copy of this yet? I'm dying to get it and it doesn't
>> seem to have reached Georgia yet.
>>
>> If you do have it, do you like it? From what I've seen on the ORA site it
>> looks good.
>>
>> --
>> John Call
>> IBM Interactive Media
>
>I "don't need no stinking review" ... I *know* it will be good. I don't think
>Tom C. is capable, morally, of putting his name on anything that isn't first
>rate.
>
I've got a copy (which I got at the Perl conference), and it is indeed very
good.  It's basically a huge (750 pages, counting the index and everything)
number of commonly asked (and some not so commonly asked) questions, and
resonable solutions, often with more than one way to do it shown.  It's 
going to be a very useful reference book to add to the Perl library -
there's nothing that beats sample code with good explanation, once you're
beyond the Learning Perl stage.

With some luck, it'll help to reduce the number of FAQ-type questions here -
it certainly answers many of them, in a form that the users can actually
use.

-- 
Kirby Krueger      O-     kirbyk@best.com 
<*> "Most .sigs this small can't open their own jump gate."


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

Date: Wed, 26 Aug 1998 20:01:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Playing with file handles
Message-Id: <Pine.GSO.4.02A.9808261255400.4382-100000@user2.teleport.com>

On 26 Aug 1998, David Parrish wrote:

> Assuming I'm reading a file using <FILEHANDLE>.... how do I push the
> read line back to the stream so the next <FILEHANDLE> will read that
> same line?

You could probably accomplish what you want with seek() and tell(). Hope
this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/




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

Date: Wed, 26 Aug 1998 21:44:15 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: print:location woes
Message-Id: <904164450.14448.0.nnrp-08.c2deb1c5@news.demon.co.uk>

I was wondering if anyone else had run into a similar problem....the three
lines below are all perfectly valid, right?:

# Prints text to the screen
print "Content-type: text/html\n\n";
print "Goodbye, cruel World";

# Tucks the script up in bed with a cup of hot cocoa for a few seconds
sleep 15;

# Redirects the script to the page
print "Location: http://domain.com/page.htm\n\n";

OK, fine. However, when I run them together thusly:

print "Content-type: text/html\n\n";
print "Goodbye, cruel World";
sleep 15;
print "Location: http://fearsome.net/rants/$path/board\.htm\n\n";

the script simply prints "Location: etc" to the screen next to "Goodbye,
cruel World".

OK, so I thought maybe it was still obeying the Content-type header, so I'd
better try to differentiate the two seperate print commands:

print SCREEN "Content-type: text/html\n\n";
print SCREEN "Goodbye, cruel World";
sleep 15;
print "Location: http://fearsome.net/rants/$path/board\.htm\n\n";

and now it blithely ignores the fact I want it to print anything whatsoever
to the screen and seemingly charges ahead with the redirection after 0
seconds. Either this script is being exceedingly naughty and doesn't deserve
its hot cocoa, or else I am scrweing something up somewhere - anyone care to
elaborate?

--

Dan Adams
dan@fearsome.net






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

Date: Wed, 26 Aug 1998 15:36:16 -0400
From: Brian Miller <bmiller@newbridge.com>
Subject: Problems with system call
Message-Id: <35E463B0.FA160D1F@newbridge.com>

Hello All,

I am trying to execute a program in the background (graphical
application) using the system
call, however the application crashes. I believe the problem has
something to do with
connections to IO but I am not sure of the details or how to fix it.  If
I do not use the &
in the command it works fine, however I want the perl program to move on
to other things.
Any suggestions?

Example case:

#!/opt/perl/bin/perl

require 5.002;
use strict;

my $cmd  = 'ksh -c "vsim " & ';
system($cmd);

Thanks
Brian

--

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
bmiller@newbridge.com          Newbridge Networks Corporation
Brian E. Miller                600 March Road, Kanata, Ontario K2K 2E6
CAE ASIC Process Support       (613) 591-3600 ext. 6116  FAX: 599-3654





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

Date: Wed, 26 Aug 1998 14:22:44 -0500
From: Weifan Lin <wlin@pip974.aud.alcatel.com>
Subject: Rename a file?
Message-Id: <35E46083.C40256B7@pip974.aud.alcatel.com>

I am trying to replace the file name with the variables. I don't know
too much about Perl.
I got the following script from someone but it didn't work.  Can someone
tell me where is
the problem?

        $original = "abc.jpg";
        $newname = "1234";
        $number = 1;
        $_ = $original;
        /\./;
        rename($original, "$newname-$number\.$'");


Thanks in advance.




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

Date: Wed, 26 Aug 1998 16:12:35 -0400
From: mBird <no@spam.com>
Subject: Renaming files from a directory list
Message-Id: <35E46C33.4C19@spam.com>

I have a directory full of files with long names (like sectionfile1.xdd.323).  I want to go through the 
directory and rename all the files to an 8.3 format (so sectionfile1.xdd.323 would become sectionf.323).  Any 
ideas would be appretiated.


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

Date: Wed, 26 Aug 1998 20:23:01 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Renaming files from a directory list
Message-Id: <F8_E1.1038$pY1.4978007@news2.voicenet.com>

mBird <no@spam.com> wrote:
>I have a directory full of files with long names (like sec
>ionfile1.xdd.323).  I want to go through the 
>directory and rename all the files to an 8.3 format (so se
>tionfile1.xdd.323 would become sectionf.323).  Any 
>ideas would be appretiated.

Keep a hash of shortened names that you've created.  Check each name
against that hash before you rename it so you don't accidently wipe
out files.

Or, were you looking for code?

-- 
Matt Knecht - <hex@voicenet.com>


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

Date: Wed, 26 Aug 1998 18:58:02 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: signal handlers
Message-Id: <EyB8oq.132@news.boeing.com>

In article <35E316A4.59AC831E@pa.dec.com>, nall  <nall@pa.dec.com> wrote:
>
>
>i want to use perl to create a wrapper around a program that the
>user should not be able to ctrl-c out of.  here's an example.
>
>------------------------------
>#!/usr/local/bin/perl
>$SIG{INT} = \&handler;
>$|=1;
>
>`cvs commit file1 file2`;
>
>sub handler {
>print("Handled the interrupt\n");
>$SIG{INT} = \&handler;
>}
>------------------------------
>
>if i press ctrl-c in the middle of execution, i want the program
>to just ignore the SIGINT, but instead it passes it to the cvs
>command. is there a way to avoid this? (once committing starts, i
>don't want the user to be able to intervene). also, i can't run
>it in the background, since cvs needs a terminal to execute the
>editor program in...
>

How about:

{ local $SIG{INT} = 'IGNORE';  ` cvs ... ` } 

Check perlfaq8 to see why a system call is preferable to
backticks though.


HTH,
--
Charles DeRykus


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

Date: 26 Aug 1998 20:06:43 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: solution to broken require/use, weird current dir problem
Message-Id: <6s1psj$mlt$10@info.uah.edu>

In article <LoYE1.432$J3.9736777@nnrp2.ni.net>,
	"Erik Knepfler" <erik@zeno.com> writes:
: In one configuration it will always show the web root regardless of where
: the script exists and is being ran from.  In the other configuration, it
: will properly show the current directory.  Bug?  Maybe.  Older versions of
: Perl.EXE didn't seem to have this problem.

The bug in this case is the bogotic notion that it's reasonable or
even sane to make assumptions about a file based on its extension.

Greg
-- 
Isn't it weird that we drink milk, stuff designed to nourish baby cows? How did
THAT happen?  Did some cattleman once say, "Oh, man, I can't wait till them
calves are done so I can get ME a hit of that stuff."
    -- Jerry Seinfeld


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

Date: 26 Aug 1998 19:03:27 GMT
From: "Saurus" <nonspammers.start.after.this.period.hot_redox@hotmail.com>
Subject: why no true/false keywords?
Message-Id: <01bdd124$2e9e5c40$c1620c8a@lnxcompaq.lexis-nexis.com>

Hello,

	I was wondering why we have no true/false keywords?
Readability would be much better.

	Say true keyword converts to 1 and false keyword to
NULL or some such arrangement.

	Perhaps this is in next version of Perl.


Saurus



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

Date: Wed, 26 Aug 1998 15:22:29 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: why no true/false keywords?
Message-Id: <comdog-ya02408000R2608981522290001@news.panix.com>
Keywords: from just another new york perl hacker

In article <01bdd124$2e9e5c40$c1620c8a@lnxcompaq.lexis-nexis.com>, "Saurus" <nonspammers.start.after.this.period.hot_redox@hotmail.com> posted:

>        I was wondering why we have no true/false keywords?
>Readability would be much better.

i'm having a bit of trouble seeing where they might be useful,
but that's probably just me.  if you can make a compelling 
argument for their inclusion, maybe it will happen.

but until then

   sub true  { 1 } #or whatever you beleive to be true
   sub false { 0 } #or maybe you want undef

:)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: 26 Aug 1998 20:13:27 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: why no true/false keywords?
Message-Id: <6s1q97$mlt$11@info.uah.edu>

In article <01bdd124$2e9e5c40$c1620c8a@lnxcompaq.lexis-nexis.com>,
	"Saurus" <hot_redox@hotmail.com> writes:
: 	I was wondering why we have no true/false keywords?
: Readability would be much better.

There are several false values.  There are many true values.  You
could do something like

    sub true {
        if (shift) {
            return 1;
        }
        else {
            return;
        }
    }

and a similar sub for false, just change if to unless.  Then you
could do conditionals like

    if (true some_sub) { ... }

but it will provide list context (and boolean context is scalar).  That
looks a little too Prologish for my tastes.

: 	Say true keyword converts to 1 and false keyword to
: NULL or some such arrangement.

That doesn't cover all the bases.  There are several false values in
Perl.  There are many true values in Perl.

I personally find

    if ($condition) { ... }

much more readable than

    if ($condition == TRUE) { ... }

but if you want FORTRAN, you know where to find it.

Greg
-- 
I guess I just prefer to see the dark side of things. The glass is always
half-empty. And cracked. And I just cut my lip on it. And chipped a tooth. 
    -- Janeane Garofalo


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

Date: 26 Aug 1998 20:46:02 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: why no true/false keywords?
Message-Id: <6s1s6a$93j$1@csnews.cs.colorado.edu>

In comp.lang.perl.misc, 
    "Saurus" writes:
:	Say true keyword converts to 1 and false keyword to
:NULL or some such arrangement.

No, that would be bad.  Bad bad bad.

    http://language.perl.com/style/slide13.html

--tom
-- 
If I had only known, I would have been a locksmith.  --Albert Einstein


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3553
**************************************

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