[18861] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1029 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 31 14:10:47 2001

Date: Thu, 31 May 2001 11:10:17 -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: <991332617-v10-i1029@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 31 May 2001     Volume: 10 Number: 1029

Today's topics:
    Re: perl and Informix <tom@sqlman.com>
        perl for statistics analysis? (jianxin)
    Re: Perl request nobull@mail.com
    Re: Perl script error during testing <buggs@geekmail.de>
    Re: Perl script error during testing <lmoran@wtsg.com>
    Re: Perl script error during testing <sloon@mindless.com>
    Re: Perl script error during testing <sloon@mindless.com>
    Re: Reading binary data (method and style)? nobull@mail.com
    Re: Reading from strings... nobull@mail.com
    Re: Regexp problem (Mr. Green)
    Re: Regexp problem (Bernard El-Hagin)
    Re: Regexp problem (Bernard El-Hagin)
    Re: Rounding <peb@bms.umist.ac.uk>
    Re: Rounding (Anno Siegel)
    Re: Rounding <peb@bms.umist.ac.uk>
    Re: Rounding (Anno Siegel)
    Re: Server push and $|? <bcoon@sequenom.com>
    Re: Silly pipe() question nobull@mail.com
    Re: Statistics for comp.lang.perl.misc <flavell@mail.cern.ch>
        Time difference including hundreths of seconds <dennis.kowalsk@daytonoh.ncr.com>
    Re: udp ping socket problem nobull@mail.com
    Re: Unsure about headers (Tad McClellan)
        Upgrade from Activeperl 620 to 626 on a Microsoft box (Luca)
    Re: Upgrade from Activeperl 620 to 626 on a Microsoft b <07950232225@one2one.net>
    Re: vestale.pl ascii animation (Alain)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 31 May 2001 07:05:21 -0700
From: Tom Grenier <tom@sqlman.com>
Subject: Re: perl and Informix
Message-Id: <3B164FA1.54F814FF@sqlman.com>

If you want to do some serious computing this is true.  However, if you just
want to do some down and dirty processing (or all of the following is not
available to you, which was my case with my previous employer) you can feed a
dbaccess command line into an array -- e.g.:

@ifmx_output = `dbaccess - an_sql_file`;

Not as clean -- you have to do some manipulating of the @ifmx_output array to
extract the data you want -- but all in all it works well.

Tom

"Laszlo G. Szijarto" wrote:

> you'll need the following elements -- installed in this order
>
> Informix (installed somewhere)
> ESQL/C 5.00 or later or Cleint SDK 2.00 or later (required by
> DBD-Informix-1.00.PC1) installed on the client
> PERL 5.004 or later (required by DBD-Informix-1.00.PC1 and 5.004_04
> recommended by DBI-1.15) on client
> DBI-1.15 (generic database functionality for PERL) on client
> DBD-Informix-1.00.PC1 (Informix-specific database drivers -- works in
> conjunction with DBI) on client
>
> to connect to remote clients, you'll need to make appropriate entries in
> sqlhosts and have the corresponding /etc/services entry -- now, this last
> part I've only done on Linux and not on Windows at all, but, to answer your
> question, yes, you need DBI and DBD-Informix.
>
> Laszlo



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

Date: 31 May 2001 10:11:58 -0700
From: guojx@yahoo.com (jianxin)
Subject: perl for statistics analysis?
Message-Id: <8b625622.0105310911.30b3dc9f@posting.google.com>

does anyone has perl code for doing statistics analysis,such as PCA, PLS, etc.


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

Date: 31 May 2001 17:57:06 +0100
From: nobull@mail.com
Subject: Re: Perl request
Message-Id: <u9d78pa23h.fsf@wcl-l.bham.ac.uk>

Philip Newton <pne-news-20010531@newton.digitalspace.net> writes:

> On 30 May 2001 19:31:17 +0100, nobull@mail.com wrote:
> 
> > If this were Unix I'd say to do it in shell:
> > 
> > cd /another/directory; rm `cd /one/directory; echo *`
> 
> Would this work for files with spaces in their names?

No, obviously it won't.  But that's OK for what the OP wanted.

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


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

Date: Thu, 31 May 2001 18:50:57 +0200
From: buggs <buggs@geekmail.de>
Subject: Re: Perl script error during testing
Message-Id: <9f5slq$6nf$03$1@news.t-online.com>

sloon wrote:

> Oh please....get a life....

You chose yours, we chose ours.

> I'm an adult, and an intelligent one, and I find your comments
> childish and rude.

Why don't you use your intelligence?

> Why you try and blame your lack of manners on me is a mystery...why
> you don't let this thread just die is a bigger mystery.

Idealistic believe in human race.

Buggs



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

Date: Thu, 31 May 2001 13:02:15 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Perl script error during testing
Message-Id: <grtchtc8rhdnqlb0eappr3jugr26qvb0ru@4ax.com>

On Wed, 30 May 2001 14:08:02 GMT, sloon <sloon@mindless.com> wrote
wonderful things about sparkplugs:

>I would like to thank all of the individuals who replied with helpful
>suggestions. I've found that by shutting down my computer and
>restarting it, I avoid the problem as I reset my IP. I had never
>encountered this sort of thing before. 
SNIP
Aside from being really obnoxious and more than a little confused
about programming you're even more confused about your OS.  I strongly
suggest you Read The Fantastic Manuals that are available for all of
your computing needs and post no more.  Look deeper into your reboot
issue as well your logic is flawed (deeply.) 
--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com


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

Date: Thu, 31 May 2001 17:46:54 GMT
From: sloon <sloon@mindless.com>
Subject: Re: Perl script error during testing
Message-Id: <uo0dht0kl1j936a459drp67bo1la3rntrj@4ax.com>

What have I said that indicates confusion about programming?

Actually, I tried what you suggested earlier and it worked, Thank's.

On Thu, 31 May 2001 13:02:15 -0400, Lou Moran <lmoran@wtsg.com> wrote:

>On Wed, 30 May 2001 14:08:02 GMT, sloon <sloon@mindless.com> wrote
>wonderful things about sparkplugs:
>
>>I would like to thank all of the individuals who replied with helpful
>>suggestions. I've found that by shutting down my computer and
>>restarting it, I avoid the problem as I reset my IP. I had never
>>encountered this sort of thing before. 
>SNIP
>Aside from being really obnoxious and more than a little confused
>about programming you're even more confused about your OS.  I strongly
>suggest you Read The Fantastic Manuals that are available for all of
>your computing needs and post no more.  Look deeper into your reboot
>issue as well your logic is flawed (deeply.) 



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

Date: Thu, 31 May 2001 17:49:12 GMT
From: sloon <sloon@mindless.com>
Subject: Re: Perl script error during testing
Message-Id: <mt0dht8lcjk46ks98qsmlp44k0qd39377q@4ax.com>

If I reset my computer, due to the type of connection that I have, I
reset my IP.

If you would like to argue about that perhaps you could contact my ISP
and yammer at them for a while, I'm sure that they'll appreciate it.

On Thu, 31 May 2001 13:02:15 -0400, Lou Moran <lmoran@wtsg.com> wrote:

>On Wed, 30 May 2001 14:08:02 GMT, sloon <sloon@mindless.com> wrote
>wonderful things about sparkplugs:
>
>>I would like to thank all of the individuals who replied with helpful
>>suggestions. I've found that by shutting down my computer and
>>restarting it, I avoid the problem as I reset my IP. I had never
>>encountered this sort of thing before. 
>SNIP
>Aside from being really obnoxious and more than a little confused
>about programming you're even more confused about your OS.  I strongly
>suggest you Read The Fantastic Manuals that are available for all of
>your computing needs and post no more.  Look deeper into your reboot
>issue as well your logic is flawed (deeply.) 



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

Date: 31 May 2001 17:50:02 +0100
From: nobull@mail.com
Subject: Re: Reading binary data (method and style)?
Message-Id: <u9itiha2f9.fsf@wcl-l.bham.ac.uk>

Dmitry Epstein <mitia.nospam@northwestern.edu.invalid> writes:

> nobull@mail.com wrote:
> > 
> > Dmitry Epstein <mitia.nospam@northwestern.edu.invalid> writes:
> > 
> > > I could write the format string for unpack() something like this:
> > > "v2aaaav3a3" etc.
> > > But, since each field has a particular meaning, what I would like to do
> > > is to somehow write this with comments.
> > > (I know the following doesn't work):
> > > "v   # foo

Because you "knew" that I didn't bother to check.  As Ilya points out
it does work now.

> >   'v'. # foo
> >   'v'. # bar

> Thanks... but I was thinking of something more elegant.

What could be more elegant?

> I know, of course, about string concatenation.  I guess there's
> nothing
> better?

What could be better?  Perl has quite enough syntax already without
adding even more to re-implement existing functionality.
 
> Incidentally, is there a way to write a string on multiple lines in
> Perl?

I take it you mean without the newlines actually being part of the
string.  Yes, string contatenation.  Are you perhaps forgetting that
constant sub-expressions are evaluated at compile time?

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


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

Date: 31 May 2001 17:47:36 +0100
From: nobull@mail.com
Subject: Re: Reading from strings...
Message-Id: <u9k82xa2iy.fsf@wcl-l.bham.ac.uk>

mordor@fly.srk.fer.hr (Chaos) writes:

> Is there a module...

See FAQ: "What modules and extensions are available for Perl?..."

> ...that would allow me to use scalars as files?

Yes, it has the obvious name and the description "I/O handle to
read/write to a string".

Please do not post "Is there a module...?" questions without looking
first.

> Basically, I want something like this:
> 
> my $scalar = "this is my\nstring that I\nwant to read as a file\n";
> some_call (FH, "<$scalar");
> while(<FH>) { print "$_"; }
> 
> What do I put instead of some_call?

A 'tie' statement.  For details see the documentation of the module.

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


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

Date: 31 May 2001 06:06:34 -0700
From: greenseaweed@aol.com (Mr. Green)
Subject: Re: Regexp problem
Message-Id: <5370f8aa.0105310506.285f7e27@posting.google.com>

"John W. Krahn" <krahnj@acm.org> wrote in message news:<3B12EE37.3202D009@acm.org>...
> "Mr. Green" wrote:
> > 
> > I want to open a file and capture a specific chunk of html from it.
> > The html is in the file's first table cell. This is my code:
> > 
> > open(FILEREAD, "2345.txt") or die "Couldn't open file: $!";
> > 
> > while(<FILEREAD> !~ #</td>#) {
>                       ^^^^^^^^^^
> This is a comment in perl and should give a syntax error!
> 
> > $Form_data .= <FILEREAD>;
> > 
> > }
> > 
> > close FILEREAD;
> > 
> > I know that the file will have a </td> tag. Here's what the file looks
> > like:
> > ---------------------------------------
> > <tr bgcolor=white>
> > <td>
> > <input type=hidden name=time value=0><br>
> > <input type=hidden name=time value=0><br>
> > <input type=hidden name=time value=0><br>
> > <input type=hidden name=time value=0><br>
> > <input type=hidden name=time value=0><br>
> > </td>
> > .
> > .
> > more html
> > .
> > .
> > ----------------------------------------
> > I am content w/ capturing the <tr> tag, although it would be nice not
> > to. Anyway, my code doesn't work. When I print $Form_data, the script
> > prints some of the html that I want, but not all of it. Could the
> > regexp symbols \t and \d
> > be causing me trouble here? I am using perl 5.005_02. Thanks!
> 
> No
> 
> while ( <DATA> ) {
>     if ( /<td>/i .. /<\/td>/i ) {
>         $Form_data .= $_;
>         }
>     last if /<\/td>/i;
>     }
> print $Form_data;
> 
> 
> John

Thank you for introducing me to the range operator. Yes, on second
check, that script doesn't run. I was missing the 'm' before '#'. Your
code works flawlessly. Allow me to pose another question. Let's say
that you have a file that looks like so:
------------------------------------------------
<tr>
<td>
<input type=hidden name=time value=0><br>
<input type=hidden name=time value=0><br>
</td>
</tr>
<tr>
<td>
<input type=hidden name=time value=0><br>
<input type=hidden name=time value=0><br>
</td>
</tr>
<tr>
<td>
<input type=hidden name=time value=0><br>
<input type=hidden name=time value=0><br>
</td>
</tr>
------------------------------------------------
And you want to get the data in the 2nd row's cell. In other words,
your code works if we wanted the first table cell, but how would you
get the second?
I would just slurp the (small) file into an array and then use the
splice function. But could one also do this using the range operator?
Or any other way for that matter?


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

Date: Thu, 31 May 2001 13:16:14 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Regexp problem
Message-Id: <slrn9hcgch.2s4.bernard.el-hagin@gdndev25.lido-tech>

On 31 May 2001 06:06:34 -0700, Mr. Green <greenseaweed@aol.com> wrote:
>
>Thank you for introducing me to the range operator. Yes, on second
>check, that script doesn't run. I was missing the 'm' before '#'. Your
>code works flawlessly. Allow me to pose another question. Let's say
>that you have a file that looks like so:
>------------------------------------------------

[snip]

>------------------------------------------------
>And you want to get the data in the 2nd row's cell. In other words,
>your code works if we wanted the first table cell, but how would you
>get the second?
>I would just slurp the (small) file into an array and then use the
>splice function. But could one also do this using the range operator?
>Or any other way for that matter?

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

while(<DATA>){
  my $i;

  next  if /^<tr>/ and ++$i != 2;
  print if /^<tr>/ .. /^<\/tr>/;
}

__DATA__
<tr>
<td>
<input type=hidden name=time value=0><br>
<input type=hidden name=time value=0><br>
</td>
</tr>
<tr>
<td>
<input type=hidden name=time value=0><br>
<input type=hidden name=time value=0><br>
</td>
</tr>
<tr>
<td>
<input type=hidden name=time value=0><br>
<input type=hidden name=time value=0><br>
</td>
</tr>
-----------------------------------------

Cheers,
Bernard
--
perl -le '$#="Just another Perl hacker,"; print print;'


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

Date: Thu, 31 May 2001 13:18:11 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Regexp problem
Message-Id: <slrn9hcgg6.2s4.bernard.el-hagin@gdndev25.lido-tech>

On Thu, 31 May 2001 13:16:14 +0000 (UTC), Bernard El-Hagin
<bernard.el-hagin@lido-tech.net> wrote:
>On 31 May 2001 06:06:34 -0700, Mr. Green <greenseaweed@aol.com> wrote:
>>
>>Thank you for introducing me to the range operator. Yes, on second
>>check, that script doesn't run. I was missing the 'm' before '#'. Your
>>code works flawlessly. Allow me to pose another question. Let's say
>>that you have a file that looks like so:
>>------------------------------------------------
>
>[snip]
>
>>------------------------------------------------
>>And you want to get the data in the 2nd row's cell. In other words,
>>your code works if we wanted the first table cell, but how would you
>>get the second?
>>I would just slurp the (small) file into an array and then use the
>>splice function. But could one also do this using the range operator?
>>Or any other way for that matter?
>
>-----------------------------------------
>#!/usr/bin/perl -w
>use strict;
>
>while(<DATA>){
>  my $i;

Sorry, but $i should be declared outside the while.

Cheers,
Bernard
--
perl -le '$#="Just another Perl hacker,"; print print;'


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

Date: Thu, 31 May 2001 15:45:03 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Rounding
Message-Id: <3B1658EF.389171F1@bms.umist.ac.uk>

Anno Siegel wrote:
> 
> According to Ron Savage <ron@savage.net.au>:
> > Dave
> >
> > You can't rely on Perl's 'printf' function without extreme care.
> > According to the C language spec (yes, it's relevant), 'printf' can
> > round up or truncate depending on the magnitude of the number.
> 
> Can you substantiate that?  In particular, I have never heard of
> printf vacillating between rounding and truncating depending
> on magnitude.

using Rons program I got the following output :-

0.555 => 0.56. 

0.5555 => 0.56. 

1.5554 => 1.56. 

1.5555 => 1.56. 

1.555 => 1.55. 

1.5556 => 1.56. 

0.565 => 0.56. 

1.565 => 1.56. 

0.575 => 0.57. 

1.575 => 1.57.

Is this the output you would expect?

Paul


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

Date: 31 May 2001 16:14:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Rounding
Message-Id: <9f5qlh$ngs$1@mamenchi.zrz.TU-Berlin.DE>

According to Paul Boardman  <peb@bms.umist.ac.uk>:
> Anno Siegel wrote:
> > 
> > According to Ron Savage <ron@savage.net.au>:
> > > Dave
> > >
> > > You can't rely on Perl's 'printf' function without extreme care.
> > > According to the C language spec (yes, it's relevant), 'printf' can
> > > round up or truncate depending on the magnitude of the number.
> > 
> > Can you substantiate that?  In particular, I have never heard of
> > printf vacillating between rounding and truncating depending
> > on magnitude.
> 
> using Rons program I got the following output :-

[snip examples]

> Is this the output you would expect?

I have long given up being surprised by rounding results, but
that's not the point.  Your claim was that printf variously
rounds or truncates, and you pointed to the "C language spec".
You won't find it, because it isn't there.

For an explanation of the "unexpected" results, look at these:

    0.555 => 0.55500000000000004885 => 0.56
    1.555 => 1.55499999999999993783 => 1.55

The same rounding algorithm works throughout.

Anno


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

Date: Thu, 31 May 2001 17:54:06 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Rounding
Message-Id: <3B16772E.DBA5E644@bms.umist.ac.uk>

Anno Siegel wrote:
> 
> According to Paul Boardman  <peb@bms.umist.ac.uk>:
> > Anno Siegel wrote:
> > >
> > > According to Ron Savage <ron@savage.net.au>:
> > > > Dave
> > > >
> > > > You can't rely on Perl's 'printf' function without extreme care.
> > > > According to the C language spec (yes, it's relevant), 'printf' can
> > > > round up or truncate depending on the magnitude of the number.
> > >
> > > Can you substantiate that?  In particular, I have never heard of
> > > printf vacillating between rounding and truncating depending
> > > on magnitude.
> >
> > using Rons program I got the following output :-
> 
> [snip examples]
> 
> > Is this the output you would expect?
> 
> I have long given up being surprised by rounding results, but
> that's not the point.  Your claim was that printf variously
> rounds or truncates, and you pointed to the "C language spec".
> You won't find it, because it isn't there.

I didn't claim anything, that was my first post on the subject.  I was
intrigued by the thread and tries out Rons program to see what
happened.  I read your reply to Rons question and thought you might be
interested in the output I saw.  Or be able to shed some light on the
matter as I was confused by the results.

> For an explanation of the "unexpected" results, look at these:
> 
>     0.555 => 0.55500000000000004885 => 0.56
>     1.555 => 1.55499999999999993783 => 1.55
> 
> The same rounding algorithm works throughout.

I apologise if I'm being stupid but I don't see the explanation there... 

Paul


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

Date: 31 May 2001 17:18:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Rounding
Message-Id: <9f5udv$q2f$1@mamenchi.zrz.TU-Berlin.DE>

According to Paul Boardman  <peb@bms.umist.ac.uk>:
> Anno Siegel wrote:
> > 
> > According to Paul Boardman  <peb@bms.umist.ac.uk>:

[...]
 
> > > Is this the output you would expect?
> > 
> > I have long given up being surprised by rounding results, but
> > that's not the point.  Your claim was that printf variously
> > rounds or truncates, and you pointed to the "C language spec".
> > You won't find it, because it isn't there.
> 
> I didn't claim anything, that was my first post on the subject.  I was
> intrigued by the thread and tries out Rons program to see what
> happened.  I read your reply to Rons question and thought you might be
> interested in the output I saw.  Or be able to shed some light on the
> matter as I was confused by the results.

Sorry, my fault.  I got you mixed up with the original poster (Ron
Savage).

> > For an explanation of the "unexpected" results, look at these:
> > 
> >     0.555 => 0.55500000000000004885 => 0.56
> >     1.555 => 1.55499999999999993783 => 1.55
> > 
> > The same rounding algorithm works throughout.
> 
> I apologise if I'm being stupid but I don't see the explanation there... 

Well, what seems to need an explanation is apparently that 0.555 rounds
up to 0.56 and the similar-looking 1.555 rounds down to 1.55.  The
explanation is that the numbers displayed by print() (left) are already
the result of rounding to a default number of decimal places and then
trimming trailing zeroes.  These are *not* the values the computer
works with, which I have shown in the middle column with more than
the usual accuracy. You will note that the value for 0.555 is actually
a little bigger than that, and the value for 1.555 is a little too
small.  That explains why one is rounded up and the other down.

What we actually observe is just that rounding a number first to
n places, and rounding the result to m (m < n) places is not always
the same thing as rounding the original to m places.  Most people
have casually noted this fact, but it is easily forgotten when
it works behind the scenes.

Anno


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

Date: Thu, 31 May 2001 09:12:17 -0700
From: BCC <bcoon@sequenom.com>
Subject: Re: Server push and $|?
Message-Id: <3B166D61.3AB44F87@sequenom.com>

CGI::Push does not work with Internet Explorer, as stated in the docs :(
Bummer.  Im looking into client pull or a javascript timed reload instead.

Thanks for the explanation!

Bryan


> > Also (somewhat off topic) does there exist perl server push that works
> > with IE?  I scoured CPAN and came up empty.
>
> You tried CGI::Push ?
>
> Buggs



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

Date: 31 May 2001 17:52:18 +0100
From: nobull@mail.com
Subject: Re: Silly pipe() question
Message-Id: <u9hey1a2bh.fsf@wcl-l.bham.ac.uk>

Benjamin Goldberg <goldbb2@earthlink.net> writes:

> nobull@mail.com wrote:
> > 
> > Benjamin Goldberg <goldbb2@earthlink.net> writes:
> > 
> > > I suppose that this might seem to be a silly question, but...
> > >
> > > Why does the builtin function pipe() take two target operands,
> > > rather than taking no arguments and returning a two-element list?

> > Nobody is preventing you writing an alternative function with those
> > semantics.
> 
> But it wouldn't be a builtin, which is what I'm after.

There is a general relutance to add new built-in functionality unless
there is a really strong need.  The built-in file handle
'construuctors' (pipe, socketpair, socket, open) all follow the
pattern of accepting filehandles passed as arguments (and as of 5.6
they can autovivify references).

If you want filehandle constructors that look like more like classic
constuctors then you can have them but they aren't built-in, they are
provided by the standard IO::* modules.

Unfortunately in the case of pipe this is a bit messy:

my ($read_fh, $write_fh) = @{*{IO::Pipe->new}};

I would agree that there may be a case for an additional method in
IO::Pipe to make this tidier.

Also, I often wish that GLOB refs would DWIM in a some-other-ref
context.

> > Seems to me like there's little gain here.
> 
> It's an alternate syntax, which might in some cases be more readable.
> 
> Saying there's "little to gain" is like saying that because we have:
> 	if( foo ) { bar }
> we therefor don't need:
> 	bar if( foo );
> 
> Since we have one, we don't *need* the other... but nonetheless, we have
> both, and both are used ... whichever makes the code clearer is used.

For something as oft used as 'if' having eight[1] alternate builtin syntaxes
is justified.  I contend pipe() is nowhere near as oft used as if so
even two would not be justified.

[1] Yes, I said _eight_ (excluding ?: ) :

if( foo ) { bar };
bar if foo;
unless( !foo ) { bar };
bar unless !foo;
foo && bar;
foo and bar;
!foo || bar;
!foo or bar;

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


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

Date: Thu, 31 May 2001 15:24:54 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <Pine.LNX.4.30.0105311519110.22163-100000@lxplus003.cern.ch>

On Thu, 31 May 2001, Helgi Briem wrote:

> I appreciate Tad's effort

indeed

> to control this news group

Read: "to remind the newsgroup participants of their responsibilties
to each other".

"Control" is neither possible nor appropriate.  But justice
(via the killfile) can be both swift and silent, and there is no
court of appeal.




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

Date: Thu, 31 May 2001 13:46:41 -0400
From: "Dennis Kowalski" <dennis.kowalsk@daytonoh.ncr.com>
Subject: Time difference including hundreths of seconds
Message-Id: <3b168379$1@rpc1284.daytonoh.ncr.com>

Does anyone know of a routine that will return the difference between two
times including hundreths of seconds?

I know about time and timelocal but they both return just seconds.
I am looking for something with a finer granularity than that.

I guess what I want is a routine that will return ss and hs

Thanks




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

Date: 31 May 2001 18:36:11 +0100
From: nobull@mail.com
Subject: Re: udp ping socket problem
Message-Id: <u9y9rd8lpw.fsf@wcl-l.bham.ac.uk>

jack.haberle@bigfoot.com (Jack Haberle) writes:

> Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at /usr
> /lib/perl5/5.00503/i386-linux/Socket.pm line 295, <DATA> chunk 7.

> Anyone have any ideas?

Net::Ping is forgetting to check for errors when it calls recv().

You may want to report this to perlbug.  Here's a patch.

--- /usr/lib/perl5/5.6.0/Net/Ping.pm	Thu Feb 15 13:41:45 2001
+++ /home/bam/perl/Net/Ping.pm	Thu May 31 18:29:26 2001
@@ -369,9 +369,9 @@
         elsif ($nfound)         # A packet is waiting
         {
             $from_msg = "";
-            $from_saddr = recv($self->{"fh"}, $from_msg, 1500, $flags);
-            ($from_port, $from_ip) = sockaddr_in($from_saddr);
-            if (($from_ip eq $ip) &&        # Does the packet check out?
+            if (($from_saddr = recv($self->{"fh"}, $from_msg, 1500, $flags)) &&
+                (($from_port, $from_ip) = sockaddr_in($from_saddr)) &&
+                ($from_ip eq $ip) &&        # Does the packet check out?
                 ($from_port == $self->{"port_num"}) &&
                 ($from_msg eq $msg))
             {


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


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

Date: Thu, 31 May 2001 07:56:00 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Unsure about headers
Message-Id: <slrn9hccag.4ra.tadmc@tadmc26.august.net>


Rob <> wrote:
>"brian d foy" <comdog@panix.com> wrote in message
>news:comdog-E2BA77.13031030052001@news.panix.com...
>> In article <3B152889.881123B3@gmx.net>, Per Kistler <kistler@gmx.net>
>> wrote:
>>
>> [please post your reply after the original text, as demonstrated here]


>Unless the reply needs to directly quote any of the original text, the reply
>belongs above the original text. This is much easier to understand and precludes
>the user from having to scroll through a potentially large message to get to a
>potentially small reply.


Unless the reply is posted to some other newsgroup, the reply belongs
following the (trimmed) original text. This is a much more well-accepted
quoting style here, and precludes those who insist on doing otherwise
from becoming killfile entries, as you have.

There are no "large message" quotes, because the original is trimmed
to contain only enough to establish the context for the comments
that follow, so scrolling is not an issue either.

The point is not which is "better". The point is, if you post
Jeopardy style here, your articles will be widely ignored by
the very people likely to be able to answer your Perl questions.

When in Rome do as the Romans do.


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


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

Date: 31 May 2001 06:29:07 -0700
From: ottovolante@hotmail.com (Luca)
Subject: Upgrade from Activeperl 620 to 626 on a Microsoft box
Message-Id: <5e44a9e8.0105310529.7e3d95aa@posting.google.com>

Hi, I need to upgrade from Activeperl 620 to 626 but on Activestate
and into documentation they tell about fresh install. How can I
upgrade? Any experienced user?
Thanks


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

Date: Thu, 31 May 2001 14:34:45 +0100
From: John Imrie <07950232225@one2one.net>
Subject: Re: Upgrade from Activeperl 620 to 626 on a Microsoft box
Message-Id: <3B164875.29156156@one2one.net>



Luca wrote:

> Hi, I need to upgrade from Activeperl 620 to 626 but on Activestate
> and into documentation they tell about fresh install. How can I
> upgrade? Any experienced user?
> Thanks

Download the new version.
Uninstall the current version
Install the new version



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

Date: 31 May 2001 08:06:07 -0700
From: alain_s75@hotmail.com (Alain)
Subject: Re: vestale.pl ascii animation
Message-Id: <329469e4.0105310706.6ce41ecc@posting.google.com>

One more time
(we gone celebrate)
alain_s75@hotmail.com (Alain) wrote in message news:<329469e4.0105300339.65010060@posting.google.com>...
> Trying again ...
> 
> alain_s75@hotmail.com (Alain) wrote in message news:<329469e4.0105250016.56b597eb@posting.google.com>...
> > Hello all,
> > 
> > I am looking for an ascii animation that was posted here around 94/95,
> > it was in the form of a simple VT file and of a self compressed 3 or 4
> > pages perl program.
> > The title of the animation was "vestale sous contraintes, exercice
> > ludique en courier 10", and the name of the perl program "vestale.pl".
> > I am the author of it and somehow I lost the files in the mess of my
> > disks !!!
> > 
> > If someone still has it, I would really be greatful if they could
> > forward it to me.
> > Thanks in advance.
> > alain_s75@hotmail.com


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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


------------------------------
End of Perl-Users Digest V10 Issue 1029
***************************************


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