[31138] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2383 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 1 03:09:41 2009

Date: Fri, 1 May 2009 00:09:05 -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           Fri, 1 May 2009     Volume: 11 Number: 2383

Today's topics:
    Re: How to find duplicate in certain fields of array??  <some@body.com>
    Re: How to find duplicate in certain fields of array?? sln@netherlands.com
    Re: How to find duplicate in certain fields of array?? <some@body.com>
    Re: How to find duplicate in certain fields of array?? sln@netherlands.com
    Re: How to find duplicate in certain fields of array?? <jurgenex@hotmail.com>
        new CPAN modules on Fri May  1 2009 (Randal Schwartz)
    Re: Perl 5.10.0 message: Undefined subroutine &main::  sln@netherlands.com
    Re: Perl is too slow - A statement <xhoster@gmail.com>
    Re: Perl is too slow - A statement <No_4@dsl.pipex.com>
    Re: Perl is too slow - A statement <nat.k@gm.ml>
    Re: Perl is too slow - A statement <nat.k@gm.ml>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 30 Apr 2009 19:35:40 -0400
From: somebody <some@body.com>
Subject: Re: How to find duplicate in certain fields of array?? - SOLUTION
Message-Id: <pan.2009.04.30.23.35.40.434622@body.com>

On Thu, 30 Apr 2009 00:17:25 -0400, Uri Guttman wrote:
> and one other little thing. if you assume no extra white space (as you
> do in your code) then splitting on | OR space is all you need and it
> reduces to this foreach:
> 
> 	foreach my $token ( split(/[ |]/, $line ) ) {
> 
> uri


It's amazing what you can to with one line of perl code!

-Thanks




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

Date: Thu, 30 Apr 2009 15:06:01 -0700
From: sln@netherlands.com
Subject: Re: How to find duplicate in certain fields of array??
Message-Id: <f37kv4h1d2f4umo2tcgbh97vl0m2u1pam1@4ax.com>

On Wed, 29 Apr 2009 22:36:48 -0400, somebody <some@body.com> wrote:

>> The only duplicates I see are 'JR' in the last record.
>> If your data is this screwed up you need to eyeball the
>> data and forget about a computer program.
>> 
>> Btw, your half assed attempt at the obligatory sample code
>> won't even compile. WTF do *you* think you should do huh?
>> 
>> -sln
>
>
>You are a dimwit.  I posted the solution.  
>
>WAFA

Really? Thats the whole point. There is no solution,
I don't care *how* you slice & dice it.

Not only do the fields not contain intended information,
but you are actually splitting in-field words in an effort
to find *duplicates* of other field-part data that may or may
not be in the right position and may or may not be valid
or duplicate with a name dictionary that doesen't exist.

All you've done is make the same mistake twice.
You've put lipstick on a pig, a conceptual error thinking this
can be coded.

Your grade is F-

-sln


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

Date: Thu, 30 Apr 2009 19:37:57 -0400
From: somebody <some@body.com>
Subject: Re: How to find duplicate in certain fields of array??
Message-Id: <pan.2009.04.30.23.37.55.757252@body.com>

On Thu, 30 Apr 2009 15:06:01 -0700, sln wrote:

> Really? Thats the whole point. There is no solution,
> I don't care *how* you slice & dice it.
> 
> Not only do the fields not contain intended information,
> but you are actually splitting in-field words in an effort
> to find *duplicates* of other field-part data that may or may
> not be in the right position and may or may not be valid
> or duplicate with a name dictionary that doesen't exist.
> 
> All you've done is make the same mistake twice.
> You've put lipstick on a pig, a conceptual error thinking this
> can be coded.
> 
> Your grade is F-
> 
> -sln


The solution is already in use.  Conceptually, you're a goofball.




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

Date: Thu, 30 Apr 2009 16:49:15 -0700
From: sln@netherlands.com
Subject: Re: How to find duplicate in certain fields of array??
Message-Id: <06ekv4dpou7m1tdo8g1120qt6c7o6i2jao@4ax.com>

On Thu, 30 Apr 2009 19:37:57 -0400, somebody <some@body.com> wrote:

>On Thu, 30 Apr 2009 15:06:01 -0700, sln wrote:
>
>> Really? Thats the whole point. There is no solution,
>> I don't care *how* you slice & dice it.
>> 
>> Not only do the fields not contain intended information,
>> but you are actually splitting in-field words in an effort
>> to find *duplicates* of other field-part data that may or may
>> not be in the right position and may or may not be valid
>> or duplicate with a name dictionary that doesen't exist.
>> 
>> All you've done is make the same mistake twice.
>> You've put lipstick on a pig, a conceptual error thinking this
>> can be coded.
>> 
>> Your grade is F-
>> 
>> -sln
>
>
>The solution is already in use.  Conceptually, you're a goofball.
>

In use where and for what reason?

-sln


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

Date: Thu, 30 Apr 2009 18:24:39 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How to find duplicate in certain fields of array??
Message-Id: <rojkv4pcqs5sik7q0kcna2q22cu7sohauf@4ax.com>

somebody <some@body.com> wrote:
>On Thu, 30 Apr 2009 15:06:01 -0700, sln wrote:
[whatever]
>> -sln
>
>The solution is already in use.  Conceptually, you're a goofball.

Don't bother. Pretty much everyone has killfiled robic0 aka sln a _LONG_
time ago because of his antics.

jue


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

Date: Fri, 1 May 2009 04:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri May  1 2009
Message-Id: <KIy7qr.24pK@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-EdError-0.01
http://search.cpan.org/~jmates/Acme-EdError-0.01/
implements ed(1) error handling 
----
Catalyst-Authentication-AuthTkt-0.09
http://search.cpan.org/~karman/Catalyst-Authentication-AuthTkt-0.09/
shim for Apache::AuthTkt 
----
Catalyst-Authentication-Store-LDAP-0.1005
http://search.cpan.org/~karman/Catalyst-Authentication-Store-LDAP-0.1005/
Authentication from an LDAP Directory. 
----
Catalyst-Controller-WrapCGI-0.0034
http://search.cpan.org/~rkitover/Catalyst-Controller-WrapCGI-0.0034/
Run CGIs in Catalyst 
----
Catalyst-Plugin-Session-0.21
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Session-0.21/
Generic Session plugin - ties together server side storage and client side state required to maintain session data. 
----
Catalyst-Plugin-SmartURI-0.033
http://search.cpan.org/~rkitover/Catalyst-Plugin-SmartURI-0.033/
Configurable URIs for Catalyst 
----
CatalystX-CRUD-0.43
http://search.cpan.org/~karman/CatalystX-CRUD-0.43/
CRUD framework for Catalyst applications 
----
CatalystX-CRUD-Model-RDBO-0.20
http://search.cpan.org/~karman/CatalystX-CRUD-Model-RDBO-0.20/
Rose::DB::Object CRUD 
----
CatalystX-CRUD-ModelAdapter-DBIC-0.08
http://search.cpan.org/~karman/CatalystX-CRUD-ModelAdapter-DBIC-0.08/
CRUD for Catalyst::Model::DBIC::Schema 
----
CatalystX-RoleApplicator-0.004
http://search.cpan.org/~hdp/CatalystX-RoleApplicator-0.004/
apply roles to your Catalyst application-related classes 
----
DBIx-Class-0.08102
http://search.cpan.org/~ribasushi/DBIx-Class-0.08102/
Extensible and flexible object <-> relational mapper. 
----
DBIx-Class-DeleteAction-1.03
http://search.cpan.org/~maros/DBIx-Class-DeleteAction-1.03/
Define delete triggers 
----
DBIx-bind_param_inline-0.03
http://search.cpan.org/~davidnico/DBIx-bind_param_inline-0.03/
list variables in $dbh->prepare method instead of calling $sth->bind_param 
----
Encode-IMAPUTF7-1.04
http://search.cpan.org/~pmakholm/Encode-IMAPUTF7-1.04/
modification of UTF-7 encoding for IMAP 
----
File-AtomicWrite-0.90
http://search.cpan.org/~jmates/File-AtomicWrite-0.90/
writes files atomically via rename() 
----
GD-SecurityImage-1.69
http://search.cpan.org/~burak/GD-SecurityImage-1.69/
Security image (captcha) generator. 
----
GD-SecurityImage-1.70
http://search.cpan.org/~burak/GD-SecurityImage-1.70/
Security image (captcha) generator. 
----
Google-Chart-0.05014_01
http://search.cpan.org/~dmaki/Google-Chart-0.05014_01/
Interface to Google Charts API 
----
Gtk2-Ex-Entry-Pango-0.05
http://search.cpan.org/~potyl/Gtk2-Ex-Entry-Pango-0.05/
Gtk2 Entry that accepts Pango markup. 
----
HTML-FormHandler-0.21
http://search.cpan.org/~gshank/HTML-FormHandler-0.21/
form handler written in Moose 
----
HTML-Template-Convert-TT-0.01
http://search.cpan.org/~mbait/HTML-Template-Convert-TT-0.01/
Perl extension for blah blah blah 
----
Lingua-Any-Numbers-0.28
http://search.cpan.org/~burak/Lingua-Any-Numbers-0.28/
Converts numbers into (any available language) string. 
----
Lingua-Any-Numbers-0.29
http://search.cpan.org/~burak/Lingua-Any-Numbers-0.29/
Converts numbers into (any available language) string. 
----
Log-Dispatch-Dir-0.02
http://search.cpan.org/~sharyanto/Log-Dispatch-Dir-0.02/
Log messages to separate files in a directory, with rotate options 
----
Log-Dispatch-Scribe-0.01
http://search.cpan.org/~jjschutz/Log-Dispatch-Scribe-0.01/
Logging via Facebook's Scribe server software 
----
Math-Interpolator-0.002
http://search.cpan.org/~zefram/Math-Interpolator-0.002/
interpolate between lazily-evaluated points 
----
MooseX-Role-Strict-0.01
http://search.cpan.org/~ovid/MooseX-Role-Strict-0.01/
use strict 'roles' 
----
Muldis-D-0.66.0
http://search.cpan.org/~duncand/Muldis-D-0.66.0/
Formal spec of Muldis D relational DBMS lang 
----
Net-DNS-ZoneFile-Fast-1.11
http://search.cpan.org/~hardaker/Net-DNS-ZoneFile-Fast-1.11/
parse BIND8/9 zone files 
----
Object-Container-0.01
http://search.cpan.org/~typester/Object-Container-0.01/
simple object container 
----
Object-Container-0.01001
http://search.cpan.org/~typester/Object-Container-0.01001/
simple object container 
----
PHP-Session-DBI-0.23
http://search.cpan.org/~burak/PHP-Session-DBI-0.23/
Interface to PHP DataBase Sessions 
----
POE-Component-IRC-6.06
http://search.cpan.org/~hinrik/POE-Component-IRC-6.06/
A fully event-driven IRC client module 
----
POE-Component-IRC-Plugin-MegaHAL-0.21
http://search.cpan.org/~hinrik/POE-Component-IRC-Plugin-MegaHAL-0.21/
A PoCo-IRC plugin which provides access to a MegaHAL conversation simulator. 
----
PPI-PowerToys-0.12
http://search.cpan.org/~adamk/PPI-PowerToys-0.12/
A handy collection of small PPI-based utilities 
----
Padre-Plugin-Mojolicious-0.01
http://search.cpan.org/~garu/Padre-Plugin-Mojolicious-0.01/
Simple Mojolicious helper interface for Padre 
----
Padre-Plugin-PAR-0.05
http://search.cpan.org/~smueller/Padre-Plugin-PAR-0.05/
PAR generation from Padre 
----
Padre-Plugin-Perl6-0.35
http://search.cpan.org/~azawawi/Padre-Plugin-Perl6-0.35/
Padre plugin for Perl6 
----
Parse-RPN-2.47
http://search.cpan.org/~fdulau/Parse-RPN-2.47/
----
Parse-Readelf-0.04
http://search.cpan.org/~dorner/Parse-Readelf-0.04/
handle readelf's output with a class 
----
Perl-Dist-1.13
http://search.cpan.org/~adamk/Perl-Dist-1.13/
Perl Distribution Creation Toolkit 
----
Perl-Dist-1.14
http://search.cpan.org/~adamk/Perl-Dist-1.14/
Perl Distribution Creation Toolkit 
----
Perl-Dist-Strawberry-1.11
http://search.cpan.org/~adamk/Perl-Dist-Strawberry-1.11/
Strawberry Perl for win32 
----
Provision-Unix-0.53
http://search.cpan.org/~msimerson/Provision-Unix-0.53/
provision accounts on unix systems 
----
Rose-DBx-Object-Renderer-0.46
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.46/
Web UI Rendering for Rose::DB::Object 
----
SQL-Abstract-1.53
http://search.cpan.org/~mstrout/SQL-Abstract-1.53/
Generate SQL from Perl data structures 
----
Scalar-Number-0.003
http://search.cpan.org/~zefram/Scalar-Number-0.003/
numeric aspects of scalars 
----
Socket-Class-2.17
http://search.cpan.org/~chrmue/Socket-Class-2.17/
A class to communicate with sockets 
----
Template-Plugin-LinkTo-0.03
http://search.cpan.org/~hirafoo/Template-Plugin-LinkTo-0.03/
like link_to in Ruby on Rails 
----
Template-Plugin-LinkTo-0.04
http://search.cpan.org/~hirafoo/Template-Plugin-LinkTo-0.04/
like link_to in Ruby on Rails 
----
Template-Plugin-LinkTo-0.05
http://search.cpan.org/~hirafoo/Template-Plugin-LinkTo-0.05/
like link_to in Ruby on Rails 
----
Test-POE-Server-TCP-1.04
http://search.cpan.org/~bingos/Test-POE-Server-TCP-1.04/
A POE Component providing TCP server services for test cases 
----
Text-Template-Simple-0.79_01
http://search.cpan.org/~burak/Text-Template-Simple-0.79_01/
Simple text template engine 
----
Text-Template-Simple-0.79_02
http://search.cpan.org/~burak/Text-Template-Simple-0.79_02/
Simple text template engine 
----
Text-Template-Simple-0.79_03
http://search.cpan.org/~burak/Text-Template-Simple-0.79_03/
Simple text template engine 
----
Time-GPS-0.001
http://search.cpan.org/~zefram/Time-GPS-0.001/
Global Positioning System time 
----
Time-TAI-Now-0.002
http://search.cpan.org/~zefram/Time-TAI-Now-0.002/
determine current time in TAI 
----
Tree-Template-Declare-0.2
http://search.cpan.org/~dakkar/Tree-Template-Declare-0.2/
easily build tree structures 
----
Tree-Transform-XSLTish-0.2
http://search.cpan.org/~dakkar/Tree-Transform-XSLTish-0.2/
transform tree data, like XSLT but in Perl 
----
Video-FourCC-Info-1.1.3
http://search.cpan.org/~frequency/Video-FourCC-Info-1.1.3/
Find information about codecs from its FourCC 
----
Video-FourCC-Info-1.1.4
http://search.cpan.org/~frequency/Video-FourCC-Info-1.1.4/
Find information about codecs from its FourCC 
----
WebService-Nestoria-Search-1.14.8
http://search.cpan.org/~kaoru/WebService-Nestoria-Search-1.14.8/
Perl interface to the Nestoria Search public API. 
----
WordNet-SenseRelate-AllWords-0.18
http://search.cpan.org/~tpederse/WordNet-SenseRelate-AllWords-0.18/
Disambiguate All Words in a Text based on semantic similarity and relatedness in WordNet 
----
Yahoo-Marketing-APT-2.01
http://search.cpan.org/~shenj/Yahoo-Marketing-APT-2.01/
an interface for Yahoo! Search Marketing's APT Web Services. 
----
autobox-List-Util-20090429
http://search.cpan.org/~cowens/autobox-List-Util-20090429/
bring the List::Util functions to autobox 
----
jmx4perl-0.01_03
http://search.cpan.org/~roland/jmx4perl-0.01_03/
Access Modules to JMX (Java Management Extensions) 
----
oEdtk-0.41776w
http://search.cpan.org/~daunay/oEdtk-0.41776w/
A module for industrial printing processing 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Thu, 30 Apr 2009 13:41:37 -0700
From: sln@netherlands.com
Subject: Re: Perl 5.10.0 message: Undefined subroutine &main:: called at (re_eval 2) line 1.
Message-Id: <17qjv411aejiq86ojpqrg2dc4avhruoaun@4ax.com>

On Wed, 29 Apr 2009 20:14:09 -0400, Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid> wrote:

>In <1h2av4pson24nb95l4s25f284mfs8cl9dj@4ax.com>, on 04/26/2009
>   at 06:31 PM, sln@netherlands.com said:
>
>>There is another variable called $^N
>
>Thanks; that explains why I got the message; presumably the 0x0e in it was
>due to taking ^N as a control character rather than just part of the name.
>When I fixed it, $^N was uninitialized instead of containing the last
>match; I resolved that by adding capturing parentheses.
>
>I'm still not getting the expected output from
>
> extproc F:\PROGRAMS\PERL\bin\perl -STw
>
> require 5.10.0;     # must use a modern perl
> use strict;
> use Data::Dumper;

[snip]
>
>Instead I get
>
> v-string in use/require non-portable at H:\UTILITY/test5.10.0.cmd line 3.
> @match =$VAR1 = '1';
> $VAR2 = '1';
> $VAR3 = '12';
> $VAR4 = '12';
> $VAR5 = '123';
> $VAR6 = '123';
> $VAR7 = '254';
> $VAR8 = '254';
> $VAR9 = '255';
> $VAR10 = '255';
> $VAR11 = '56';
> $VAR12 = '56';
            ^^
>
[snip]
>
>I was expecting it to display each of the strings that it matched and to
>capture all of them because of the "g" options; instead the capture buffer
>seems to have only the last match and none of them are displayed. Also, I
>don't understand why I didn't get a warning about needing use re 'eval'.
>Finally, I expected the result to contain only one copy of each match, not
>2.
>

The reason it is not working is that you don't give the proper boundry
conditions in the *normal* part of the regexp. You actually need
/ \b (\d{1,3) \b/. So it is backtracking to find a match, first to
2 digits, then to 1. You didn't have it properly anchored.

The reason you are getting a dual captures is that you are capturing the same
thing twice. First in the $var = qr /(\d{1,3)/, then again in the NAMED capture.
So  @array = " ... " =~ /(?<OCT>$var)/ double captures the same value, even though
named captures (new) in the %+ hash only have one capture because of its nature.

I took the oportunity to install 5.10.1004 and peruse the extended constructs of
regexp. I don't think this would have worked in 5.8 because of the new backtracking
control verbs (ie: (*FAIL) in this case. It might be able to be done in a different
way though.

I personally think you went a little nuts here, desperately trying to make anything work.
You should to small steps first. And more important, read the documentation over (several
times) untill you understand how what you are trying to do, works.

Also, be carefull of code blocks and conditionals. For one, the parser is very particular
about the syntax, for another, its not interpolated. You won't be able to embed a compiled
reges into a code block. And the biggest thing is that you can't invoke the regex engine
inside of a code block insode of a regexp. It won't do that. For that reason, only
the most simple in-line stuff should be attempted if at all.

There are a lot of nice new regexp constructs with the 5.10 version that greatly
increases the power.

*enough rant*

The below example should make clear what you were doing wrong.

-sln

PS, 5.10 is on probation. The first sign of trouble, I'm renaming 5.8 back into
existance.


------------------------------------------------
output:
IP:
'1.12.123.254.255.256.4872'
  ++ matched single octets
     1
     12
     123
     254
     255
  -- no strict quad match
  -- no strict dressed quad match
IP:
'1.12.123.254'
  ++ matched single octets
     1
     12
     123
     254
  ++ matched quad #.#.#.#
     O1 = 1
     O2 = 12
     O3 = 123
     O4 = 254
  -- no strict dressed quad match
IP:
'[123.254.255.255]'
  ++ matched single octets
     123
     254
     255
     255
  -- no strict quad match
  ++ matched dressed quad [#.#.#.#]
     O1 = 123
     O2 = 254
     O3 = 255
     O4 = 255
-------------------------------------------
## IpMatch_5_10.pl
## (To test new Perl 5.10conditionals)
## 

require 5.10.0;     # 5.10 only, new extended regex
use strict;
use warnings;


my $Octlimit = 255;

my $OctetPat = qr/
                  \b (\d{1,3}) \b   # capture a 3 digit number on boundries

                    (?(?{                 # start conditional code block

                          # print "$^N\n";    # uncomment to print what matched last
                          $^N > $Octlimit     # condition: is number > octet limit ?

                        })                # end code block

                          (*FAIL)         # yes, condition is true, force pattern to fail for this number
                    )
                  /x;

my $dottedQuadPat = qr/  # Capture quad parts to named variables in the %+ hash
              \s*
                   (?<O1>$OctetPat)
                  \.
                   (?<O2>$OctetPat)
                  \.
                   (?<O3>$OctetPat)
                  \.
                   (?<O4>$OctetPat)
               \s*
             /x;

my $DressedIPv4Pat =  qr/  # Capture dressed quad parts to named variables in the %+ hash
              \s* \[
                     $dottedQuadPat
                  \] \s*
             /x;


while (my $ip = <DATA>)
{
	chomp $ip;
	next if !length($ip);
	print "IP:\n'$ip'\n";

	## Match all valid ip octets
	my @match = $ip =~/$OctetPat/g;
	if (@match)
	{
		print "  ++ matched single octets\n";
		for my $val (@match) {
			print "     $val\n";
		}
	} else {
		print "  -- no single octet matche\n";
	}

	## Match dotted quad ip
	if ($ip =~ /^$dottedQuadPat$/)
	{
		print "  ++ matched quad #.#.#.#\n";
		foreach my $key (sort keys %+) {
			print "     $key = $+{$key}\n";
		}
	} else {
		print "  -- no strict quad match\n";
	}

	## Match dressed dotted quad ip
	if ($ip =~ /^$DressedIPv4Pat$/)
	{
		print "  ++ matched dressed quad [#.#.#.#]\n";
		foreach my $key (sort keys %+) {
			print "     $key = $+{$key}\n";
		}
	} else {
		print "  -- no strict dressed quad match\n";
	}
}

__DATA__

1.12.123.254.255.256.4872
1.12.123.254
[123.254.255.255]



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

Date: Wed, 29 Apr 2009 19:37:11 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Perl is too slow - A statement
Message-Id: <49fa3687$0$7460$ed362ca5@nr5-q3a.newsreader.com>

Charlton Wilbur wrote:
>>>>>> "MV" == Michael Vilain <vilain@NOspamcop.net> writes:
> 
>     MV> Yes, companies can just "buy bigger computers" but at some
>     MV> point, that's a waste.  Guess you haven't gotten the memo that
>     MV> companies aren't buying new systems right now.  They want to
>     MV> extend the use of their systems another couple years.
> 
> Consider this scenario.
> 
> You go to your manager, and say, "We could develop this new project in
> C, which will take a team of six programmers six months, and we predict
> that it will require one server at a cost of $2000 to run.  Or we could
> develop it in perl, which will take a team of six programmers five
> months, but we predict that one server will not be sufficient at peak
> load, so we recommend two servers at $2000 each."

Did you account for the time needed to design this very complex system 
so that it could seamlessly and efficiently spread the load over two 
computers?  Or is that why Perl development is only 17% faster than C?


Xho


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

Date: Fri, 01 May 2009 00:55:15 +0100
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Perl is too slow - A statement
Message-Id: <j_SdnVlTh_n4p2fUnZ2dnUVZ8jKdnZ2d@pipex.net>

Nathan Keel wrote:
> 
> Or when any idiot can create an inefficient program that uses up all of
> the CPU and/or memory and/or system I/O and your theory about faster
> systems falls on its face.

Not necessarily.  That same idiot would make the same/similar mistakes in 
any faster language too.

>                             Plenty of people suck at coding and people
> also make mistakes (in code or the design) and these things just mean
> that it takes 20 minutes to crash a "faster" system, than the 5 minutes
> it takes for it to crash a slower system.

The real worry is when it doesn't crash at all but produces a result. If 
they suck at coding would *you* trust the result?  But would you *know* 
they suck?

-- 
              Just because I've written it doesn't mean that
                   either you or I have to believe it.


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

Date: Thu, 30 Apr 2009 16:56:04 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Perl is too slow - A statement
Message-Id: <pUqKl.1123$3k7.522@newsfe17.iad>

Xho Jingleheimerschmidt wrote:

> Charlton Wilbur wrote:
>>>>>>> "MV" == Michael Vilain <vilain@NOspamcop.net> writes:
>> 
>>     MV> Yes, companies can just "buy bigger computers" but at some
>>     MV> point, that's a waste.  Guess you haven't gotten the memo
>>     that
>>     MV> companies aren't buying new systems right now.  They want to
>>     MV> extend the use of their systems another couple years.
>> 
>> Consider this scenario.
>> 
>> You go to your manager, and say, "We could develop this new project
>> in C, which will take a team of six programmers six months, and we
>> predict
>> that it will require one server at a cost of $2000 to run.  Or we
>> could develop it in perl, which will take a team of six programmers
>> five months, but we predict that one server will not be sufficient at
>> peak load, so we recommend two servers at $2000 each."
> 
> Did you account for the time needed to design this very complex system
> so that it could seamlessly and efficiently spread the load over two
> computers?  Or is that why Perl development is only 17% faster than C?
> 
> 
> Xho

I agree, though it can depend on how the balancing solution is
implemented, as it could be done in a short amount of time.  This is
assuming the program exists, else it would be odd to plan on something
that would be a less efficient choice (and that's certainly a "maybe"
and can depend anyway).  Also, planning for a lot of processing might
require either language choice to use some balancing solution (even
across many servers).

However, my honest opinion in the real world, is that most programmers
in Perl or C aren't the best out there, so the comparisons really
likely don't make a lot of sense in the real world, but given two
quality programmers going head to head, I have seen real world
experience that C isn't that much longer to develop in and the speeds
*should* be faster.  Since most programmers aren't that great, you
probably have to throw more processing power at the problem anyway.

But, all things being (theoretically equal) and with that all said, I
have plenty of efficient Perl code that I've created and ran for over a
decade and don't need to change it to C just for an increase in speed,
though for some projects I'd like to get around to that at some point. 
In fact, I also might just opt to do a load balanced solution instead
of going the C route, if it could solve it, but I'd sure plan to get
time to re-work it for C if it was that busy.  Just saying this
apparently offends some people, but I really don't care if people think
I'm "going too far" by being a speed/efficiency freak.  I've seen
people react poorly in the same ways about security designs when
developing and they think there are easier or better ways to deal with
the problem, than to actually just code securely (and I'm serious).

In the end, if I ever told someone that I was contracted to program for
them, or my employer that, "if you want it to run better or faster, get
faster systems", I'd have been quickly ripped a "new one" or fired, and
definitely lost the respect of the people I was on the same programming
team with.  Obviously there are a lot of variables involved and if you
have an existing program (especially if it's really involved) that's
complete or nearly complete in Perl, then it's proabably better to get
a faster system or do some load balancing or something similar, instead
of re-doing it all in C and waiting, but I am bothered when people get
so worked up when someone suggests that you should never plan to bother
with C because Perl is good enough and you can just upgrade systems. 
Say that at an interview and see how many people agree, too.  Again,
I'm not saying everything or even anything in particular should be done
in C instead, but I don't get what the big hoopla is with some people
about it.


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

Date: Thu, 30 Apr 2009 16:58:32 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Perl is too slow - A statement
Message-Id: <JWqKl.1144$3k7.33@newsfe17.iad>

Big and Blue wrote:

> Nathan Keel wrote:
>> 
>> Or when any idiot can create an inefficient program that uses up all
>> of the CPU and/or memory and/or system I/O and your theory about
>> faster systems falls on its face.
> 
> Not necessarily.  That same idiot would make the same/similar mistakes
> in any faster language too.

Yes, that is 100% true, but this was about comparing speed/efficiency of
the language choice.  Certainly, a lot of variables could be also
considered to alter the view, but all things being equal, the point
would be valid.

> 
>>                             Plenty of people suck at coding and
>>                             people
>> also make mistakes (in code or the design) and these things just mean
>> that it takes 20 minutes to crash a "faster" system, than the 5
>> minutes it takes for it to crash a slower system.
> 
> The real worry is when it doesn't crash at all but produces a result.
> If
> they suck at coding would *you* trust the result?  But would you
> *know* they suck?

Yes, I'd know, because I'd be reviewing the code and changes.  Sure,
there's more than speed issues, there are bugs and security issues as
well.  The point was about the topic matter though.




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

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 V11 Issue 2383
***************************************


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