[16240] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3652 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 13 14:05:51 2000

Date: Thu, 13 Jul 2000 11:05:29 -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: <963511529-v9-i3652@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 13 Jul 2000     Volume: 9 Number: 3652

Today's topics:
        "Perl by examples" <pepe@pepe.asi.pwr.wroc.pl>
    Re: 64 bit support <jraff@home.com>
    Re: About setsid() (M.J.T. Guy)
    Re: Activestate PPM not working for Windows? <9jerry9@my-deja.com>
    Re: As The Perl Turns [Was Re: ATTENTION PERL  MACHOES! <dburch@teleport.com>
    Re: As The Perl Turns [Was Re: ATTENTION PERL MACHOES!! <juex@deja.com>
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <jbroz@transarc.com>
    Re: ATTENTION PERL MEATHEADS <dburch@teleport.com>
    Re: ATTENTION PERL MEATHEADS <bart.lateur@skynet.be>
    Re: Bizarre BEGIN block problem (Tad McClellan)
    Re: Bizarre BEGIN block problem <ed@nospam.com>
    Re: Bizarre BEGIN block problem <ed@nospam.com>
    Re: Can't dereference for AUTOLOAD (M.J.T. Guy)
    Re: Creating an ordered HoH karger@fermi2.chem.yale.edu
    Re: decrypt perl code (M.J.T. Guy)
        detecting promiscuous mode <sp00fD@yahoo.com>
    Re: Email Attachments in Perl (no modules) eryq@zeegee.com
    Re: File Handle Data size limits (M.J.T. Guy)
    Re: File::Find example <graham.wood@iona.com>
    Re: File::Find example (Arek P)
        Finding memory leak in a CGI::Fast script jhefferon@my-deja.com
        From Dropdown to Variable - How To? mandbinc@rocketmail.com
        generating exe file from perl program <playa786NOplSPAM@excite.com.invalid>
    Re: good free guestbook scripts needed... <russ_jones@rac.ray.com>
    Re: good free guestbook scripts needed... <bart.lateur@skynet.be>
    Re: Grabbing Multiple Occurances WITHOUT Being Greedy (Michel Dalle)
        Hash reverse lookups? jdaves@gilanet.com
    Re: Hash reverse lookups? (Cameron Kennedy)
    Re: Hash reverse lookups? <pap@sotonians.org.uk>
    Re: Help, no cgi push! what else is there? richardstands@my-deja.com
        Help, Please in Interpreting Syntax (Martin McCormick)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 13 Jul 2000 19:19:26 +0200
From: =?X-UNKNOWN?Q?Adam_Sk=F3ra?= <pepe@pepe.asi.pwr.wroc.pl>
Subject: "Perl by examples"
Message-Id: <Pine.BSF.4.21.0007131917160.214-100000@pepe.asi.pwr.wroc.pl>

Could anyone send me book: "perl by examples" in HTML ?



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

Date: Thu, 13 Jul 2000 17:08:13 GMT
From: "jraff" <jraff@home.com>
Subject: Re: 64 bit support
Message-Id: <1Imb5.64197$lU5.427307@news1.rdc1.nj.home.com>

Try again!!!
http://search.cpan.org/search?dist=Math-BigInteger
-------------------------------------------------------1
"Derek Fountain" <nomail@hursley.ibm.com> wrote in message
news:396DD97A.B471C6C9@hursley.ibm.com...
> How well supported are 64 bit integers from Perl on UNIX
> (specifically AIX), Linux on IA32 and Windows NT? I quick
> check suggests "they're not" would be the right answer. Is
> there a module or something I can use? A search on CPAN came
> up with nothing.




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

Date: 13 Jul 2000 16:18:20 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: About setsid()
Message-Id: <8kkq4c$egj$1@pegasus.csx.cam.ac.uk>

In article <3965903A.B7BD87AA@mera.ru>, Ildar  <ildar@mera.ru> wrote:
>Does anybody know how to call setsid() syscall inside perl script
>without using any external modules, for examply POSIX module
>and without using "require syscall.ph;" expression.

Why not use the tools provided?    POSIX::setsid() is what you want.
Why re-invent the wheel?


Mike Guy


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

Date: Thu, 13 Jul 2000 17:34:15 GMT
From: Jerry Leventer <9jerry9@my-deja.com>
Subject: Re: Activestate PPM not working for Windows?
Message-Id: <8kkuim$o4m$1@nnrp1.deja.com>

I have also had problems with the ActiveState PPM on Windows NT4 & 95.
I tried,

       ppm> search Net::SMTP
  and, ppm> install Net::SMTP

but, module could not be found (no error msg just blank line with
prompt).  Looks like I'll have to download the Net:SMTP module from
ActiveState & use makefiles to build it.


In article <3964EE89.ADAE143F@in.tum.de>,
  Gerhard Popp <popp@in.tum.de> wrote:
> Hello,
>
> I downloaded a up to date version of perl from www.activate.com.
> Furtermore I downloaded some Modules, e.g DBI.zip, Win32-ODBC.zip,...
> After I had extracted the zip-files, I wanted to install the
ppd-modules.
>
> Now my problem:
> How could I install this module packages with my Perl Packet Manager
> unter WinNT bzw. Win2000?
> If I start the ppm with e.g.
>
>     ppm install Win32-ODBC.ppd
>     (Win32-ODBC is in the current directory)
>
> I got the following error-message:
>
>     Error installing package 'Win32-ODBC.ppd': Could not locate a PPM
>     binary of Win32-ODBC.ppd for this platform.
>
> I know, there are several binary for different platforms, but
Win32-ODBC
> doesn't work under NT4.0 or Win2000 too.
>
> Knows anybody a solution for this problem or a server, where I could
get
> a other perl-distribution, which is complete or easier to install?
>
> Greetings,
>     Gerhard
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 13 Jul 2000 10:24:54 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Re: As The Perl Turns [Was Re: ATTENTION PERL  MACHOES!!!!!!!!!!!!!!!!!!!]
Message-Id: <396DFB66.DBE698FE@teleport.com>

What a wonderful world Larry's' built.  There's guys like Randel, Larry
R. and lots of other smart people who are willing to take their time to
help even the simple minded (Fred and Barney works for me) learn and use
Perl. Then there are the humorist to keep the group interesting. I'm
starting to feel like I can do something useful with my computer.

Back to lurking...lurklurk

"Jürgen Exner" wrote:
> 
> <p3rlc0dr@my-deja.com> wrote in message news:8kjivs$njs$1@nnrp1.deja.com...
> > In article <396D43F0.B9568961@chaos.wustl.edu>,
> > Be NICE TO ME I AM WOMAN TOO.  ITS BEEN A BAD DAY FOR ME EVERYONE IS
> > BEING MEAN I WENT TO DENTIST AND HAVE FAKE TEETH.
> 
> And your Perl question is?
> BTW: Why are you screaming?
> 
> ***PLONK***
> 
> jue


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

Date: Thu, 13 Jul 2000 09:53:14 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: As The Perl Turns [Was Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!]
Message-Id: <396df3fa@news.microsoft.com>


<p3rlc0dr@my-deja.com> wrote in message news:8kjivs$njs$1@nnrp1.deja.com...
> In article <396D43F0.B9568961@chaos.wustl.edu>,
> Be NICE TO ME I AM WOMAN TOO.  ITS BEEN A BAD DAY FOR ME EVERYONE IS
> BEING MEAN I WENT TO DENTIST AND HAVE FAKE TEETH.

And your Perl question is?
BTW: Why are you screaming?

***PLONK***

jue




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

Date: Thu, 13 Jul 2000 18:16:14 +0100
From: "Joe_Broz@transarc.com" <jbroz@transarc.com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <396DF95E.2AB54D1B@transarc.com>

p3rlc0dr@my-deja.com wrote:
> 
> In article <396CAA2C.97CADBFB@lucent.com>,
>   Jeff H <jeffahill@lucent.com> wrote:
> > Ok, Ganesha, up until now I was with you.  But the books that Randall
> "had a
> > hand in" isn't just any book.  It's THE book.  After reading
> _Learning Perl_, I
> 
> NO ITS NOT.  RANDAL IS JAIL.  MATT IS NICE.
> 

Why do I get the feeling that this is Eliza?


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

Date: Thu, 13 Jul 2000 08:10:21 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Re: ATTENTION PERL MEATHEADS
Message-Id: <396DDBDD.F612FACF@teleport.com>



"Godzilla!" wrote:
> 
> Joe Kline wrote:
> > Craig Berry wrote:
> > > p3rlc0dr wrote:
> 

> 
> This type of hatred you and others display is repugnant
> and has no rightful place within our Christian world.


Oh Gawd,  is the the Chistian world board now.  Isn't that what the
guy's in Fiji are saying.  Go Ganesha!


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

Date: Thu, 13 Jul 2000 18:06:10 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: ATTENTION PERL MEATHEADS
Message-Id: <t6qrms4178rfoi4vig3c9hi57usf1rbi2c@4ax.com>

Godzilla! wrote:

>... all these personae you pretend to be. 

My, my. Look's who's saying that.

-- 
	Bart.


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

Date: Thu, 13 Jul 2000 10:18:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Bizarre BEGIN block problem
Message-Id: <slrn8mrju1.akf.tadmc@magna.metronet.com>


[ There is no   comp.lang.perl   newsgroup. 
  It was rmgrouped *several* years ago.
  It is beginning to look like you should find a provider
  that is not lost in a time warp...
]


On Thu, 13 Jul 2000 13:20:52 GMT, Ed Foy <ed@nospam.com> wrote:

>Greetings,


Yo.


>The one response I received to a prior post about this problem


You asked me to look at that post, so I did.

What I had to say was better said in email, so I sent you one.

It bounced.

So I went back to your post to find the correct email address.

There was none.

You cannot be reached by email.



I have a hard and fast rule about such situations.

I gotta give you your own personal killfile entry.

And this is a shame, as I'd like to help you (and your daughter,
who should continue to reprimand you for not having "use strict"
from the gitgo).


If you change posting addresses (or wait 2-3 months), I'll start
seeing your posts again.

Sorry  :-(


>I
>need a solution that applies to my specific target environment - Perl
>5.004 under UNIX.
 ^^^^^


What I was going to say in email:


I (and probably everybody else) have no interest in potential bugs
in two year old software.

Sticking with 5.004 is volunteering for support problems.



-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 13 Jul 2000 17:53:05 GMT
From: "Ed Foy" <ed@nospam.com>
Subject: Re: Bizarre BEGIN block problem
Message-Id: <5mnb5.62962$_b3.1834587@newsread1.prod.itd.earthlink.net>


Tad McClellan wrote in message ...
>
>You asked me to look at that post, so I did.
>
>What I had to say was better said in email, so I sent you one.
>
>It bounced.
>
>So I went back to your post to find the correct email address.
>
>There was none.
>
>You cannot be reached by email.
>
>I have a hard and fast rule about such situations.
>
>I gotta give you your own personal killfile entry.

I also have a hard and fast rule: never put private email addresses in
newsgroups. This policy keeps the SPAM to a low roar so I spend much
less time wading through junk mail and updating TWIT filters. It's
called an ounce of prevention.

>What I was going to say in email:
>
>
>I (and probably everybody else) have no interest in potential bugs
>in two year old software.
>
>Sticking with 5.004 is volunteering for support problems.

That is what my ISP provides. That is what I must use until they
upgrade. For better or worse, the real world doesn't upgrade just
because there is something newer available. "Newer" doesn't mean better,
just a different set of bugs to contend with. Witness: everything
Microsoft has produced from day one.

Does this comment mean SGML Consulting will only work with the "Latest
and Greatest" implementation of something or reinvents the wheel because
the original wheel doesn't use the latest set of bugs?

Ed





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

Date: Thu, 13 Jul 2000 18:04:19 GMT
From: "Ed Foy" <ed@nospam.com>
Subject: Re: Bizarre BEGIN block problem
Message-Id: <Dwnb5.63003$_b3.1836074@newsread1.prod.itd.earthlink.net>


pkay01@my-deja.com wrote in message <8kkl0e$g8t$1@nnrp1.deja.com>...
>
>Why not try using the CGI module, and let the CGI functions do the
>tricky stuff for you;
>
>  #! /usr/bin/perl -w
>
>  use CGI qw(:standard);
>
>  print
>    header,
>    start_html(-title=>'Example HTML Page'),
>    start_form,
>    h1("Enter text"),
>    p,
>    textfield(-name=>'whatever', -size=>50),
>    p,
>    hr,
>    submit(),
>    end_form,
>    end_html;


I fail to see how this remotely addresses the question I asked which was
why there is an apparently spurious syntax error message on compilation.
Further, the CGI module is stupendous overkill to simply print one line.
The sole purpose of the BEGIN block code is to redirect STDERR to
whatever browser is connected so that any messages which go to STDERR
can be viewed. It is simply a debugging tool. The code works, but
because of the reported syntax error, I'm wondering if this indicates
that there may be some other problem elsewhere. This looks like a bug so
I am trying to determine its extents and implications.

Ed




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

Date: 13 Jul 2000 16:39:46 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Can't dereference for AUTOLOAD
Message-Id: <8kkrci$ffv$1@pegasus.csx.cam.ac.uk>

Ala Qumsieh  <aqumsieh@hyperchip.com> wrote:
>
>Yep. Precedence problems. Change your line 3 to:
>
>	$objectRef->${\$arrayRef->[$i]}()

It's not actually a precedence problem  -  it's a restriction of Perl's
syntax that the method must be specified as a bareword or as a
*simple* scalar variable.    The rule is the same as what can be
inside <> to denote a filehandle.


Mike Guy


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

Date: 13 Jul 2000 16:55:19 GMT
From: karger@fermi2.chem.yale.edu
Subject: Re: Creating an ordered HoH
Message-Id: <8kks9n$1o7$2@news.ycc.yale.edu>

In comp.lang.perl.modules Michael Carman <mjcarman@home.com> wrote:
> Lauren Smith wrote:
>> 
>> Hashes are used for storage and naturally unordered.  What does it 
>> buy you to know the internal representation of your data?

> Normally nothing, but I have a situation where the order of keys is
> important. I create a HoHoL and later on I need to process it in the
> same order that it was created in.

Why not $foo{$bar}{"index"} = scalar(keys %foo); # after you create it

Then you can sort based on index.

Admittedly, this seems like kludgily turning a hash into a semi-array, but
that *is* sort of what you're asking to do.

-Amir Karger
karger@fermi2.chem.yale.edu


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

Date: 13 Jul 2000 16:13:52 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: decrypt perl code
Message-Id: <8kkps0$e5b$1@pegasus.csx.cam.ac.uk>

Bio Hazard  <bio.hazard@abc.de> wrote:
>Is there any way to get the real source code out of the perl
>executable itself?

There isn't a "perl executable".   Perl creates an internal structure
which it executes.

You might get some joy by using the B::Deparse module.
But of course you'll have lost comments and things.


Mike Guy


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

Date: Thu, 13 Jul 2000 16:42:03 GMT
From: sp00fD <sp00fD@yahoo.com>
Subject: detecting promiscuous mode
Message-Id: <8kkrgn$ljf$1@nnrp1.deja.com>

Can anyone tell me how I might go about using perl to discover if any
ethernet interfaces are in promiscuous mode (Solaris), without using
external programs (i.e. ifstatus and the like)??


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 13 Jul 2000 16:10:51 GMT
From: eryq@zeegee.com
Subject: Re: Email Attachments in Perl (no modules)
Message-Id: <8kkplq$k3p$1@nnrp1.deja.com>

In article <F4A464A67567D311AAF400C04F2A2CC6020F4E5B@grp-nt4.segin.com>,
  Dubreu Mathieu <mdubreu@atos-group.com> wrote:
> Is there any way to attach a file to a mail only with the SMTP package
?
> I have encoded a file in Base64, but the SMTP package put the file in
> the body of my mail.

You're just making life hard for yourself that way.
Use MIME::Lite to prepare the message; that's what it does well.
Then use Net::SMTP to send the message; that's what *it* does well.
:-)

MIME::Lite already has a hook in it to send_by_smtp(), using
Net::SMTP, by the way.  You can look at the code to see how I
do it and then implement something similar, or (if your
email addresses fit the description in the documentation)
you can use send_by_smtp() directly.

See documentation at: http://www.zeegee.com/code/perl/MIME-Lite


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 13 Jul 2000 16:30:36 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: File Handle Data size limits
Message-Id: <8kkqrc$f1a$1@pegasus.csx.cam.ac.uk>

In article <8k4s5b$p9h$1@nnrp1.deja.com>,  <timfi@my-deja.com> wrote:
>Is perl's File Handle data size limited to 32 bits?
>
>If so, how can you open files in perl that are greater than 2.1 gbytes?

perl5.6.0 supports large files (if the underlying platform supports
them).

Earlier versions of Perl do not.    Simple things *may* work, but it'll
all be a bit flaky.


Mike Guy


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

Date: Thu, 13 Jul 2000 16:10:42 +0100
From: "Graham Wood" <graham.wood@iona.com>
Subject: Re: File::Find example
Message-Id: <8kkmgb$4ka$1@bvweb.iona.com>

Thanks for all the replies, sarcastic or otherwise.  Who'd have thunk
'/foo','/bar' was telling me I needed to specify a path to search in.  I
thought they were options and hence optional.

I understand now.

Graham

Graham Wood <graham.wood@iona.com> wrote in message
news:8kkcif$31c$1@bvweb.iona.com...
> I've been writing heretical scripts using the Unix find command to list
all
> files below a specified directory and would like to become orthodox and
> start using perl modules to do it instead.
>
> I've read the perldoc File::Find entry but I think I missed something in
> there.
>
> Can someone show me a script that does the equivalent of just:
>     find * -print
> ie just find and list all the files, using the File::Find module?
>
> I tried:
>
> sub mine{
>     print;
> }
>
> with
> find(wanted=> \&mine);
> find(\&mine);
> find(mine);
>
> and various other wild guesses but nothing worked.
>
> Thanks in advance
>
> Graham Wood
>
>




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

Date: Thu, 13 Jul 2000 11:21:11 EDT
From: Arek@nospam.pietruszewski.com (Arek P)
Subject: Re: File::Find example
Message-Id: <8kkmp7$npj$1@earth.superlink.net>

On Thu, 13 Jul 2000 13:21:10 +0100, "Graham Wood"
<graham.wood@iona.com> wrote:

#! path to perl interpreter
use File::Find;

find(\&print_me, "$path_to_what_directory_to_look_in");


sub print_me

	{
	print "File  $_ resides in $File::Find::dir \n";
	}
HTH.
	ArekP

>I've been writing heretical scripts using the Unix find command to list all
>files below a specified directory and would like to become orthodox and
>start using perl modules to do it instead.
>
>I've read the perldoc File::Find entry but I think I missed something in
>there.
>
>Can someone show me a script that does the equivalent of just:
>    find * -print
>ie just find and list all the files, using the File::Find module?
>
>I tried:
>
>sub mine{
>    print;
>}
>
>with
>find(wanted=> \&mine);
>find(\&mine);
>find(mine);
>
>and various other wild guesses but nothing worked.
>
>Thanks in advance
>
>Graham Wood
>
>



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

Date: Thu, 13 Jul 2000 17:18:42 GMT
From: jhefferon@my-deja.com
Subject: Finding memory leak in a CGI::Fast script
Message-Id: <8kktks$nfo$1@nnrp1.deja.com>

Hello,

I have a memory leak in a long-running process (it runs under FastCGI).
I can see it leaking with top: the size or RSS goes up by 4 every
half-dozen times the script is hit.  But I'm stumped on finding it.

I've made all of the subroutine variables be my variables.  I've
scouted around for strings, etc., that might be growing, but no dice.
So I tried the Devel::Leak module.

  use Devel::Leak;
  my $count = Devel::Leak::NoteSV($handle);
  ..program initialization..
  while ($query=new CGI::Fast) {
    print "number now allocated=",Devel::Leak::CheckSV($handle),"\n";
    my $count = Devel::Leak::NoteSV($handle);
    ..process the CGI request..
  }

But it always gives me the same list of new's, followed by the
``number now allocated=13687'', always.  So I'm not seeing how the
program is growing.

Am I overlooking something about what this module is telling me, or,
is there some other way to see what I'm doing wrong?

Thanks, I appreciate any help.
Jim Hefferon


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 13 Jul 2000 17:04:35 GMT
From: mandbinc@rocketmail.com
Subject: From Dropdown to Variable - How To?
Message-Id: <8kksqi$mms$1@nnrp1.deja.com>

I have a HTML web page with a variable at the end of some text, say
$help.

On this SAME page there is a dropdown box where users can select
different text options.  I want to take the value they select and move
it to some TEXT on a different part of the SAME HTML page (take it to
the place where $help is).

Once a value is selected in the dropdown, I plan on calling a PERL file
that assigns the selected value to the variable $help (I think I can
figure this one out).

How do I then return that value (now assigned to $help) to the $help
variable in the TEXT on the SAME HTML page (with the SAME HTML file
name)?

Or if someone has a suggestion on an easier way to do this, please let
me know.

Thank you for your time.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 13 Jul 2000 09:03:27 -0700
From: Beta Version <playa786NOplSPAM@excite.com.invalid>
Subject: generating exe file from perl program
Message-Id: <075c87b0.49c5539d@usw-ex0105-035.remarq.com>

How can I generate a stand-alone program or exe file
from the Perl program I have written.

Basically, I want people who do not have Perl on their
system to be able to run my program.

Any info or leads would be appreciated.

Thank you
Nic




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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Thu, 13 Jul 2000 10:01:20 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: good free guestbook scripts needed...
Message-Id: <396DD9C0.68650D48@rac.ray.com>

kie wrote:
> 
> i need good but simple to install guestbook and form to email
> scripts. both must look like they have not been given for free
> (no banner ads, company names) and must be available for
> modification (fonts, images, etc)
> any ideas???

Yeah, write one.
-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Thu, 13 Jul 2000 18:07:14 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: good free guestbook scripts needed...
Message-Id: <v8qrmss6bjjr5aue4mt62aul61o8592fkh@4ax.com>

kie wrote:

>both must look like they have not been given for free

But it must be free, nevertheless? Gee...

-- 
	Bart.


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

Date: Thu, 13 Jul 2000 15:50:48 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Grabbing Multiple Occurances WITHOUT Being Greedy
Message-Id: <8kkomp$a48$1@news.mch.sbs.de>

In article <8kkkba$fmk$1@nnrp1.deja.com>, jcochett@my-deja.com wrote:
>I need to extract data that occurs multiple times from a line.
>
>Example of a line:
>P.CopyFile K(E(0),PD),K(Left(E(0),3)&D("QFDZDKFC"),D("NTQDZDKC-CBS"))
>
>What I am look for (Need both D functions on seperate line AND just the
>Arguments):
>D("QFDZDKFC")
>D("NTQDZDKC-CBS")
>
>The Result I need to print:
>QFDZDKFC
>NTQDZDKC-CBS
>
>Code #1:
>while (<FILEHANDLE>) {
>        if ( m/D\("(\S*?)"\)/g){
>                print OUTPUT "$1\n";    #OUTPUT is the file
>        }
>}
>
>The Result of #1 using Example Line:
>QFDZDKFC
>
[snip]

You're almost there :)
All you need is replace the if (m/.../g) with a while (m/.../g)
to loop through the different matches.

And you might want to replace the \S with a [^"] depending
on what your D arguments look like.

HTH,

Michel.


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

Date: Thu, 13 Jul 2000 17:02:21 GMT
From: jdaves@gilanet.com
Subject: Hash reverse lookups?
Message-Id: <8kksme$mlc$1@nnrp1.deja.com>

Hi, all. Is there an easy & elegent way to do reverse hash lookups, ie,
I want to know the key associated to a given value? What I'm doing now
is something like this:

%zips = ('87110','city1','87131','city2','88123','city3');

# Give the city with a given zip code
$zip_code = 87131;
$this_city = $zips{$zip_code};

# Give the zip code for a given city
foreach (keys %zips) {
  if ($this_city = $zips{$_} ) {
     $zip_code = $_;
     last;
  }
}

I'm sure there's gotta be a better way, but I've not found it in any of
the faqs or docs that I have.

Thanks. . .


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 13 Jul 2000 10:33:10 -0800
From: kenned57@pilot.msu.edu (Cameron Kennedy)
Subject: Re: Hash reverse lookups?
Message-Id: <kenned57-1307001033100001@alexthinkpad.salk.edu>

In article <8kksme$mlc$1@nnrp1.deja.com>, jdaves@gilanet.com wrote:

> Hi, all. Is there an easy & elegent way to do reverse hash lookups, ie,
> I want to know the key associated to a given value?


%b=reverse %a; 
keys for %a are now values for %b.

Cameron


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

Date: Thu, 13 Jul 2000 19:00:22 +0000
From: "Paul Taylor" <pap@sotonians.org.uk>
Subject: Re: Hash reverse lookups?
Message-Id: <Nvnb5.91$Mc2.10612@nnrp3.clara.net>


> %b=reverse %a; 
> keys for %a are now values for %b.

This is an excellent solution where your keys and values have a one to one
relationship.

If your hash values are not unique, you will lose some data when you do
the "reverse".

i.e.

%teamWins = ( manchester => 20, liverpool => 15, arsenal => 15 ) ;

%winTeams = reverse %teamWins ;

%winTeams should now have :-

  ( 20 => manchester, 15 => liverpool ) 

in it - effectively you've lost the fact that arsenal also had 15 wins.

If you have a situation where you have a one-to-many relationship,
you might want to consider implementing a solution where the hash's
value is a reference to a list.

Pap.


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

Date: Thu, 13 Jul 2000 17:32:50 GMT
From: richardstands@my-deja.com
Subject: Re: Help, no cgi push! what else is there?
Message-Id: <8kkug2$o3h$1@nnrp1.deja.com>

Hey, thanks for the reply! I don't know how I overlooked system() ;o) I
gave it a try and it turns out that Apache server makes the first
script call wait until the "child" script returns before returning
itself which has been my problem all along. However, Microsoft IIS
*will* return immediately after spawning the "child" script using sytem
() so my problem is solved! Yay!!! and thanks.

There may still be a way to configure Apache to have the same behavior
but I probably won't pursue it unless I think we will use it more(I
just use it for testing on my workstation).

Cheers!

-Rich

In article <o1krmssu0vjs41stdicuvlnvcjdluh84d9@4ax.com>,
  Bart Lateur <bart.lateur@skynet.be> wrote:
> richardstands@my-deja.com wrote:
>
> >I know how to do this
> >on Unix/Apache with "fork()" but, unfortunately, I am stuck on
Windows
> >NT Server with IIS.
>
> Ah. Poor you.
>
> Try running a separate script with system().
>
> --
> 	Bart.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 13 Jul 2000 15:14:04 GMT
From: wb5agz@dc.cis.okstate.edu (Martin McCormick)
Subject: Help, Please in Interpreting Syntax
Message-Id: <01lb5.1$Wc5.99@news.onenet.net>


	I need some help interpreting an expression in a perl script
that I am modifying.  This script analyses the start of authority or
SOA record used in domain name servers to make sure it is good.  Well,
the rules have changed so I need to change the game just a bit.

	The present routine simply copies all lines beginning with a ;
from the source file to several other files.  This allows one to have
comments in the name server data base before any actual information is
found.

	I now need to add a name server directive which looks like:

$ttl 86400

	The script sees this rightly as corruption and, as designed,
errors out.

	I am trying to modify it enough to allow for this line, but
not totally destroy the testing.

	I see perl scripts about once every 6 months so I freely admit
to not knowing as much as I should about this.

	The portion of the script I need to change reads as follows
with my interpretation of what I think its doing.


sub update_serial {
local($i);
print "\nUpdating the serial number in the source file...\n" if $chatty;
open(SOURCE, "+<$source_file") ||
  &give_up("unable to open $source_file for read/write (to update serial)");

#Do that if the file wouldn't open.

# Check out the first line as the start of the SOA data. Skip any
# prior comments, counting them so that we know how many lines to
# copy when copying the SOA data.

for (;;)

#I think that is just the start of the copy loop.

  {
  $_ = <SOURCE>;

#This appears to be the counter that keeps track of where the comments
#end.
  last if (!/^\s*$/ && !/^\s*;/);

#This appears to look for blank lines and lines that start with ; so I
#thought,  "Why not lines that start with $?"

  $soa_count++;
#Incriment the counter.
  }

	That appears to be the tester.  I tried:

for (;;)
  {
  $_ = <SOURCE>;
  last if (!/^\s*$/ && !/^\s*;/ && !/^\s*\$/);
  $soa_count++;
  }

and it had absolutely no effect at all.  It didn't even break things.

	I figure if I make the lines that start with $ look like
comments, they should just get included along with blank lines and
lines starting with ; as comments.

	This is not the best solution in the world, but it should
allow this change.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Center for Computing and Information Services Data Communications Group

	Thank you for looking at this.


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 3652
**************************************


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