[19912] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2107 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 10 09:05:54 2001

Date: Sat, 10 Nov 2001 06:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1005401109-v10-i2107@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 10 Nov 2001     Volume: 10 Number: 2107

Today's topics:
    Re: date/time question: weekofyear, see my code <andrew@erlenstar.demon.co.uk>
        Execute C/C++ in Perl <anniehUSA@yahoo.com>
    Re: Execute C/C++ in Perl <jens@irs-net.com>
    Re: help with hashref <darkon@one.net>
    Re: help with hashref <jens@irs-net.com>
    Re: help with hashref <dtweed@acm.org>
    Re: how to print out every second value of an array <uri@stemsystems.com>
    Re: I am having a problem with my perl script. <dha@panix.com>
    Re: Perl vs. Active Perl <tim@vegeta.ath.cx>
    Re: Regular Expressions <uri@stemsystems.com>
    Re: Regular Expressions <dha@panix.com>
    Re: Software error with -T using sendmail (Garry Williams)
        system() and exec() <alicewonder2321212USA@yahoo.com>
    Re: which is faster? =1 or ++ <bigiain@mightymedia.com.au>
    Re: which is faster? =1 or ++ <uri@stemsystems.com>
    Re: which is faster? =1 or ++ (reader of news)
    Re: which is faster? =1 or ++ <uri@stemsystems.com>
    Re: which is faster? =1 or ++ (reader of news)
    Re: which is faster? =1 or ++ <krahnj@acm.org>
    Re: which is faster? =1 or ++ <bigiain@mightymedia.com.au>
    Re: which is faster? =1 or ++ <bigiain@mightymedia.com.au>
    Re: which is faster? =1 or ++ <uri@stemsystems.com>
    Re: which is faster? =1 or ++ (Villy Kruse)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 10 Nov 2001 10:53:41 +0000
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: date/time question: weekofyear, see my code
Message-Id: <87eln6zykq.fsf@erlenstar.demon.co.uk>

>>>>> "MAGiC" == MAGiC MANiAC^mTo <no_mto@hotmail.com> writes:

 MAGiC>   $weekofyear = int( $dayofyear / 7 ) + 1;

There are at least three definitions of "week number" in current use
(one ISO standard, one American convention, one convention used in
some parts of Europe) and the above is none of them. (See the
documentation for %U, %V and %W in strftime for the details.)

-- 
Andrew.


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

Date: Sat, 10 Nov 2001 06:30:24 -0500
From: "Annie Hall" <anniehUSA@yahoo.com>
Subject: Execute C/C++ in Perl
Message-Id: <9sj2bo$p7v$1@slb3.atl.mindspring.net>

Please kindly show how do execute compiled C/C++ programs in Perl.

Thanks in advance.




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

Date: Sat, 10 Nov 2001 12:27:33 +0100
From: Jens Luedicke <jens@irs-net.com>
Subject: Re: Execute C/C++ in Perl
Message-Id: <9sj34b$nfm$00$1@news.t-online.com>

Annie Hall wrote:

> Please kindly show how do execute compiled C/C++ programs in Perl.
> 
> Thanks in advance.

Do you want to embed some C/C++ code within Perl? Or do you want to run an 
external program?

The first option: Inline::C or Inline CPP
The second: run an external program with system() or exec()

-- 
Jens Luedicke
jens@irs-net.com


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

Date: Sat, 10 Nov 2001 06:25:13 GMT
From: "David K. Wall" <darkon@one.net>
Subject: Re: help with hashref
Message-Id: <Xns9155EB191211darkononenet@24.2.68.108>

Jens Luedicke <jens@irs-net.com> wrote:

> hi ...
> 
> I'm using the following code to store and create a threaded mail-list
> and I ask for comments and suggestions. 

It's far to late at night (as I write this) for me to make coherent 
comments on code;  however, you may find this URL interesting:
http://www.jwz.org/doc/threading.html

-- 
David Wall - darkon@one.net
"When the end of the world comes, I want to be in Cincinnati. Everything
happens ten years later there." -- Mark Twain


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

Date: Sat, 10 Nov 2001 12:18:37 +0100
From: Jens Luedicke <jens@irs-net.com>
Subject: Re: help with hashref
Message-Id: <9sj2jj$vat$01$1@news.t-online.com>

David K. Wall wrote:

> It's far to late at night (as I write this) for me to make coherent
> comments on code;  however, you may find this URL interesting:
> http://www.jwz.org/doc/threading.html

Thanks. 

When I try to analyze the structure of my hashref with Data::Dumper
I find lots of buggy and wrong elements. Because my code should create the 
hashref much different than Data::Dumper lists it and it works different. 
Is Data::Dumper reliable?

-- 
Jens Luedicke
jens@irs-net.com


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

Date: Sat, 10 Nov 2001 08:45:33 -0500
From: Dave Tweed <dtweed@acm.org>
Subject: Re: help with hashref
Message-Id: <3BED2F7D.78127EF9@acm.org>

Jens Luedicke wrote:
> When I try to analyze the structure of my hashref with Data::Dumper
> I find lots of buggy and wrong elements. Because my code should create the
> hashref much different than Data::Dumper lists it and it works different.
> Is Data::Dumper reliable?

Not entirely. I found some instances in which it would produce the same
output for two different structures (involving multiple levels of hashes
containing references). I stopped using it for that kind of application.

I think Data::Dumper is not intended to always provide a literal
representation of a data structure; rather it produces a "functionally
equivalent" structure when the output is eval'd.

-- Dave Tweed


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

Date: Sat, 10 Nov 2001 05:31:44 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: how to print out every second value of an array
Message-Id: <x7eln7qjgn.fsf@home.sysarch.com>


comp.lang.perl is a dead group no matter what your server says.

>>>>> "L" == Laocoon  <Laocoon@eudoramail.com> writes:

  L> example :
  L> my $c = 0;
  L> while($i <= $#data) {
  L> $joined[$c++] = $data[$i++] . $data [$i++];

have you tried this? the sequencing of side effects like ++ are a known
issue in perl. the order and when they get executed are not well (if at
all) defined. even c has no proper definition if you do multiple ++ on
the same variable in one statement. it is much safer to use $i and $i +
1 and then do $i += 2.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 10 Nov 2001 06:39:31 GMT
From: "David H. Adler" <dha@panix.com>
Subject: Re: I am having a problem with my perl script.
Message-Id: <slrn9upit3.2q1.dha@panix2.panix.com>

In article <lgXG7.118425$tb2.9341721@bin2.nnrp.aus1.giganews.com>,
Jessica Bull wrote:

> I  would suggest using FILE::COPY.  It is multi-platform and is better than
> going out to the system to do commands.  Also, you should perform a check
> for errors.

Speaking of multi-platform, perhaps there's one on which that is a
module, but most of the time - perl being case-sensitive about such
things, you probably want File::Copy instead.  :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Take myself, subtract films, and the remainder is zero"
 - Akira Kurosawa


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

Date: Sat, 10 Nov 2001 10:13:25 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Perl vs. Active Perl
Message-Id: <slrn9upvss.scl.tim@vegeta.ath.cx>

Randy Kobes <randy@theory.uwinnipeg.ca> graced us by uttering:
> "Tim Hammerquist" <tim@vegeta.ath.cx> wrote:
>> CPAN has some win32 perl binaries that remain under the Artistic
>> License, and IndigoPerl <http://indigostar.com/indigoperl.htm>, quote,
>> "comes without a restrictive license - you can do whatever you want to
>> do with it."
> 
> Actually, this seems to have changed somewhat regarding
> bundling IndigoPerl with a commercial product - see
> http://indigostar.com/indigoperl.htm#License.

You are correct.  Regardless of what I quoted from that very same page,
IndigoPerl's license is only _slightly_ less restictive than
ActivePerl's.  (ActivePerl requires written permission for
commercial redistribution whether you make less the $1_000/yr or not.)

You can always get yourself a linux distro and compile perl yourself...

Or bend over backwards, compile it for Win32 yourself...

thx for clearing that up, randy. :)

> best regards,
> randy kobes

Tim Hammerquist
-- 
How can you have any pudding if you don't eat your meat?
    -- Pink Floyd


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

Date: Sat, 10 Nov 2001 05:25:55 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Regular Expressions
Message-Id: <x7lmhfqjqe.fsf@home.sysarch.com>

>>>>> "j" == james  <james@ryley.com> writes:

  j> Use this:  
  j> $variable =~ tr/A-Z/a-z/;

  j> tr is slightly different than s.

<public chastising>

what you did was wrong on SO MANY WAYS.

why did you followup MY MESSAGE? my post actually corrected the previous
one.

on top of this you jeopardy posted. read these:

http://www.btinternet.com/~chiba/sbox/topposters.html
http://www.uwasa.fi/~ts/http/quote.html
http://www.geocities.com/nnqweb/nquote.html


and then you quoted my entire post below and obviously didn't even
address it.

and then you stealth cc'ed me with that.

and the email had the same 4 lines of content and 132 LINES OF HTML
CRAP. one of the most definitively useless things ever done, 132 lines
of font and size and CSS and crap for 4 lousy lines of content. i hope
you are proud of your email and usenet skills.

don't do this again. 

</public chastising>

this is cc'ed WITH A NOTICE that it was cc'ed.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 10 Nov 2001 06:43:59 GMT
From: "David H. Adler" <dha@panix.com>
Subject: Re: Regular Expressions
Message-Id: <slrn9upj5f.2q1.dha@panix2.panix.com>

In article <slrn9up78q.olf.tadmc@tadmc26.august.net>, Tad
McClellan wrote:

> tr/// has nothing to do with regular expressions despite
> its unfortunately similar appearance.

And despite it's appearance in at least one book's index as being a
regex thing.</peeve type=pet>

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
 While there is a restriction against live animals, that should not
apply... since it is not the super monkey that is being auctioned, but
rather a telephone call from the super monkey. - Mark Rogaski


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

Date: Sat, 10 Nov 2001 13:05:46 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Software error with -T using sendmail
Message-Id: <slrn9uq9hb.1o2.garry@zfw.zvolve.net>

On Fri, 09 Nov 2001 23:40:38 -0500, Benjamin Goldberg
<goldbb2@earthlink.net> wrote:

> spamfree wrote:
>> 
>> I wish to enable taint but get software error opening sendmail.
>> Do I need to untaint path?
>> If so, how to do that.
>> 
>> #!/usr/bin/perl -Tw
>> #<code cut>
>> open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
>> # Insecure $ENV{PATH} while running with -T switch ?
> 
> There's one of two problems:
> 
> The simplest is, you ran the program by typing something like:
>     perl -T somescript.pl
> and perl is able to tell that "perl" was looked up in the PATH, not from
> a full pathname.  To fix it, either start your program as:
>     /usr/bin/perl -T somescript.pl
> or:
>     ./somescript.pl

This is nonsense.  

And it *won't* solve the problem.  

Set $ENV{PATH} *before* opening a pipe to sendmail.  

See the perlsec manual page.  

-- 
Garry Williams


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

Date: Sat, 10 Nov 2001 07:47:34 -0500
From: "Alice Wonder" <alicewonder2321212USA@yahoo.com>
Subject: system() and exec()
Message-Id: <9sj6sl$7i4$1@slb1.atl.mindspring.net>

I read about the two functions at www.perl.com but don't really understand
how to use them.

Let's say I  have a myC++.exe and run it at the command prompt (Windows
2000) with:

c:\> myC++ employee 123

How do I embed the common in Perl so that I could execute the C++ program in
Perl? Or am I looking at the wrong functions to use? Please kindly advise.
Thank you very much.





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

Date: Sat, 10 Nov 2001 16:23:16 +1100
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: which is faster? =1 or ++
Message-Id: <bigiain-D00851.16231610112001@news.zip.com.au>

In article <slrn9upc96.uf0.newsreader@amd.universe>, 
newsreader@mediaone.net wrote:

> I would like to know which of the following is faster
> 
> 
> $|=1; 
> 	or 
> $|++;
> 
> 
> Thanks in advance
> 
> 

Well, its easy enough to find out:

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

use Benchmark;
timethese(1000000, {
    'increment' => sub {$|=0;$|++},
    'assign' => sub {$|=0;$|=1},
    });

tells me:

Benchmark: timing 1000000 iterations of assign, increment...
    assign:  5 secs ( 5.02 usr  0.00 sys =  5.02 cpu)
 increment:  8 secs ( 6.75 usr  0.00 sys =  6.75 cpu)

(note: I first set $| to zero in each sub to make sure that $|++ wasn't 
having to do anything different each time thru...)

*BUT*, the other thing you ought to keep in mind is that $|=1 is 
_always_ going to do what you expect it to. $|++ does exactly what you 
_tell_ it to, but if you've got code that in various places increments 
and the decrements $|, you _may_ end up with $| equaling -1...

Luckily, it looks like the assign way is quicker anyway, so theres no 
reason to use the increment version. (I seem to remember a rant from 
someone, perhaps Randal, about the evils of "cargo cult programming" 
propagating memes like $|++ as being "the right way to do it"...)

big


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

Date: Sat, 10 Nov 2001 05:33:22 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: which is faster? =1 or ++
Message-Id: <x7adxvqjdy.fsf@home.sysarch.com>

>>>>> "ron" == reader of news <newsreader@mediaone.net> writes:

  ron> I would like to know which of the following is faster
  ron> $|=1; 
  ron> 	or 
  ron> $|++;

why does it matter to you? how often are you going to set $|? in some
ridiculously tight loop? worry about something useful like getting the
program to work before you concern yourself with tiny optimizations like
this.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Sat, 10 Nov 2001 05:46:57 GMT
From: newsreader@mediaone.net (reader of news)
Subject: Re: which is faster? =1 or ++
Message-Id: <slrn9upftq.uga.newsreader@amd.universe>

On Sat, 10 Nov 2001 05:33:22 GMT, Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "ron" == reader of news <newsreader@mediaone.net> writes:
>
>why does it matter to you? how often are you going to set $|? in some
>ridiculously tight loop? worry about something useful like getting the
>program to work before you concern yourself with tiny optimizations like
>this.
>

Who said it matters to me?  I am curious.


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

Date: Sat, 10 Nov 2001 05:49:52 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: which is faster? =1 or ++
Message-Id: <x73d3nqimi.fsf@home.sysarch.com>

>>>>> "IC" == Iain Chalmers <bigiain@mightymedia.com.au> writes:

  IC> *BUT*, the other thing you ought to keep in mind is that $|=1 is 
  IC> _always_ going to do what you expect it to. $|++ does exactly what you 
  IC> _tell_ it to, but if you've got code that in various places increments 
  IC> and the decrements $|, you _may_ end up with $| equaling -1...

perl -le '$|--; print $|; $|++; print $|; $| *= 0; print $|; $| = -2 ; print $|; $| = 1.1; print $|; $| = .01; print $|'
1
1
0
1
1
0

hmm, doesn't look like what you say.

$| is special. it can only be set to 0 or 1 and only be set to 0 by
assigning it 0.  it does seem to do an implied int which is why .01 set
it to 0. anything else that assigns to it will set it to 1.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Sat, 10 Nov 2001 05:52:36 GMT
From: newsreader@mediaone.net (reader of news)
Subject: Re: which is faster? =1 or ++
Message-Id: <slrn9upg8d.uga.newsreader@amd.universe>

On Sat, 10 Nov 2001 16:23:16 +1100, 
Iain Chalmers <bigiain@mightymedia.com.au> wrote:
>
>Well, its easy enough to find out:
>
>#!/usr/bin/perl -w
>use strict;
>
>use Benchmark;
>timethese(1000000, {
>    'increment' => sub {$|=0;$|++},
>    'assign' => sub {$|=0;$|=1},
>    });
>
>tells me:
>
>Benchmark: timing 1000000 iterations of assign, increment...
>    assign:  5 secs ( 5.02 usr  0.00 sys =  5.02 cpu)
> increment:  8 secs ( 6.75 usr  0.00 sys =  6.75 cpu)
>
>(note: I first set $| to zero in each sub to make sure that $|++ wasn't 
>having to do anything different each time thru...)
>
>*BUT*, the other thing you ought to keep in mind is that $|=1 is 
>_always_ going to do what you expect it to. $|++ does exactly what you 
>_tell_ it to, but if you've got code that in various places increments 
>and the decrements $|, you _may_ end up with $| equaling -1...
>
>Luckily, it looks like the assign way is quicker anyway, so theres no 
>reason to use the increment version. (I seem to remember a rant from 
>someone, perhaps Randal, about the evils of "cargo cult programming" 
>propagating memes like $|++ as being "the right way to do it"...)
>


Thanks

I kind of suspected this result.  Not
entirely unexpected since increment
seems to involve "doing something"
more than merely assigning a value to
a variable.


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

Date: Sat, 10 Nov 2001 06:05:11 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: which is faster? =1 or ++
Message-Id: <3BECC44F.2D8F613A@acm.org>

Iain Chalmers wrote:
> 
> *BUT*, the other thing you ought to keep in mind is that $|=1 is
> _always_ going to do what you expect it to. $|++ does exactly what you
> _tell_ it to, but if you've got code that in various places increments
> and the decrements $|, you _may_ end up with $| equaling -1...

Not unless your Perl is broken big time.  $| is a special variable that
can only have the values zero or one.

$ perl -le'print $|;print ++$|;print ++$|;print --$|;print --$|;print
--$|;print $| += 8;print $| += 234_567'
0
1
1
0
1
0
1
1



John
-- 
use Perl;
program
fulfillment


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

Date: Sat, 10 Nov 2001 17:11:26 +1100
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: which is faster? =1 or ++
Message-Id: <bigiain-0AFD68.17112610112001@news.zip.com.au>

In article <x73d3nqimi.fsf@home.sysarch.com>, Uri Guttman 
<uri@stemsystems.com> wrote:

> >>>>> "IC" == Iain Chalmers <bigiain@mightymedia.com.au> writes:
> 
>   IC> *BUT*, the other thing you ought to keep in mind is that $|=1 is 
>   IC> _always_ going to do what you expect it to. $|++ does exactly what 
>   you 
>   IC> _tell_ it to, but if you've got code that in various places 
>   increments 
>   IC> and the decrements $|, you _may_ end up with $| equaling -1...
> 
> perl -le '$|--; print $|; $|++; print $|; $| *= 0; print $|; $| = -2 ; 
> print $|; $| = 1.1; print $|; $| = .01; print $|'
> 1
> 1
> 0
> 1
> 1
> 0
> 
> hmm, doesn't look like what you say.
> 
> $| is special. it can only be set to 0 or 1 and only be set to 0 by
> assigning it 0.  it does seem to do an implied int which is why .01 set
> it to 0. anything else that assigns to it will set it to 1.
> 
> uri


Oooops, guess I should have checked that before posting <embarrased look>

*BUT* I find this very non-intuitive:

perl -le '$|=-1;print $|;$|-- ;print $|;'
1
0


so $|-- _will_ decrement $| from 1 to zero (at least on 5.005_03 linux, 
and  5.004 (MacPerl 5.2.0r4)).

and assigning $|=-1 results in $| equaling 1...

wierd...

big


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

Date: Sat, 10 Nov 2001 17:21:24 +1100
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: which is faster? =1 or ++
Message-Id: <bigiain-B9397B.17212410112001@news.zip.com.au>

In article <3BECC44F.2D8F613A@acm.org>, "John W. Krahn" 
<krahnj@acm.org> wrote:

> Iain Chalmers wrote:
> > 
> > *BUT*, the other thing you ought to keep in mind is that $|=1 is
> > _always_ going to do what you expect it to. $|++ does exactly what you
> > _tell_ it to, but if you've got code that in various places increments
> > and the decrements $|, you _may_ end up with $| equaling -1...
> 
> Not unless your Perl is broken big time.  $| is a special variable that
> can only have the values zero or one.
> 
> $ perl -le'print $|;print ++$|;print ++$|;print --$|;print --$|;print
> --$|;print $| += 8;print $| += 234_567'
> 0
> 1
> 1
> 0
> 1
> 0
> 1
> 1

Yep, uri just pointed that out too, so I'll modify my statement 
slightly, how about:

expecting $|++ will always "work", but expecting $|-- to work the 
opposite way _can_ bite you on the bum if things dont happen in the 
sequence you expect, viz...

perl -le'
print $|;
$|--; #decrement $|
print $|;
$|--; #decrement $| again
print $|;
'
0
1
0

how _that_?

:-)

big


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

Date: Sat, 10 Nov 2001 06:35:35 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: which is faster? =1 or ++
Message-Id: <x7zo5vp1xt.fsf@home.sysarch.com>

>>>>> "IC" == Iain Chalmers <bigiain@mightymedia.com.au> writes:

  IC> *BUT* I find this very non-intuitive:

  IC> perl -le '$|=-1;print $|;$|-- ;print $|;'
  IC> 1
  IC> 0


  IC> so $|-- _will_ decrement $| from 1 to zero (at least on 5.005_03 linux, 
  IC> and  5.004 (MacPerl 5.2.0r4)).

it makes sense as that is what -- does. it is the same as -= 1 and that
also will unset $| if it was set. and $|-- acts like a binary toggle and
is useful in JAPH's and perl golf. :)

  IC> and assigning $|=-1 results in $| equaling 1...

and anything other than 0 (or something which int's to 0). so -2 and 100
are the same. it is internally only a boolean flag that can externally
take on the values of 1 or 0.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 10 Nov 2001 10:11:54 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: which is faster? =1 or ++
Message-Id: <slrn9upvba.prr.vek@pharmnl.ohout.pharmapartners.nl>

On Sat, 10 Nov 2001 04:44:46 GMT,
    reader of news <newsreader@mediaone.net> wrote:


>I would like to know which of the following is faster
>
>
>$|=1; 
>	or 
>$|++;
>
>



Do you intend to increment the value use $|++;  if you wan't to
set its value to 1 use $|=1.  IMHO it makes no sense to tell
perl to increment a value when all you want to do is setting it
to some known value.



Villy


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

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


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