[25043] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7293 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 23 21:10:30 2004

Date: Sat, 23 Oct 2004 18:10:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 23 Oct 2004     Volume: 10 Number: 7293

Today's topics:
    Re: Net::POP3 Install <matthew.garrish@sympatico.ca>
    Re: Net::POP3 Install <nospam@nospam.com>
    Re: Net::POP3 Install <usa1@llenroc.ude.invalid>
    Re: Net::POP3 Install <nospam@nospam.com>
    Re: Net::POP3 Install <jurgenex@hotmail.com>
    Re: Net::POP3 Install <nospam@nospam.com>
    Re: Net::POP3 Install <nospam@nospam.com>
        open-perl-ide qustion <nospam@nospam.com>
        Optimize Perl.. <perl@my-header.org>
    Re: Optimize Perl.. <usa1@llenroc.ude.invalid>
        perl optimazation guide/book (buildmorelines)
    Re: perl optimazation guide/book <usa1@llenroc.ude.invalid>
    Re: perl optimazation guide/book <postmaster@castleamber.com>
    Re: printing to web browser <tadmc@augustmail.com>
    Re: printing to web browser <nospam@nospam.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 23 Oct 2004 10:50:19 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Net::POP3 Install
Message-Id: <Gcued.62024$JG5.1129500@news20.bellglobal.com>


"daniel kaplan" <nospam@nospam.com> wrote in message 
news:1098540477.73998@nntp.acecape.com...

[proper attribution missing]

>> perl -MModule::Name -e1
>
> not sure of the syntax here, and have tried multiple variations....
>
> cant even seem to get help on e1!
>

[repeat of my previous post, just adding back in the important line of code 
above I accidentally cut out]

If you keep expecting to get spoon-fed answers, you're going to find that
fewer and fewer people respond. What's so hard to figure out here? -e is
obviously a command line switch (unless you'd care to explain what you think
it is?), so go to the documentation on running perl from the command line
(i.e., perlrun!!!). And 1 is the simplest program you can write if all you
want to check is whether the module can be loaded. Voila!

Matt 




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

Date: Sat, 23 Oct 2004 11:44:57 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Net::POP3 Install
Message-Id: <1098546332.441351@nntp.acecape.com>

>> perl -MModule::Name -e1
>
> not sure of the syntax here, and have tried multiple variations....
>
> cant even seem to get help on e1!
>

>>If you keep expecting to get spoon-fed answers, you're going to find that
>fewer and fewer people respond. What's so hard to figure out here? -e is
>obviously a command line switch (unless you'd care to explain what you
think
>it is?), so go to the documentation on running perl from the command line
>(i.e., perlrun!!!). And 1 is the simplest program you can write if all you
>want to check is whether the module can be loaded. Voila!

Matt,

yeah, i know that it's command line swicth...as i explained in my post, not
only could i not figure out the syntax of

perl -MModule::Name -e1

but in the -q mode, couldnt find the right combo of words...and i wasn't
sure if MModule::Name was the comand itslef, or the syntax, and no combo i
entered seemed to work.




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

Date: 23 Oct 2004 15:47:40 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Net::POP3 Install
Message-Id: <Xns958B77FAA46BFasu1cornelledu@132.236.56.8>

"daniel kaplan" <nospam@nospam.com> wrote in
news:1098546332.441351@nntp.acecape.com: 

>>> perl -MModule::Name -e1
>>
>> not sure of the syntax here, and have tried multiple variations....
>>
>> cant even seem to get help on e1!
>>
> 
>>>If you keep expecting to get spoon-fed answers, you're going to find
>>>that fewer and fewer people respond. What's so hard to figure out here? 

 ...

> yeah, i know that it's command line swicth

perl -h

Sinan



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

Date: Sat, 23 Oct 2004 12:00:39 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Net::POP3 Install
Message-Id: <1098547270.716817@nntp.acecape.com>

simple update, finnaly got the syntax right....but every other command
windows says perl generated an error....and it terminates it....now could my
install of perl, could be my windows machine, could be a lot of things...

using activestate....are all builds equal?  if not, anyone know of another
one they would recommend?




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

Date: Sat, 23 Oct 2004 16:15:38 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Net::POP3 Install
Message-Id: <Ksved.1574$8W6.1032@trnddc05>

daniel kaplan wrote:

You know, this is getting old fast

> simple update, finnaly got the syntax right....but every other command
> windows says perl generated an error..

If you want help then
- provide the exact error message
- provide the actual code
- provide that actual command you used to run the script
 ...., oh, what the heck, just read _and_follow_ the posting guidelines.

> ..and it terminates it....now

Who terminates whom? What do you mean by 'terminate'. Be precise in what you 
are saying. We have no way of knowing what you were thinking when you wrote 
this unless you tell us.

> could my install of perl, could be my windows machine, could be a lot
> of things...

Yeah, an with a vague description like above there is no way of even 
guessing what is wrong.
"every other" makes me believe that probably you got a virus that runs a 
hidden counter for your commands and whenever the counter is even it 
executes some secret piece of code that kills your program.

jue 




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

Date: Sat, 23 Oct 2004 17:06:12 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Net::POP3 Install
Message-Id: <1098565609.57054@nntp.acecape.com>

> Who terminates whom? What do you mean by 'terminate'. Be precise in what
you
> are saying. We have no way of knowing what you were thinking when you
wrote
> this unless you tell us.

ok, first off, enough....if you want to reply and inset a snap at the same
time, save us both the headache.  if no one answer, then fine as well....

this is a WINDOWS type crash...it's the same one i get when some thing goes
wrong with AIM, with OE, etc.   <program> has generated errors and is being
shut down.  <sorry, can't think of the actuall text>

what i said was i will REINSTALL perl.   so at the same time wanted
recommendations, "does anyone prefer other versions?"  other builds?
etc....

thanks ahead




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

Date: Sat, 23 Oct 2004 17:23:33 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Net::POP3 Install
Message-Id: <1098566650.9191@nntp.acecape.com>

a quick re-reply here since the errror just came back.  it's a doc watson
error window.  have to go track down the log, and
Application exception occurred:

App: (pid=31536)
When: 10/23/2004 @ 17:16:47.001
Exception number: c0000005 (access violation)

31536 perl.exe
and it is the "dreaded"     Exception number: c0000005 (access violation)

so definitly about to uninstall then reinstall perl...

but seriously, i believe it's my system, as i have been getting these alitte
more frequently with AIM and OE




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

Date: Sat, 23 Oct 2004 20:50:23 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: open-perl-ide qustion
Message-Id: <1098579060.649973@nntp.acecape.com>

can anyone recommend or NOT recommend this?

i found it at faq.perl.org and just wondered if it was any good....

thanks ahead




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

Date: Sat, 23 Oct 2004 23:51:14 +0200
From: Matija Papec <perl@my-header.org>
Subject: Optimize Perl..
Message-Id: <6fkln0t3vrrmn8h985e7f1s53mi915jvn1@4ax.com>

http://www-106.ibm.com/developerworks/library/l-optperl.html?ca=dgr-lnxw06OptPerl

Usually they have good articles but this one isn't nearly there, and I doubt
that author is just making jokes in it?



-- 
Matija


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

Date: 23 Oct 2004 22:04:51 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Optimize Perl..
Message-Id: <Xns958BB7ED77434asu1cornelledu@132.236.56.8>

Matija Papec <perl@my-header.org> wrote in
news:6fkln0t3vrrmn8h985e7f1s53mi915jvn1@4ax.com: 

> http://www-106.ibm.com/developerworks/library/l-optperl.html?ca=dgr-lnx
> w06OptPerl 
> 
> Usually they have good articles but this one isn't nearly there, and I
> doubt that author is just making jokes in it?

It is an odd article. The author starts with non-issues and comes up with 
the obvious solutions: "If you are going to concatenate a string a million 
times, don't use a loop!"

In any case, even if that is the level of the target audience, I would not 
put much stock in this article. How can someone fail to mention the 
Benchmark module in an article about optimization?

Sinan.


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

Date: 23 Oct 2004 16:53:24 -0700
From: bulk88@hotmail.com (buildmorelines)
Subject: perl optimazation guide/book
Message-Id: <ee659c69.0410231553.338d1b28@posting.google.com>

Are there any books or guide to Perl function and operator and syntax
(not algorithem) optimzation? like a guide that says what function or
way of doing something is faster than another.

Two of them I discovered were scalar(@array) is faster than $#array,
and pop(@array) is faster than $array[-1]. Are there any more of those
kinds of optimzations?

The fasterness was determined by running a perl script that runs a
loop 20x that runs another perl through `` and processes smallprof.out
getting the average. The other perl being run through `` is a one line
perl program that is like "$r = pop(@array);" or "$r = $array[-1];"
running with -d:SmallProf on the command line arguments to the
interpreter.


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

Date: 24 Oct 2004 00:31:46 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: perl optimazation guide/book
Message-Id: <Xns958BD0D0A5A6Fasu1cornelledu@132.236.56.8>

bulk88@hotmail.com (buildmorelines) wrote in 
news:ee659c69.0410231553.338d1b28@posting.google.com:

> Are there any books or guide to Perl function and operator and syntax
> (not algorithem) optimzation? like a guide that says what function or
> way of doing something is faster than another.
> 
> Two of them I discovered were scalar(@array) is faster than $#array,

Hmmm ...

D:\Home> cat t.pl
#! perl

use strict;
use warnings;

my @arr = ( 1 );

print 'scalar @arr = ', scalar(@arr), "\n";
print '$#arr = ', $#arr, "\n";

__END__

D:\Home> perl t.pl
scalar @arr = 1
$#arr = 0


Something about apples and oranges comes to mind.

> and pop(@array) is faster than $array[-1]. 

#! perl

use strict;
use warnings;

{
    my @arr = ( 1 );
    print "The last element of \@arr is: $arr[-1]\n";
    print "And I am number $arr[-1]\n";
}

# compare with

{
    my @arr = ( 1 );
    print "The last element of \@arr is: @{[ pop @arr ]}\n";
    print "And I am number $arr[-1]\n"; # ooops
}


__END__


D:\Home> perl t.pl
The last element of @arr is: 1
And I am number 1
The last element of @arr is: 1
Use of uninitialized value in concatenation (.) or string at t.pl line 17.
And I am number

Did I mention apples and oranges before?

> Are there any more of those kinds of optimzations?

These are not optimizations.
 
> The fasterness 

Cute.

> was determined by running a perl script that runs a loop 20x that runs 
> another perl through `` and processes smallprof.out getting the average. 
> The other perl being run through `` is a one line perl program that is 
> like "$r = pop(@array);" or "$r = $array[-1];" running with -d:SmallProf 
> on the command line arguments to the interpreter.

I am not sure exactly what you are doing, but, hmmmmm ...

D:\Home> cat t.pl
#! perl

use strict;
use warnings;

use Benchmark qw(cmpthese);

cmpthese( 1_000_000, {
        apples => sub {
            my @arr = ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 );
            my $r = $arr[-1];
            ++$r;
        },
        oranges => sub {
            my @arr = ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 );
            my $r = pop @arr;
            ++$r;
        }
    }
);

__END__

On Windows 98 PIII 500, 128 MB, Winamp playing ...

D:\Home> perl -v

This is perl, v5.8.4 built for MSWin32-x86-multi-thread

D:\Home> perl t.pl
           Rate oranges  apples
oranges 94340/s      --      0%
apples  94340/s      0%      --

Now, to make these apples and oranges comparable, we can insert the 
following line in the oranges sub:

push @arr, $r;

after we initialize $r.

D:\Home> perl t.pl
           Rate oranges  apples
oranges 82372/s      --    -11%
apples  92937/s     13%      --

Now, FreeBSD 5.2.1-RELEASE, AMD Athlon 2600, 256 MB, Apache, PostgreSQL, 
and a whole bunch of other stuff running ...

asu1@recex:~ > perl -v

This is perl, v5.8.5 built for i386-freebsd-64int

asu1@recex:~ > perl t.pl
            Rate  apples oranges
apples  250000/s      --     -1%
oranges 251473/s      1%      --

With the 

push @arr, $r;

I get:

asu1@recex:~ > perl t.pl
            Rate oranges  apples
oranges 208469/s      --    -17%
apples  250980/s     20%      --

The point of this exercise is not to prove you wrong or anything ... It is 
just to show you that comparing apples and oranges does not make sense: 
Choose between pop @arr and $arr[-1] based on whether you need/want to 
preserve the array, not based on speed. 

Sinan.


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

Date: 24 Oct 2004 00:48:41 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: perl optimazation guide/book
Message-Id: <Xns958BC988381C8castleamber@130.133.1.4>

buildmorelines wrote:

> The fasterness was determined by running a perl script that runs a
> loop 20x that runs another perl through `` and processes smallprof.out
> getting the average. The other perl being run through `` is a one line
> perl program that is like "$r = pop(@array);" or "$r = $array[-1];"
> running with -d:SmallProf on the command line arguments to the
> interpreter.

http://search.cpan.org/~nwclark/perl-5.8.5/lib/Benchmark.pm

Note that benchmarks also depend on which Perl version you are running.

-- 
John                               MexIT: http://johnbokma.com/mexit/
                           personal page:       http://johnbokma.com/
        Experienced programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html


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

Date: Sat, 23 Oct 2004 11:04:52 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: printing to web browser
Message-Id: <slrncnl094.1hc.tadmc@magna.augustmail.com>

Laura <lwt0301@bellsouth.net> wrote:
> Jon Ericson wrote:
> 
>> 
>> P.S. I sense a "script versus program[..]
> 
> A script is interpreted and a program is compiled.  


Perl is both compiled *and* interpreted (see perlrun.pod).

So which one is it if written using Perl?


[ That is a rhetorical question, as there is no correct answer.
  The script vs. program thing has been discussed here ad nauseum
  and is always valueless as there is no difference.
  I think Jon was being sarcastic, yet here you are, starting
  up such a useless subthread yet again...
]

  
> I know you can in Perl
> and some other scripting languages turn a script into a program, which
> makes it more like a real programming language, like C++ or Java.  


That is a load of hooey.

If you can write "programs" in it, then it is a real "programming language".


> Perl is
> a scripting tool written in C so C programmers can have the conveniences of
> languages like C++ or Visual Basic without having to leave their native
> environment.


Yet more foolishness!


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


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

Date: Sat, 23 Oct 2004 12:22:10 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: printing to web browser
Message-Id: <1098548561.448930@nntp.acecape.com>

>If you can write "programs" in it, then it is a real "programming
language".

that is the bottom line, whether it is compiled at run time or before only
counts as a difference in speed.  but the bottom line is that it IS a
programming language...




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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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