[12324] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5924 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 8 18:07:26 1999

Date: Tue, 8 Jun 99 15:00:20 -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           Tue, 8 Jun 1999     Volume: 8 Number: 5924

Today's topics:
        AARRRGGGG!!! <jscott@oro.net>
    Re: AARRRGGGG!!! <jeromeo@atrieva.com>
        approximate match? bing-du@tamu.edu
    Re: approximate match? (Andrew Johnson)
    Re: Arrays - remove multiple entries <aqumsieh@matrox.com>
        business-critical, simple IPC problem <a2651866@smail.uni-koeln.de>
    Re: Creating an external config file. How ? <rootbeer@redcat.com>
        Discard faulty addresses using Net::SMTP ravicj@my-deja.com
    Re: Help Killing Zombies (Ken Pizzini)
    Re: Help using Win32::Shortcut <crud@free.net>
    Re: Help with protect.pl, pleeeease! <rootbeer@redcat.com>
        Hosting question... <MM@devsys.com>
    Re: Killing parent subroutines <mdw190@psu.edu>
    Re: Killing parent subroutines (Matthew Bafford)
    Re: Perl "constructors" <jdporter@min.net>
    Re: Perl "constructors" <jdporter@min.net>
        perl - HP-UX <jknoll@ipt-inc.com>
    Re: perl - HP-UX (Darren Greer)
        Perl Expert Opinion on Million Size Hashes (Ankur Narang)
    Re: Perl Expert Opinion on Million Size Hashes <uri@sysarch.com>
    Re: Perl Expert Opinion on Million Size Hashes (Alastair)
    Re: Perl on win32 <rolm@my-deja.com>
        permissions problem with Win32::DomainName() fxn under  <bcronin@icsi.berkeley.edu>
    Re: Regular Expresion <xpalo03@vse.cz>
    Re: Sending LOTS of Messages by Script (Helmut P. Fleischhauer)
        Sequently adding data to a hash with $x[x..x]??? <mats.pettersson@falukuriren.se>
    Re: Sockets help: data gets lost <rootbeer@redcat.com>
        Syntax checking a Perl script <erd@rsn.hp.com>
    Re: Using hash keys (Dean Hudson)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 8 Jun 1999 14:06:05 -0700
From: oronet Tech - Joshua Scott <jscott@oro.net>
Subject: AARRRGGGG!!!
Message-Id: <Pine.LNX.3.96.990608140159.26883C-100000@Au.oro.net>

I am still really new to perl so forgive my stupidity.  What the hell does
this mean?

Argument "\n" isn't numeric in add at ./ptemp line 20, <GEN0> chunk 1.

this is line 20:

$tseconds += $element[3];

@element comes from:

@element = split /\t/, $line;


Any help would be greatly appreciated.  please.



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

Date: Tue, 08 Jun 1999 14:33:52 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: oronet Tech - Joshua Scott <jscott@oro.net>
Subject: Re: AARRRGGGG!!!
Message-Id: <375D8C40.E2634112@atrieva.com>

oronet Tech - Joshua Scott wrote:

> Argument "\n" isn't numeric in add at ./ptemp line 20, <GEN0> chunk 1.
> $tseconds += $element[3];

It means that $element[3] isn't numeric, which is what the += operator
expects.

> @element comes from:
> @element = split /\t/, $line;


What do you suppose the end of these lines contain?  (Hint:  See perlre
for the meaning of '\n')

1	3	5	9
2	4	6	8


What you need to do is chomp() $line before you split() it.  For all the
exciting detail on split and chomp, read the perlfunc manpage that came
with your perl distribution.  

Also, you might want to re-consider your post's titles, as
'AARRRGGGG!!!' is not very descriptive, and likely to be ignored.

Good Luck! 

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Tue, 08 Jun 1999 19:46:00 GMT
From: bing-du@tamu.edu
Subject: approximate match?
Message-Id: <7jjrtk$uho$1@nnrp1.deja.com>

Hello there,

To make things simple, let me say I have a file (file1) containing:

No.  Name
----------
123 "foo boo too"
----------
And in another file (file2):

No.  Name
--------------
123 "hello world"
123 "foo soo too"
--------------

I need to use file1 to modify file2.  For each entry in file1,
search in file2 by the same No. and modify the right entry in file2.
That is in file2 '123 "foo soo too"'  should be changed to '123 "foo
boo too"', but '123 "hello world"' should be left as it is because it
refers to a totally different thing eventhough it has the same No.

Can anybody advise me how to let the program be smart enough to know
that '123 "foo boo too"' is an approximate match to '123 "foo soo too"'
but rather than '123 "hello world"'?

Any idea and suggestions would be greatly appreciated,

Bing


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 08 Jun 1999 21:44:39 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: approximate match?
Message-Id: <b9g73.982$WL.19937@news2.rdc1.on.home.com>

In article <7jjrtk$uho$1@nnrp1.deja.com>,
 bing-du@tamu.edu <bing-du@tamu.edu> wrote:
! Hello there,
! 
! To make things simple,
[snip]

You can check out the String::Approx module.

regards
andrew

-- 
      Some people, when confronted with a problem, think 'I know,
      I'll use regular expressions.'  Now they have two problems.
          -- Jamie Zawinski, on comp.lang.emacs
      


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

Date: Tue, 8 Jun 1999 16:21:16 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Arrays - remove multiple entries
Message-Id: <x3yr9nmfnpf.fsf@tigre.matrox.com>


David Hiskiyahu <David.Hiskiyahu@alcatel.be> writes:

> --------------FBCE4B3293477E0C5CCCE4DB
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

Usenet is a plain text medium. Configure your newsreader to post plain
text only, please.

> I saw once a nice piece of Perl code that would efficiently 
> eliminate multiple occurences of a element from a sorted array. 

You mean the FAQ that is enlisted in perlfaq4: 

	How can I extract just the unique elements of an array?

?? Or was it somewhere else?


> I hope that this can be done better than below: 
> 
> foreach $name (@list) { push @newlist, $name unless (grep /$name/,
> @newlist) } 

Ughhhh... Ikkhhh ... AAhhhhhh... *stomp*



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

Date: 08 Jun 1999 22:39:54 +0200
From: Lash Canino <a2651866@smail.uni-koeln.de>
Subject: business-critical, simple IPC problem
Message-Id: <q1zfmo291.fsf@fairy.fairground>

Trying to sell perl to the management, I have isolated the
following point as critical:

How to do local interprocess communication between a legacy
application written entirely in Borland Pascal and a perl process
on Win32?  I would like to create a producer-consumer setup,
with BP the producer and perl the consumer.  No sockets are
needed, a unidirectional pipe or at least backticks would do.
How does this work for production code targeting Win95/NT
administrated by naive users?  Examples?  References?  Keywords?

This is a 1K users BASIC/Pascal/Delphi production environment
after 12 years, where perl is still unheard of but has lots of
potential uses.

Thank you ever so much.


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

Date: Tue, 8 Jun 1999 13:17:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Creating an external config file. How ?
Message-Id: <Pine.GSO.4.02A.9906081316140.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Raj Dutt wrote:

> open(INFILE,"configfile.cfg");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> @config_data = INFILE;

I don't think this is doing what you think it's doing. Probably you want
to use 'use strict' and -w so that Perl will give you helpful messages.
Good luck!

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



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

Date: Tue, 08 Jun 1999 18:48:19 GMT
From: ravicj@my-deja.com
Subject: Discard faulty addresses using Net::SMTP
Message-Id: <7jjohh$t0r$1@nnrp1.deja.com>

I want to be able to discard faulty addresses(valid email addresses, but
incorrect username@domain) without sending the email.  I use Net::SMTP
to send the mail.

#!/usr/local/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new('mailhost');
$smtp->mail($ENV{USER}); $smtp->to('postmaster');
$smtp->data(); $smtp->datasend("To: postmaster\n");
$smtp->datasend("\n"); $smtp->datasend("A simple test message\n");

#Somewhere here I want to check if SMTP code 550 is returned for invalid
#username and if TRUE I want to $smtp->reset();

$smtp->dataend();
$smtp->quit;

All advise will be appreciated!

Ravi


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 8 Jun 1999 17:48:00 GMT
From: ken@halcyon.com (Ken Pizzini)
Subject: Re: Help Killing Zombies
Message-Id: <slrn7lqlkv.5la.ken@pulsar.halcyon.com>

On Fri, 04 Jun 1999 13:22:11 -0400,
Eric Hawkins <ra9031@email.sps.mot.com> wrote:
>I am a newbie Perl programmer, and I was wondering if someone could give
>me some slick way to kill zombie processes from within Perl.

Zombies aren't living processes which can be killed --- they're
already mostly dead.  You just need to bury the corpse with
a "wait".

		--Ken Pizzini


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

Date: 8 Jun 1999 20:27:31 GMT
From: Crud Mucosa <crud@free.net>
Subject: Re: Help using Win32::Shortcut
Message-Id: <8DDFA7209crudmucosaworldnetat@netnews.worldnet.att.net>

Thanks! I'll give that snippet a try.

Crud

"Jonathan Stowe" gellyfish@gellyfish.com wrote in 
<375cdce6@newsread3.dircon.co.uk>:

>Crud Mucosa <crud@free.net> wrote:
>> Hello out there!
>> 
>> Does anyone have any useful examples showing how to properly use
>> the Win32::Shortcut module? I've been banging my head against 
the 
>> wall trying to get it working with no luck. . .
>> 
>
>I posted this self same snippet awhile back:
>
>#!perl -w
>
>use strict;
>
>use Win32::Shortcut;
>my  $LINK=new Win32::Shortcut();
>$LINK->Load('p:\NEWEDT~1.lnk');
>print "Shortcut to: $LINK->{'Path'} $LINK->{'Arguments'} \n";
>open (LINKFILE,$LINK->{'Path'}) || die "Cant open - $!\n";
>$LINK->Close();
>
># etc ...
>
>close(LINKFILE);
>
>where the filename in the Load method is one on your system ...
>
>/j\
>-- 
>Jonathan Stowe <jns@gellyfish.com>
>


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

Date: Tue, 8 Jun 1999 13:11:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help with protect.pl, pleeeease!
Message-Id: <Pine.GSO.4.02A.9906081311130.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Pedro Couto e Santos wrote:

> Hi, I'm using Protect.pl to protect a certain number of html pages on
> my site. It's all working fine, except for anchors. If I have a
> protected HTML page with internal anchors, they won't work and will
> simply link me to my homepage. Any ideia if this is a known innability
> to deal with anchors by protect.pl?

Check with the program's author for a fix. Good luck!

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



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

Date: Tue, 8 Jun 1999 22:26:29 +0200
From: "Rudi" <MM@devsys.com>
Subject: Hosting question...
Message-Id: <7jjuc4$e8c$1@nickel.uunet.be>

Hi,

Would like some feedback about good hosting companies.
One of the features I would like is that they install modules on request and
setup Cron jobs on demand.

Thanks




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

Date: Tue, 08 Jun 1999 16:28:00 -0400
From: Michael Willhide <mdw190@psu.edu>
Subject: Re: Killing parent subroutines
Message-Id: <375D7CD0.789F1DA7@psu.edu>

> 
> OTGH, maybe you really want to use the magical 'goto &sub', as documented
> in the perlfunc manpage.
> 

Indeed, I have found my answer in the magical goto.  It really is
magical.


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

Date: Tue, 08 Jun 1999 21:07:33 GMT
From: dragons@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Killing parent subroutines
Message-Id: <slrn7lr00c.4o1.dragons@dragons.duesouth.net>

On Tue, 08 Jun 1999 14:07:28 -0400, Michael Willhide <mdw190@psu.edu>
held some poor sysadmin at gun point while typing in the following:
: Howdy,
: 	I'm not sure if this is possible, but here is what I'm looking to do. 
: Can I kill the parent function of a subroutine from within the
: subroutine?
: 
: Like this:
: 
: sub parent {
: 	child();
: }
: 
: sub child { 
: 	# force parent to return somehow and call another function.
: }

sub parent {
    return unless ( child() }

    # some stuff
}

sub child {
    if ( 1 ) {
        return; # don't do 'some stuff'
    } else {
        return "let's do 'some stuff'";
    }
}
 
: Thanks. 

HTH,

--Matthew


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

Date: Tue, 08 Jun 1999 18:36:20 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7jjnr3$sn3$1@nnrp1.deja.com>

In article <7jilf3$fr5$1@nnrp1.deja.com>,
  armchair@my-deja.com wrote:
> In article <7jgfum$n16$1@nnrp1.deja.com>,
>   John Porter <jdporter@min.net> wrote:
> > In article <7il6ge$ruq$1@nnrp1.deja.com>,
> >   armchair@my-deja.com wrote:
> > > Since the looping and decision constructs of Perl are the same as
C
> >
> > Superficially.
>
> Do elaborate on what you see as the major difference.

I'll refer you to the standard Perl documentation.
If you're the C/C++ guru you make yourself out to be,
the differences should become apparent as you read the Perl
documentation.

> > > C++, and since C++ now has a string class,
> >
> > Having a string class makes C++ a HLL?  ROFL again.
>
> Do elaborate on what makes a language a HLL

The common, conventional definition is good enough for me.
Try AltaVista if you need more info.


> > > perhaps it is the dynamic
> > > arrays and dynamic hashes that have you ROFL.
> >
> > Not.
>
> I guess that would leave the <> operator. Not much to stand on my
> friend.

That's o.k., I'm not standing anyway, I'm rolling on the floor.


> > If simply having the ability to create ADTs makes a language a HLL,
> > then every language in current usage -- including asm -- is a HLL,
> > because they're all Turing-equivalent.  Were you sick they day they
> > talked about this in class?  Perl is a HLL (relative to C and any
> > of its bastard children) because these data structures and their
> > operators are intrinsic to the language.  Tell me, what is GC like
> > in C++?  Partial evaluation?  Rewriting?
>
> Above you said that dynamic hashes and arrays were, to quote you - Not
-
> the reason that Perl was in your opinion, a high level language.

No, I said they were not the reason I was ROFL.


> And Vector and Map are not just something
> one can create in C++, they have been created, standardized, and ship
> with compilers.

That doesn't make them part of the language, any more than
printf is a part of the C language.  (I know many C fanatics
will argue that they ARE part of the language, because they're
required by the standard.)  Saying the Vector class is a part
of the C++ language is like saying the CGI.pm module is part
of the Perl language.  Absurd.


> And do give me your source code for creating dynamic
> hashes and arrays in Assembler, or were you sick the day they
> supposedly talked about that in class?

I'll send you my rate card.  I would not relish that task; but
at least I admit that it's possible.


> And do you have
> any defense of Perl as a higher level language versus C++ not being
one
> that doesn't involve the red herring of dragging in Assembly?

Everything I've said about Perl being a HLL is still relevant,
even if you only take in the context of comparison to C++.

> It's odd
> that you can't just point out what is in Perl but not in C++

No?  I believe I've done that, though admittedly not in much depth.


> (and we
> haven't even got into what is in C++ but not in Perl).

(I'm not particularly interested.  C++ is great in its own way;
and if I were forced to use it, I would complain only mildly.)


> > Perl is a HLL (relative to C and any
> > of its bastard children) because these data structures and their
> > operators are intrinsic to the language.  Tell me, what is GC like
> > in C++?  Partial evaluation?  Rewriting?

> Before I can answer your question on GC, you will have to tell me what
> you are using GC as an abbreviation for.

Garbage Collection.
Not that a C/C++ programmer would know what that was about.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 08 Jun 1999 18:57:54 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7jjp3c$t9i$1@nnrp1.deja.com>

In article <7jimlo$g69$1@nnrp1.deja.com>,
  armchair@my-deja.com wrote:
> In article <7jgi09$noj$1@nnrp1.deja.com>,
>   John Porter <jdporter@min.net> wrote:
> > In article <7il85o$t0u$1@nnrp1.deja.com>,
> >   armchair@my-deja.com wrote:
> > >   my $variable.
> > > This is not the same as C++ syntax.
> >
> > Obviously.  I never said it was.
>
> Well, with your creative editing, you deleted what you said as well,
so
> presumably you agree you were wrong as well.

No doubt you will make such presumptions; but the entire transcript
of our discussion is available for all to see.  That you would
complain that "my $var" is not C++ syntax, indicates to me that
you weren't following the argument very attentively.


> > But you're telling me that
> > 	Foo x;
> > 	int* p = (int*) &x;
> > 	int i = *p;
> > is an error.  That's news to me.
>
> That is an error, absolutely.

As it happens, it is not an error; absolutely not.
If you think it is, then you misunderstand the purpose and effect
of typecasting.  I got the above code to compile and run without
so much as a warning.


> Int pointers should not point to Foo
> classes or structs, and that pointer should not later be dereferenced.

"Should not" does not an error make.
The compiler assumed I knew what I really wanted to do.


> int *a;
> short b = 2;
> a = &b;

I got a warning about incompatible pointer types; but no errors;
and the code ran fine.  This power is C's two-edged sword.


> > It's not in the core.  Read perldoc overload if you're interested.
>
> Tell me
> about what is in the Perl core my good man, not what someone has
coaxed
> it into doing with unknown success.

Trace back through this thread and see why we were talking about
overloading in Perl in the first place.  It was quite incidental
to the argument.

So if you're not interested in overloading in Perl, then by all
means, feel free not to read perldoc overload.


> > It's simply a higher degree of abstraction.
> > Some programmers see this as a feature.
>
> It's simply a higher degree of uncertainty.

With abstraction comes some uncertainty (for the human, at least).
Most professional programmers feel that the benefits of abstraction
far outweigh the potential down-side of "uncertainty".
I guess it's time I faced the fact that not all programmers are
comfortable with abstraction.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 08 Jun 1999 19:29:29 GMT
From: jrknoll <jknoll@ipt-inc.com>
Subject: perl - HP-UX
Message-Id: <7jjqua$u44$1@nnrp1.deja.com>

Can perl/cgi run on HP-UX

--
JESSE KNOLL
--Senior - Ball State University - INDIANA --
jrknoll@cwix.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 08 Jun 1999 21:09:58 GMT
From: drgreer@qtiworld.com (Darren Greer)
Subject: Re: perl - HP-UX
Message-Id: <375d868a.1132333309@news.qgraph.com>

Did you even try to search for an answer yourself.  The perl website
doesn't actually hide it from you.

On Tue, 08 Jun 1999 19:29:29 GMT, jrknoll <jknoll@ipt-inc.com> wrote:

-->Can perl/cgi run on HP-UX
-->
-->--
-->JESSE KNOLL
-->--Senior - Ball State University - INDIANA --
-->jrknoll@cwix.com
-->
-->
-->Sent via Deja.com http://www.deja.com/
-->Share what you know. Learn what you don't.



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

Date: 8 Jun 1999 21:19:54 GMT
From: ankurn@Eng.Sun.COM (Ankur Narang)
Subject: Perl Expert Opinion on Million Size Hashes
Message-Id: <7jk1dq$10u$1@engnews2.Eng.Sun.COM>

Hi,
     Can some Perl expert help me in answering these questions ?

      Is it possible to have 2 million node hashes in Perl without ending up
    in "Out of memory!" messages ?
    What are the limits on hash size and handling in Perl and how can we 
    get around such problems ? If we use keys() function on such a big-size
    hash what problems can occur ? 
    Similarly what are the mem. issues with 2 million elements size 
    arrays and strings (like passing such an array as an argument to a function)
    and how to get around them.
    
Thanks,
Regards,
Ankur.



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

Date: 08 Jun 1999 17:37:42 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl Expert Opinion on Million Size Hashes
Message-Id: <x7yahu5q6x.fsf@home.sysarch.com>

>>>>> "AN" == Ankur Narang <ankurn@Eng.Sun.COM> writes:

  AN>       Is it possible to have 2 million node hashes in Perl without
  AN>     ending up in "Out of memory!" messages ?  What are the limits
  AN>     on hash size and handling in Perl and how can we get around
  AN>     such problems ? If we use keys() function on such a big-size
  AN>     hash what problems can occur ?  Similarly what are the
  AN>     mem. issues with 2 million elements size arrays and strings
  AN>     (like passing such an array as an argument to a function) and
  AN>     how to get around them.

in general perl can handle data structures as large as you want. a more
practical limitation is real and virtual memory on your system. when you
get that large, you have to be more aware of the underlying system and
how it manages its resources.

using keys on a large hash may lose for you as it will build another
array of that size. try using the each function to iterate over all the
existing keys with much less overhead.

you might want to look into using a dbm flavor to keep most of the hash
on disk.

you didn't describe much about the application other than the hash size
so it is hard to be more specific with answers.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 08 Jun 1999 21:58:12 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Perl Expert Opinion on Million Size Hashes
Message-Id: <slrn7lr83g.5g.alastair@calliope.demon.co.uk>

Ankur Narang <ankurn@Eng.Sun.COM> wrote:
>Hi,
>     Can some Perl expert help me in answering these questions ?
>
>      Is it possible to have 2 million node hashes in Perl without ending up
>    in "Out of memory!" messages ?

Have you tried? I'd guess it depends on how much data each hash contained (and
RAM etc.).

>    What are the limits on hash size and handling in Perl and how can we 
>    get around such problems ? If we use keys() function on such a big-size
>    hash what problems can occur ? 
>    Similarly what are the mem. issues with 2 million elements size 
>    arrays and strings (like passing such an array as an argument to a function)
>    and how to get around them.

It sounds like you should nominate yourself and try some tests. I'd choose a
range of system configurations (RAM/swap etc.) and write some test programs for
various things of interest (large hashes,long strings etc.). The results might
be interesting.

Disclaimer: I am definitely not a Perl expert.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Tue, 08 Jun 1999 20:11:21 GMT
From: RoLm <rolm@my-deja.com>
To: ken.flannigan@disney.com
Subject: Re: Perl on win32
Message-Id: <7jjtcv$v68$1@nnrp1.deja.com>

In article <7jjj00$e8u$1@louie.disney.com>,
  "Ken Flannigan" <ken_flannigan@studio.disney.com> wrote:
> I am trying to set up my environment on my NT box at work for running
Perl
> scripts at the command line. In the Perl book I bought, there's a
setting
> for the pathext environment variable where you set it to
> pathext=%pathext%;.plx
>
> This works fine for the current dos box that's open. The problem is
when you
> close the dos box and then open a new dos session, the pathext is back
to
> the original setting.
>
> Does anyone know how can I make this permanent?
>
> Thanks in advance
> ken.flannigan@disney.com
>
>

try the following:

1. Start->Settings->Control Panel->System
2. Click the Environment tab
3. in the Variable field, type PATHEXT
4. in the Value field, type .COM;.EXE;.BAT;.CMD;.plx
5. Click Set, then Apply, then OK
6. Enjoy!

RoLm




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 08 Jun 1999 14:59:15 -0700
From: Beau Cronin <bcronin@icsi.berkeley.edu>
Subject: permissions problem with Win32::DomainName() fxn under NT Scheduler
Message-Id: <375D9233.9B76B71E@icsi.berkeley.edu>

Hello all.  I've been writing an event log filtering script which must
find all machines in the current domain.  Early in the script, I use the
Win32::DomainName() function in order to find the domain name for use
later (e.g., passing as an argument to other fxns.).  Everything works
great when the script is run from the command line as Administrator, but
there's some weird behavior when I schedule the script to be run using
the scheduler service (in which case the script is run as the System
pseudoaccount).

When run from the scheduler, the DomainName() function returns the value
"NT AUTHORITY", which is not the domain name.  Obviously, the rest of
the script goes awry at this point because it relies on being able to
correctly poll for the domain name at runtime.  I don't want to
hard-code the domain name in the script becuase of interoperability
issues.  

Does anyone know what's going on here?  Does the System account have
insufficient privileges or something?  How can I get it to return the
correct domain name?

Any help greatly appreciated.

Beau Cronin
Systems Administrator
Int'l. Computer Science Inst.


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

Date: Tue, 08 Jun 1999 22:42:38 +0200
From: Ondrej Palkovsky <xpalo03@vse.cz>
To: Tom Lynch <tlynch@cisco.com>
Subject: Re: Regular Expresion
Message-Id: <375D803E.8F5C54BE@vse.cz>

Tom Lynch wrote:
> 
> Greetings:
> 
>         I have the line:
> 
>         foo/foo_bar/foobar\[15\]/foo
> 
>         I need the line to look like:
> 
>         foo\/foo_bar\/foobar\[15\]/foo
> 
>         Note: the tailing /foo no longer contains
>         a backslash. I've tried:
> 
>          $_ =~ s#(/).*/.*$#\\/#;
>
This should work:
$_ =~ s#/(.*/[^/]*)$#\/$1#g;

Bye
  Ondrej
--
Wow, I'm being shot at from both sides.  That means I *must* be right. 
:-)
             -- Larry Wall in <199710211959.MAA18990@wall.org>


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

Date: Tue, 08 Jun 1999 21:10:39 GMT
From: hpf@betaweb.net (Helmut P. Fleischhauer)
Subject: Re: Sending LOTS of Messages by Script
Message-Id: <375d8642.3383144@news.vi-internet.de>

On Sun, 06 Jun 1999 20:25:33 GMT, Rick Freeman <rfreeman@resmatic.com>
wrote:

>I'm in the process of modifying a home-rolled mailing list manager
 .
 .
 .
>It just seems like it might be wrong to open 2000 pipes to sendmail
>and send 2000 messages all at once???  or is it???
>
>Any advice appreciated,
>Rick
---
Hi,
there is a fine perl script at
http://solutionscripts.com/vault/powerlist/index.shtml
It does what it should do very well. Tried it out a few days back with
1.500 or so mails

Helmut


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

Date: Tue, 08 Jun 1999 23:12:18 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Sequently adding data to a hash with $x[x..x]???
Message-Id: <375D8732.BB504C23@falukuriren.se>

Hi!

I'm trying to sequently load a row of data into a hash array, like...

while(<FILE>) {
	chomp;
	@line_of_data = split(/\,/);       // Split data with ','.
	%hash_array = @line_of_data[2..6]; // Add a line of data into the hash.
}

Although the above only remember the last read line of data.

Any ideas?

Mats


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

Date: Tue, 8 Jun 1999 13:07:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Sockets help: data gets lost
Message-Id: <Pine.GSO.4.02A.9906081303490.26349-100000@user2.teleport.com>

On Tue, 8 Jun 1999, Charlene Abrams wrote:

> I have an implementation of an alarm message server written in C, and
> clients written in each of C and perl. When I fire off a couple of C
> clients simultaneously (inasmuch as I can do that with these fingers),
> the behaviour is fine, but if I fire two perl clients simultaneously,
> part of the data sent by one of the clients gets lost. Just never
> arrives.

You should probably see about cutting down the problem to make the
smallest possible example server (ideally in Perl :-) and clients, then
post the source here so that others can try them and see what's going on.

> A secondary, though less important problem I'm having is with the
> receipt of the server "ok" messages by the perl client (again, not the
> C client). It receives the connection "ok" just fine, but subsequent
> "ok"s seem to have blanks inserted before and after them,

Sounds as if, maybe, there is some confusion about line endings (as a wild
guess). Here, again, the source will be helpful.

> If there's a better newsgroup in which to pose this problem, I'd
> appreciate that advice too.

There may be a better one, but this one will do for now. :-)

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



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

Date: Tue, 8 Jun 1999 16:57:56 -0500
From: Erich Douglass <erd@rsn.hp.com>
Subject: Syntax checking a Perl script
Message-Id: <Pine.GHP.4.05.9906081653320.4366-100000@medalion.rsn.hp.com>

I'd like to syntax check a perl file before i execute it, but i need more
functionality than 'perl -c'.  I would like to check for any sort of
statement that might cause a run-time error (refrences to functions that
don't exist, etc...) without actually running the file.  Any ideas...

Please reply via e-mail...

Erich Douglass



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

Date: 8 Jun 1999 13:07:14 -0700
From: deanh@nwnet.net (Dean Hudson)
Subject: Re: Using hash keys
Message-Id: <7jjt5i$ljt@cypress.nwnet.net>

>19:13:28 +1000, Derek Lavine <derek@realware.com.au> says...
>+ I guess in general I am asking things like how do I get individual
>+ keys or all the keys from a hash.
>
>perldoc -f each    (to get the keys -- and values -- one at a time)
>perldoc -f keys    (to get all the keys, as a list)

If you want to step through the hash keys in order you can use 
foreach:

foreach $foo ( sort keys %hash ) {
    # code here: we're stepping thru in
    # order now.
}

Here are some benchmarks (may be broken; I'm a Benchmark novice):

# ----- code ----- #

#!/usr/local/bin/perl5.00502 -w

use strict; use Benchmark;

my %hash;
my ( $t, $i, $j );

@hash{1..100} = (1..100);

$t = timethese( 1000, {
    'foreach' => sub { foreach $i ( keys %hash ) { ; } },
    'each'    => sub { while ( $i = each %hash ) { ; } },
    'sort' => sub { foreach $i ( sort keys %hash ) { ; } },
    '2val_each'    => sub { while ( ( $i, $j ) = each %hash ) { ; } },
});

print $t;

# ------ end ----- #

Benchmark: timing 1000 iterations of 2val_each, each, foreach, sort...
 2val_each:  5 wallclock secs ( 4.51 usr +  0.00 sys =  4.51 CPU)
      each:  3 wallclock secs ( 2.92 usr +  0.00 sys =  2.92 CPU)
   foreach:  2 wallclock secs ( 2.18 usr +  0.00 sys =  2.18 CPU)
      sort:  4 wallclock secs ( 3.27 usr +  0.00 sys =  3.27 CPU)

Hope this helps. (someone should holler if this benchmark is broken...)

dean.

--
dean hudson
-- 
--
dean hudson, <deanh@verio.net>		Verio Systems Engineering


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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