[16988] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4400 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 21 21:05:24 2000

Date: Thu, 21 Sep 2000 18:05:07 -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: <969584707-v9-i4400@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 21 Sep 2000     Volume: 9 Number: 4400

Today's topics:
    Re: Accessing Objects in an array <mike_hopkins_us@yahoo.kom>
    Re: Accessing Objects in an array <jeff@vpservices.com>
        Announce: Crypt::Random 0.23 (Vipul Ved Prakash)
        ANNOUNCE: MIME-tools 5.316 uploaded to CPAN eryq@zeegee.com
        Auto-Execute Perl in HTML ??? <maureen927@my-deja.com>
    Re: Auto-Execute Perl in HTML ??? <mtaylorlrim@my-deja.com>
    Re: Candidate for the top ten perl mistakes list (Martien Verbruggen)
    Re: Candidate for the top ten perl mistakes list <flavell@mail.cern.ch>
    Re: Candidate for the top ten perl mistakes list (Craig Berry)
    Re: Candidate for the top ten perl mistakes list <kevin@vailstar.com>
    Re: deamonize <philipg@atl.mediaone.net>
        Hash creation idiom. (Arthur Darren Dunham)
    Re: literal substitution (Craig Berry)
    Re: Newbie - averages... <lr@hpl.hp.com>
    Re: Newbie - averages... (Craig Berry)
        newbie question <Marvinas@Takas.lt>
    Re: newbie question <jeffp@crusoe.net>
    Re: newbie question (Craig Berry)
    Re: newbie question <lr@hpl.hp.com>
    Re: newbie question (Richard J. Rauenzahn)
        OT (again!) English grammar (Was: Re: Candidate for the <lr@hpl.hp.com>
    Re: Perl CGI & Windows 98 (Tim Hammerquist)
    Re: Portability of Perl/Tk programs? (Clinton A. Pierce)
    Re: Portability of Perl/Tk programs? (Tim Hammerquist)
    Re: Set Cookie and Redirect at same time ??? <brondsem@my-deja.com>
    Re: Tricky Problem (Chris Fedde)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 21 Sep 2000 23:45:29 GMT
From: "Mike Hopkins" <mike_hopkins_us@yahoo.kom>
Subject: Re: Accessing Objects in an array
Message-Id: <t4xy5.12161$nk3.573219@newsread03.prod.itd.earthlink.net>


>
> > I am not sure how to do this.  I am using CGI.pm and have put several
CGI
> > objects into an array.
> > I can not figure out how to access a specific object's function in the
> > array.
> >
> >
> >
> > Doing this does not work :
> >   print $objectArray[2]->param('item'); #Can any one tell me how to do
> >   this?
> >
> >  This does work to loop threw all:
> >  foreach $obj (@objectArray)
> >     {
> >       print  $obj->param('item');
> >     }
> >
> > I just cant find the syntax to get to a specific element.
> >
> >
>
> perldoc perlref
>
> -anders

thanks for the tip I read the perldoc But I guess I am still to dumb to
figure it out.  Can any one that knows
how to do this please shot me a couple lines of code so I can better
understand how to get this done.
Thanks




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

Date: Thu, 21 Sep 2000 17:14:11 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Accessing Objects in an array
Message-Id: <39CAA453.B3F490EF@vpservices.com>

Anders Lund wrote:
> 
> Mike Hopkins wrote:
> 
> > I am not sure how to do this.  I am using CGI.pm and have put several CGI
> > objects into an array.
> > I can not figure out how to access a specific object function in the
> > array.
> >
> > Doing this does not work :
> >   print $objectArray[2]->param('item'); #Can any one tell me how to do
> >   this?
> >
> >  This does work to loop threw all:
> >  foreach $obj (@objectArray)
> >     {
> >       print  $obj->param('item');
> >     }
> >
> > I just cant find the syntax to get to a specific element.
> 
> perldoc perlref

Why perlref?  There are no references in that code.  There is a plain
array (not a reference to an array) that contains a series of objects. 
In fact, I can't see any problem in Mike's code.  This works for me
using the same constructs that Mike used (prints 1324):

use CGI;
my @objectArray = (
     new CGI({a=>1,b=>2}),
     new CGI({a=>3,b=>4}),
);
foreach my $obj(@objectArray) {
    print $obj->param('a') 
}
print 
    $objectArray[0]->param('b'),
    $objectArray[1]->param('b'),
;

Mike, what do you mean when you say your code "doesn't work"?  Are you
sure there are at least 3 CGI objects (since you are referencing the
third one with $objectArray[2]) and that the third object has a
parameter "item"?

-- 
Jeff


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

Date: 21 Sep 2000 06:31:44 GMT
From: vipul@shell2.ba.best.com (Vipul Ved Prakash)
Subject: Announce: Crypt::Random 0.23
Message-Id: <ssla33nv3ekd75@corp.supernews.com>

Crypt::Random 0.23 has been uploaded to CPAN.
---------------------------------------------

Crypt::Random is a perl interface module to /dev/u?random devices found on
most modern Unix systems.

It provides two methods:

makerandom() - generates a random number of specified bitsize.
makerandom_itv() - generates a random number (uniformally distributed)
                   in the specified interval.

Changes
-------

0.23 fixes a bug that would cause Math::Pari to segfault under certain
conditions.

best,
vipul.




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

Date: Thu, 21 Sep 2000 06:47:10 GMT
From: eryq@zeegee.com
Subject: ANNOUNCE: MIME-tools 5.316 uploaded to CPAN
Message-Id: <ssla2s17nj1v71@corp.supernews.com>

MIME-tools is a collection of Perl5 MIME:: modules for parsing,
decoding, and generating single- or multipart (even nested multipart)
MIME messages.  (Yes, kids, that means you can send messages with
attached GIF files).


SHOULD YOU UPGRADE?

If you're using MIME-tools 5.312 or earlier, I *strongly*
suggest upgrading to 5.316.  The path from 4.x (and early 5.x)
to 5.316 is fairly easy so long as you convert over to the
new $parser->filer() mechanism for specifying where the
extracted files should go.


STILL TO DO

The reports are in, and 5.x appears to be stable at this point.
There are still a couple of improvements I plan to make to the
parser so that it is more "intelligent", but nothing is keeping
me up nights, except maybe for the handling of different
character sets inside MIME headers.

If anyone has any PGP or S/MIME "war stories" related to MIME-tools
(and how it did or did NOT work for you), I'd love to hear
them.  I love patches even more.


MORE INFO

Go to http://www.zeegee.com/code/perl/MIME-tools
for more info.


Happy hacking,

Eryq


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




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

Date: Thu, 21 Sep 2000 22:53:40 GMT
From: maureen <maureen927@my-deja.com>
Subject: Auto-Execute Perl in HTML ???
Message-Id: <8qe3ha$eh$1@nnrp1.deja.com>

Hi:
  I have a perl script that executes successfully when
executed via a hyperlink from a webpage. The script
generates another webpage.

  I'd like to know how/if I can reference this script (which
will be altered) in my html document so that as the html
is rendering, the script executes and creates more html in
the same html document and then the rest of the html is rendered.

  I just can seem to find the correct syntax for this.
It will be on a UNIX server.

                             Thanks...!


                                   Maureen


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


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

Date: Thu, 21 Sep 2000 23:43:41 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: Auto-Execute Perl in HTML ???
Message-Id: <8qe6f9$3rv$1@nnrp1.deja.com>

let's see if I can remember the syntax...

Change your html file to  filname.shtml

then where you want the cgi to run add the line...

<!--#exec cgi="path/to/sctipt" -->

I think that is right...


Mark




In article <8qe3ha$eh$1@nnrp1.deja.com>,
  maureen <maureen927@my-deja.com> wrote:
> Hi:
>   I have a perl script that executes successfully when
> executed via a hyperlink from a webpage. The script
> generates another webpage.
>
>   I'd like to know how/if I can reference this script (which
> will be altered) in my html document so that as the html
> is rendering, the script executes and creates more html in
> the same html document and then the rest of the html is rendered.
>
>   I just can seem to find the correct syntax for this.
> It will be on a UNIX server.
>
>                              Thanks...!
>
>                                    Maureen
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


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


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

Date: Thu, 21 Sep 2000 22:17:49 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <slrn8sl286.m9.mgjv@verbruggen.comdyn.com.au>

On Wed, 20 Sep 2000 12:12:19 -0500,
	Russ Jones <russ_jones@rac.ray.com> wrote:
> Abigail wrote:
> > 
> > Russ Jones (russ_jones@rac.ray.com) wrote on MMDLXXVII September MCMXCIII
> > in <URL:news:39C8DD4C.2FD4B394@rac.ray.com>:
> 
> > || Seldomly?
> > 
> > How often do you see a program here where the cause of something not
> > working was the use of @array[$index] vs $array[$index]?
> > 
> 
> How often have you seen the word "seldomly?" 

Hmm.. English isn't my first language, which is probably why to me
'seldomly' sounds more correct (in the context given before) than
'seldom'. I have the same problem with 'doubtless', which I keep
adverbifying to 'doubtlessly', resulting in slaps on the wrist from
language purists.

And I still think that I am right, and English grammar is simply
wrong.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.   | cynical. It's perfectly easy to be
NSW, Australia                  | cynical.


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

Date: Fri, 22 Sep 2000 00:40:57 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <Pine.GHP.4.21.0009220037260.24906-100000@hpplus03.cern.ch>

On Thu, 21 Sep 2000, Martien Verbruggen wrote:

> And I still think that I am right, and English grammar is simply
> wrong.

na sowas.  Do you still believe that English has grammar?

Most native users of the language seem (sadly) to think otherwise.

(Having gone to a "grammar school", I'm obviously biased)



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

Date: Thu, 21 Sep 2000 23:52:45 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <ssl7qdi0fc030a@corp.supernews.com>

Alan J. Flavell (flavell@mail.cern.ch) wrote:
: Most native users of the language seem (sadly) to think otherwise.

Right we darn you're do!

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


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

Date: Thu, 21 Sep 2000 20:23:02 -0400
From: Kevin Michael Vail <kevin@vailstar.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <kevin-61B727.20230221092000@news.his.com>

In article <ssl7qdi0fc030a@corp.supernews.com>, cberry@cinenet.net 
(Craig Berry) wrote:

> Alan J. Flavell (flavell@mail.cern.ch) wrote:
> : Most native users of the language seem (sadly) to think otherwise.
> 
> Right we darn you're do!

The scary thing is that made sense to me!
-- 
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vailstar.com | blazing high above your head.
 . . . . . . . . .  | But _in_ you is the presence that
 . . . . . . . . . | will be, when all the stars are dead.  (Rainer Maria Rilke)


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

Date: Fri, 22 Sep 2000 00:55:24 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: deamonize
Message-Id: <06yy5.1365$2z2.706271@typhoon.southeast.rr.com>

Neb <berube@odyssee.net> wrote in message
news:8_sy5.226$hs2.10675@news.globetrotter.net...
> hi,
>
> I got some problem deamonizing a process (child become dissociated from
> parent) on Unix.  I read "perlipc" and I wrote to this news group but I
> can't make it work yet.

What flavor of Unix?  The script works as expected on my Linux machine.

p




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

Date: 22 Sep 2000 01:03:14 GMT
From: add@netcom.com (Arthur Darren Dunham)
Subject: Hash creation idiom.
Message-Id: <8qeb4i$bpl$1@slb1.atl.mindspring.net>

I'm going to look up whether a particular item is present in my program,
so I set the items to be keys of a hash.  Is there any general idiom to
do this?

# pedantic.  (not useful if data is passed in as array)
%items = ( red => 1,
	   rose => 1,
	   chair => 1,
	 );

# array and x
@items = qw ( red rose chair )
@items{@items} = ( 1 x scalar(@items));

# array and map
@items = qw ( red rose chair )
@items{@items} = map { 1 } @items;

# foreach
@items = qw ( red rose chair )
foreach ( @items )
{ $items{$_} = 1; }

Thanks!


--
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                               San Francisco Bay Area
      < Please move on, ...nothing to see here,  please disperse >


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

Date: Thu, 21 Sep 2000 23:10:29 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: literal substitution
Message-Id: <ssl5b5arms838f@corp.supernews.com>

derf_up@yahoo.com wrote:
: I would like to create a series of arrays, (probably using a for loop
: and $counter++) (i.e. @array1, @array2, @array3, etc…).  I have always
: called this a "literal substitution", but someone else called it
: a "symbolic reference".

Someone else is correct. :)

: In either case in not seeing how to do this in any of the O'Reilly
: books (Camel, Lama, Ram, or Puma).  Maybe it's called something else?

You really really don't want to do this -- why not use an array of arrays?
-- only you say you really do want to do this.  Okay, here goes, but
again, don't do this.


: for ($counter = 0; $counter <100; $counter++) {
: 	@array???$counter???
: }

        @{"array$counter"} = ($counter) x 3;   # Value just as example

A more perlish way to write it is

  @{"array$_"} = ($_) x 3 foreach (0..99);

Note in each case I've used a list of three copies of the current index as
an example initial value.

Now, once again:  Don't do this. :)

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


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

Date: Thu, 21 Sep 2000 15:25:05 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie - averages...
Message-Id: <MPG.14342a9776ac4daf98adaa@nntp.hpl.hp.com>

In article <gJuy5.3324$kY3.251797@news.uswest.net> on Thu, 21 Sep 2000 
14:04:21 -0700, Christopher M. Jones <christopher_j@uswest.net> says...
> # sans Perl magic mojo (mostly):
> 
> sub average()

You specify a subroutine without arguments, then give it a list of 
arguments!  This would cause a compilation error, if you ever bothered 
to run the code.

>     {
>     my $sum, $n;

As already observed by Randal Schwartz.

>     foreach (@_)
>         { $sum += $_; $n++; }
>     return $sum / $n;

Using the scalar value of @_ seems a lot more appropriate than using 
this counter $n.

>     }
> 
> 
> # Then,
> 
> my $file, @file;

But Randal missed that one.

> open (FILE, "<file.blah");

Where is the test for failure?

>     {
>     local $/ = '';

Just use:

      local $/;

>     $file = <FILE>;
>     }
> close (FILE};
> 
> @file = split(/\n/, $file);

Isn't it absurd to slurp the file as a scalar, then split it into lines, 
instead of just reading the lines into a list?

> chomp @file;

The above isn't needed, because "\n" (or any whitespace) is accepted as 
the end of the number-string input without complaint.

> my $average = average(@file);

Or replace all of the above stuff by just:

  my $average = average(<FILE>);

Please, in the future, post code without syntax errors, at least proving 
that it has been compiled, let alone executed with meaningful test data.

# sans Perl magic mojo (completely):

#!/usr/bin/perl -wl
use strict;

sub average {
    my $sum;
    $sum += $_ for @_;
    @_ ? $sum/@_ : undef
}

print average(<DATA>);
__END__
1
2
3
4
5

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


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

Date: Thu, 21 Sep 2000 23:29:43 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Newbie - averages...
Message-Id: <ssl6f7c2bdc451@corp.supernews.com>

Christopher M. Jones (christopher_j@uswest.net) wrote:
: # sans Perl magic mojo (mostly):
: 
: sub average()
:     {
:     my $sum, $n;
:     foreach (@_)
:         { $sum += $_; $n++; }
:     return $sum / $n;
:     }

Unmojoficated, but more Perlish IMHO:

  sub average {
    my $sum = 0;
    $sum += $_ foreach @_;
    return $sum / @_;
  }

: my $file, @file;
: open (FILE, "<file.blah");

Never ever ever do open() without testing its success.

:     {
:     local $/ = '';
:     $file = <FILE>;
:     }
: close (FILE};
: 
: @file = split(/\n/, $file);

Isn't that rather a lot of work to do the same thing as

  @file = <FILE>;

?

: chomp @file;

You can even combine these as

  chomp(@file = <FILE>);

which is a very useful idiom.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


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

Date: Fri, 22 Sep 2000 01:19:03 +0200
From: "Marvinas" <Marvinas@Takas.lt>
Subject: newbie question
Message-Id: <39ca976f@news.takas.lt>


    Hello,

Is there a function in Perl for translation from string to integer and
otherwise? I have $int="23" and I want $int=23.

    Thanks
--

  Tokios, kaip tu, nebuvo, nera ir nereikia.




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

Date: Thu, 21 Sep 2000 19:52:40 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: newbie question
Message-Id: <Pine.GSO.4.21.0009211952030.18425-100000@crusoe.crusoe.net>

[posted & mailed]

On Sep 22, Marvinas said:

>Is there a function in Perl for translation from string to integer and
>otherwise? I have $int="23" and I want $int=23.

Have you tried just USING the variable as a number?

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



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

Date: Thu, 21 Sep 2000 23:59:35 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: newbie question
Message-Id: <ssl8775ec5v4c2@corp.supernews.com>

Marvinas (Marvinas@Takas.lt) wrote:
: Is there a function in Perl for translation from string to integer and
: otherwise? I have $int="23" and I want $int=23.

Perl scalars automagically behave as strings where a string is expected,
and as numbers where a number is expected.  There's no need to do an
explicit conversion.

  $int = "23";
  print $int + 2, ' ', $int . 'foo', "\n";

Output:

  25 23foo

This takes a bit of getting used to if you're coming from a strongly-typed
language, but it's incredibly intuitive and useful once you climb the
learning curve.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


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

Date: Thu, 21 Sep 2000 17:15:53 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: newbie question
Message-Id: <MPG.1434448d8640198598adac@nntp.hpl.hp.com>

In article <Pine.GSO.4.21.0009211952030.18425-100000@crusoe.crusoe.net>, 
jeffp@crusoe.net says...
> On Sep 22, Marvinas said:
> 
> >Is there a function in Perl for translation from string to integer and
> >otherwise? I have $int="23" and I want $int=23.
> 
> Have you tried just USING the variable as a number?

That concept is quite counter-intuitive to anyone who has used a typed 
language such as C and has had to face functions like atoi() and atof() 
all the time.

I wonder if introductory tutorials make enough about this 
remarkable capability of Perl to morph strings to numbers and back 
essentially on demand.

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


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

Date: 22 Sep 2000 00:29:09 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: newbie question
Message-Id: <969582548.720698@hpvablab.cup.hp.com>



Read the perldata man page -- in particular the short section on "Scalar
values".

After reading that, you should be able to figure out why the following
code is quite silly:

my %nums = ( "1" => 1, "2" => 2, "3" => 3, "4" => 4, "5" => 5, "6" => 6,
 "7" => 7, "8" => 8, "9" => 9, "0" => 0 );

my $in = "12345";
my $out = 0;

foreach(split(//, $in)) {
   $out *= "10";
   $out += $nums{$_};
}

print "\"$in\" -> $out\n";

"Marvinas" <Marvinas@Takas.lt> writes:
>
>    Hello,
>
>Is there a function in Perl for translation from string to integer and
>otherwise? I have $int="23" and I want $int=23.
>
>    Thanks
>--
>
>  Tokios, kaip tu, nebuvo, nera ir nereikia.
>
>


-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Thu, 21 Sep 2000 15:47:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: OT (again!) English grammar (Was: Re: Candidate for the top ten perl mistakes list)
Message-Id: <MPG.14342fcdec6ee9098adab@nntp.hpl.hp.com>

In article <slrn8sl286.m9.mgjv@verbruggen.comdyn.com.au> on Thu, 21 Sep 
2000 22:17:49 GMT, Martien Verbruggen <mgjv@verbruggen.comdyn.com.au> 
says...
> On Wed, 20 Sep 2000 12:12:19 -0500,
> 	Russ Jones <russ_jones@rac.ray.com> wrote:
> > Abigail wrote:
> > > Russ Jones (russ_jones@rac.ray.com) wrote on MMDLXXVII September MCMXCIII
> > > in <URL:news:39C8DD4C.2FD4B394@rac.ray.com>:
> > > || Seldomly?
> > > 
> > > How often do you see a program here where the cause of something not
> > > working was the use of @array[$index] vs $array[$index]?
> > 
> > How often have you seen the word "seldomly?" 
> 
> Hmm.. English isn't my first language, which is probably why to me
> 'seldomly' sounds more correct (in the context given before) than
> 'seldom'. I have the same problem with 'doubtless', which I keep
> adverbifying to 'doubtlessly', resulting in slaps on the wrist from
> language purists.

No.  Your colleagues are wrong.  From http://www.m-w.com:

Main Entry: 2 doubtless
                     Function: adjective
                     Date: 14th century
                     : free from doubt : CERTAIN
                     - doubt·less·ly adverb
                     - doubt·less·ness noun 

> And I still think that I am right, and English grammar is simply
> wrong.

Well, this may be less off-topic than 'green and gold', but anyway...

English grammar is never 'wrong' -- it's human, hence inconsistent.

<Somewhat more on-topic>
Perl grammar isn't a model of consistency either, is it?
<Off-topic again>

I once naively asked my native-speaker Russian teacher why such-and-such 
was said a particular way.  He responded, "Because that's the way the 
first Russian said it!"  I was no longer naive, and never asked that 
kind of question again.

To the point:  The 'ly' suffix is used to create an adverb from an 
adjective.  But for many adverbs, there is no adjective form to derive 
from.

frequent -> frequently
???      -> often
rare     -> rarely
???      -> seldom

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


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

Date: Thu, 21 Sep 2000 21:56:18 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Perl CGI & Windows 98
Message-Id: <slrn8sl1p4.p6.tim@degree.ath.cx>

Richard Bessler <rbessler@att.net> wrote:
>           I'm running from my home Windows 98 (with ActiveState's PERL =
> loaded on it), and is it at all possible for me to set up my system so I =
> can run CGI scripts (through browser) locally (for free :-))? I'd =
> appreciate any assistence on this, and if I need something, could you =
> point me to the right direction?=20

http://www.apache.org
	or better yet:
http://perl.apache.org

Pre-compiled binaries, with and without mod_perl, are available via
links at those sites.

Microsoft's Personal Web Server (or Peer Web Services, in on NT; either
way, it's PWS) is freely available from _somewhere_ on Microsoft's site,
but if you've ever tried to find something specific on a RedmondWare
site, you'll be running very, very fast in the opposite direction.

There are other servers available, and I've heard some good things about
OmniHttpd.  Is Omni available for *nix?  No?!  So much for that. =)

Apache is universal and highly configurable.  There are also several
front-ends available to Apache's httpd.conf file, some GUI.

Of course, I have a funny feeling I'm biased.  Make your own decision.
=)

-- 
-Tim Hammerquist <timmy@cpan.org>

Life is too serious to be taken seriously.
	-- Mike Leonard


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

Date: Thu, 21 Sep 2000 23:25:53 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Portability of Perl/Tk programs?
Message-Id: <5Owy5.4777$hD4.890565@news1.rdc1.mi.home.com>

[Posted and mailed]
[Trimmed, it doesn't belong in .modules]

In article <slrn8sl0mr.p6.tim@degree.ath.cx>,
	tim@degree.ath.cx (Tim Hammerquist) writes:
> Clinton A. Pierce <clintp@geeksalad.org> wrote:
>>David Steuber <nospam@david-steuber.com> writes:
>> > I'm considering using Perl/Tk for an application that will use a GUI
>> > [...]
>> > I already know that there is no fork in Windows.
>> 
>> Bzzzt.  Wrong.  Has been since 5.6. 
> 
> I haven't been keeping up on the progress, and I know ActiveState's perl
> 5.6 was bug-ridden, notably in its fork() implementation.  

This is news to me, and I've been all over the fork() in ActiveState's 
distribution of Perl.  fork() works, if you understand its limitations.
The only real bug I'm aware of is if you run out of threads, perl panics.
(And I patched that.  See 5.7.x or 5.6.1 when it's a reality.)

> Most 5.6
> success stories involved a custom build without fork().  Have they made
> progress in this?

What are you expecting fork() to do that it's not?  I know that you can 
still trip up Win32 Perl if you've got forked "processes" and one blocks
on a resource that's precious to windows that the whole shebang can hang--
but that's a Windows problem, unrelated to fork...

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Thu, 21 Sep 2000 23:48:43 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Portability of Perl/Tk programs?
Message-Id: <slrn8sl8bs.p6.tim@degree.ath.cx>

Clinton A. Pierce <clintp@geeksalad.org> wrote:
> Tim Hammerquist wrote:
> > Most 5.6
> > success stories involved a custom build without fork().  Have they made
> > progress in this?
> 
> What are you expecting fork() to do that it's not?  I know that you can 
> still trip up Win32 Perl if you've got forked "processes" and one blocks
> on a resource that's precious to windows that the whole shebang can hang--
> but that's a Windows problem, unrelated to fork...

I'm not expecting it to do anything.  I haven't even booted up my Win32
partition for anything except Tomb Raider 4 in months.  My impression
came from the inordinate amount of "problem with fork" posts on
ActiveState's Perl-Win32-* lists.

-- 
-Tim Hammerquist <timmy@cpan.org>

My life has a superb cast but I can't figure out the plot.
	-- Ashleigh Brilliant


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

Date: Fri, 22 Sep 2000 00:40:27 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: Set Cookie and Redirect at same time ???
Message-Id: <8qe9po$7uj$1@nnrp1.deja.com>

In article <8qdufj$1l3$1@news.inet.tele.dk>,
  "Papyros Brandmand" <Papyros@hp23c.ipt.dtu.dk> wrote:
> Can someone help here...
>
> i'am trying på make some CGI (Not that good to perl)...
>
> I need to set a cookie and Redirect to another site at the same
time...
> Put i can only do one of the thing... only one of them will work ???

You are probably using the CGI module to print out the headers.  I am
not familiar with that, but you can print the headers yourself:

print "Set-Cookie: acceptcookies=yes; expires Fri, 01-Jan-2010 13:46:00
GMT\n";
print "Location: index.htm\n\n";



>
> Please help me....
>
> Papyros
>
>

--
Dave Brondsema


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


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

Date: Thu, 21 Sep 2000 23:52:20 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: Tricky Problem
Message-Id: <Uaxy5.318$W3.189932544@news.frii.net>

In article <8qdmt7$gmu$1@nnrp1.deja.com>,  <rathmore@tierceron.com> wrote:
>Problem: My Perl program reviews a directory once an hour to see if a
>file exists in that directory. If the file exists the program runs, if
>not it does nothing. However, if 2 hours go buy without a file being
>found in that directory, the program emails me.
>

Let me describe an approach that I might take for this.  I'd  plan
to run it out of cron. Maybe several times per hour. That way the
worst case delay is minimized. Since it is not a daemon the program
won't suffer from common problems with long running programs such
as memory bloat and unexpected demise, but it has to store it's
state data externally. I'd use a sentinel file for that.

You could use the mtime of the sentinel file to store your timestamp.
Perl has a utime() function that lets you set the mtime (and atime
too), it also has the stat() function that lets you read these file
attributes.  You can also use a lock on the sentinel file to enforce
access serialization.

Just as a thought, there might be some simplification of the algorithm
if you set the file mtime into the future.

While it is an interesting problem it really doesn't have a lot to
do with Perl.  Your solution will have as much to do with the
platform it runs on as with the implementation language.

good luck
chris
-- 
    This space intentionally left blank


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

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


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