[22874] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5095 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 8 14:05:44 2003

Date: Sun, 8 Jun 2003 11:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 8 Jun 2003     Volume: 10 Number: 5095

Today's topics:
    Re: an alias for multiple 'use's <s.patterson@freeuk.com>
    Re: an alias for multiple 'use's <grazz@pobox.com>
    Re: and if I killed this programmer *I'd* go to jail.. <bobx@linuxmail.org>
    Re: and if I killed this programmer *I'd* go to jail.. <gmiller@NOTforSPAM.gregmiller.net>
        Perl and Java <noemail@test.com>
    Re: Perl and Java <julian@avbrief.com>
    Re: Perl and Java <grazz@pobox.com>
    Re: Perl and Java (Tad McClellan)
    Re: Perl exam - fair or not? <usenet@expires082003.tinita.de>
        Perldoc formatting on Linux <tony@sequeira.com>
    Re: Perldoc formatting on Linux <spam@thecouch.homeip.net>
    Re: Perldoc formatting on Linux (David Efflandt)
        Problem installing XML-DOM 1.42 for perl 5.8.0 <rocky-beach@web.de>
        Question about a counter. <mail@annuna.com>
    Re: Question about a counter. (Tad McClellan)
    Re: Strange errors with huge hash <flavell@mail.cern.ch>
    Re: Strange errors with huge hash (Tad McClellan)
    Re: Strange errors with huge hash (Tad McClellan)
    Re: Strange errors with huge hash <bob@nowhere.com>
    Re: Strange errors with huge hash (Tad McClellan)
    Re: Strange errors with huge hash (Tad McClellan)
    Re: Strange errors with huge hash <uri@stemsystems.com>
    Re: Strange errors with huge hash <flavell@mail.cern.ch>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 8 Jun 2003 10:42:41 GMT
From: Stephen Patterson <s.patterson@freeuk.com>
Subject: Re: an alias for multiple 'use's
Message-Id: <slrnbe64p0.1nq.s.patterson@localhost.localdomain>

On Sat, 7 Jun 2003 19:02:07 -0400, Nate Blaylock wrote:
> In just about every package & program I write, I use a bunch of the same 
> stuff, some perl modules and some of my own:

> I would like to be able to shortcut all of that and do something like use 
> a single package which would be equivalent to doing the long version 
> above.  E.g.,
> 
> use MyStuff::BasicUses;

You should be able to do this by writing a Package file
MyStuff::BasicUses (which would have to be saved in @INC)

Package MyStuff::BasicUses

use Coy;
use Carp qw/croak cluck/;
 ...
use Whatever;

and then load that from your main file with "use MyStuff BasicUses";

-- 
Stephen Patterson http://www.lexx.uklinux.net http://patter.mine.nu
steve@SPAM.lexx.uklinux.net  remove SPAM to reply        
Linux Counter No: 142831 GPG Public key: 252B8B37        
Last one down the pub's an MCSE


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

Date: Sun, 08 Jun 2003 14:16:04 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: an alias for multiple 'use's
Message-Id: <EyHEa.46206$ca5.22033@nwrdny02.gnilink.net>

Stephen Patterson <s.patterson@freeuk.com> wrote:
> On Sat, 7 Jun 2003 19:02:07 -0400, Nate Blaylock wrote:
>> In just about every package & program I write, I use a bunch 
>> of the same stuff, some perl modules and some of my own:
>> 
>> I would like to be able to shortcut all of that and do 
>> something like use a single package which would be equivalent 
>> to doing the long version 
> 
> You should be able to do this by writing a Package file
> MyStuff::BasicUses (which would have to be saved in @INC)
> 
> Package MyStuff::BasicUses
> 
> use Coy;
> use Carp qw/croak cluck/;
> ...
> use Whatever;
> 
> and then load that from your main file

That won't do the import correctly -- croak() and cluck() 
will get imported into MyStuff::BasicUses instead of into 
the calling package where he needs them.

We could fix this by leaving out the package declaration,
but if the OP wants to use the standard set of modules from,
e.g., a top-level script *and* some other module, then he'd
need an import() subroutine.

    Package MyStuff::BasicUses
    require Coy;
    require Carp;

    sub import {
        my $pkg = shift;
        Coy ->export_to_level(1, $pkg);
        Carp->export_to_level(1, $pkg, qw(croak cluck));
    }

Lexically-scoped pragmas like 'strict' and 'warnings' can't
be handled this way, however.  Since each source file gets
its own lexical scope, you have to use() them in every file.

-- 
Steve


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

Date: Sun, 08 Jun 2003 16:57:43 GMT
From: "Bob X" <bobx@linuxmail.org>
Subject: Re: and if I killed this programmer *I'd* go to jail..
Message-Id: <bWJEa.320$Hw.413171@news2.news.adelphia.net>

"Sara" <genericax@hotmail.com> wrote in message
news:776e0325.0306050958.319bfc19@posting.google.com...
> This is one of the less ugly examples what I've inherited from my
> "ancestral" programmers here. I think he must have had a C-to-Perl
> script he ran to produce his Perl Code..
>
> 805:       for($i=0;$i<=$#g_INFO;$i++){
> 806:          if($g_INFO[$i][$x_ID] ne $id){  next; }
> 807:          @tmp1 = split(/;/,$g_INFO[$i][$_TEXT]);
> 808:          for($j=0;$j<=$#tmp1;$j++){
> 809:             $tmp1[$j] =~ s/^(\s)*//g;
> 810:             @tmp2 = split(/,/,$tmp1[$j]);
> 811:             if($tmp2[0] == $level){  return "$tmp2[1]";     }
>

I speak for all us Perlites who strive to make clean readable Perl code:

KILL HIM NOW!!!




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

Date: Sun, 08 Jun 2003 17:59:41 GMT
From: Greg Miller <gmiller@NOTforSPAM.gregmiller.net>
Subject: Re: and if I killed this programmer *I'd* go to jail..
Message-Id: <l9u6ev4ud2q7etll6dr83pmjqds8g7miut@4ax.com>

On 6 Jun 2003 15:04:46 -0700, djberg96@hotmail.com (Daniel Berger)
wrote:

>I dunno how much it'll help with your project as a whole, but there's
>always perltidy.  Might cut down your time in rehab, if not keep you
>out of it. :)

	I gave it a try:

localhost:[~]$perltidy crap.pl
Error parsing crap.pl: STOP! IT HURTS!!!!!

Greg Miller (gmiller at gregmiller dot net)
http://www.gregmiller.net
http://www.net-chess.com


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

Date: Sun, 8 Jun 2003 14:41:40 +0100
From: "Dave" <noemail@test.com>
Subject: Perl and Java
Message-Id: <G2HEa.3750$0d7.111221@newsfep4-glfd.server.ntli.net>

Hi,

I would be interested in creating a Java program that would be able to read
in a Perl dbm database, and display the contents in a Java Swing GUI.

Is it possible to create a wrapper of any sort that would allow the Java
program to make a call to the Perl program ( to read a specified database ),
which would then pass the data (say in a text format) to the Java program,
which could then process it and display it in the Swing GUI ?

AFAIK there is no direct support for Perl dbm databases in Java?

There are also other reasons why I would like to do the GUI in Java and not
Perl TK.

Thanks




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

Date: Sun, 8 Jun 2003 15:42:59 +0100
From: "Julian Scarfe" <julian@avbrief.com>
Subject: Re: Perl and Java
Message-Id: <NXHEa.1457$LP.1158@newsfep4-winn.server.ntli.net>

"Dave" <noemail@test.com> wrote in message
news:G2HEa.3750$0d7.111221@newsfep4-glfd.server.ntli.net...

> AFAIK there is no direct support for Perl dbm databases in Java?

Do

http://aurora.rg.iupui.edu/~schadow/dbm-java/
http://sourceforge.net/projects/solinger/

not help? DBM is not exclusively Perl.

> There are also other reasons why I would like to do the GUI in Java and
not
> Perl TK.

You'd have to be a pretty extreme Perl advocate to prefer the latter for
most cross-platform or portable applications.

Julian




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

Date: Sun, 08 Jun 2003 14:43:29 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Perl and Java
Message-Id: <lYHEa.46292$ca5.621@nwrdny02.gnilink.net>

Dave <noemail@test.com> wrote:
> I would be interested in creating a Java program that would be 
> able to read in a Perl dbm database, and display the contents 
> in a Java Swing GUI.

What kind of file is it?  The Perl DBM modules are just wrappers
around different C libraries, and you don't need Perl to read and
write the files.  You just need the C library.

Some of the DBMs (Berkeley, at least) provide Java bindings, which
might make things easier on you.

> There are also other reasons why I would like to do the GUI in 
> Java and not Perl TK.

Mysterious!

Good luck
-- 
Steve


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

Date: Sun, 8 Jun 2003 10:07:31 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl and Java
Message-Id: <slrnbe6k9j.f2b.tadmc@magna.augustmail.com>

Dave <noemail@test.com> wrote:

> AFAIK there is no direct support for Perl dbm databases in Java?


AFAIK there is no "Perl dbm databases", only "dbm databases".

That is, it does not matter what programming language was used
to create the DBM files.

Create them with a Perl program and read them with a Java program.


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


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

Date: 8 Jun 2003 13:09:06 GMT
From: Tina Mueller <usenet@expires082003.tinita.de>
Subject: Re: Perl exam - fair or not?
Message-Id: <bbvchi$9np5n$1@ID-24002.news.dfncis.de>

anon wrote:
> 47. Which of the following is true about constructors in Perl? 
>  (a) Used to create and initialize an object into a class. 
>  (b) The constructor method must be named "new". 
>  (c) The constructor method is an instance method. 
>  (d) The constructor method is a class method. 

> correct answers: a, d

constructor method *can* also be an instance method, i'd say.
there's no problem calling $object->new()

i found this test a little bit confusing, as others have pointed out
already. there are some more questions where i would give no
answer because none of them is correct, or where the question
itself is not correct.
some questions are just subjective ("what is the best method"
depends in many cases on the circumstances.)

so back to your question: i think the test is unfair =)

-- 
http://www.tinita.de/     \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/   \     / _` / _ \/ _ \ '_(_-< of
http://www.perlquotes.de/   \    \ _,_\ __/\ __/_| /__/ perception
- my mail address expires end of august 2003 -


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

Date: Sun, 08 Jun 2003 14:21:33 +0100
From: "S. Anthony Sequeira" <tony@sequeira.com>
Subject: Perldoc formatting on Linux
Message-Id: <pan.2003.06.08.13.21.30.401292@supernova.sequestor.lan>

Hi all,

$ perl -v
 
This is perl, v5.8.0 built for i686-linux

perldoc doesn't seem display doc pages correctly.  I have tried a few
things, including changing the terminal type.  It still behaves the same
for TERM = linux, vt100 and xterm.  nroff is available (symlink to groff).

I can use -t to display as text, but would like a solution if available.

I can only find one reference to this in my research:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=b3kukr%241lvsrb%241%40ID-75561.news.dfncis.de&rnum=31&prev=/groups%3Fq%3Dperldoc%26hl%3Den%26lr%3D%26ie%3DUTF-8%26start%3D30%26sa%3DN

but, it's in German, and I only speak/read English :-(

This is what I get with a $ perldoc perl

PERL(1)               User Contributed Perl Documentation              PERL(1)
 
 
 
ESC[1mNAMEESC[0m
       perl - Practical Extraction and Report Language
 
ESC[1mSYNOPSISESC[0m
       ESC[1mperl ESC[22m[ ESC[1m-sTuU ESC[22m] [ ESC[1m-hv ESC[22m] [ ESC[1m-V
ESC[22m[:ESC[4mconfigvarESC[24m] ]


Any ideas.

Cheers
-- 
Tony



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

Date: Sun, 08 Jun 2003 11:58:13 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: Perldoc formatting on Linux
Message-Id: <w2JEa.1692$zZ4.31306@wagner.videotron.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

S. Anthony Sequeira wrote:
> Hi all,
> 
> $ perl -v
>  
> This is perl, v5.8.0 built for i686-linux
> 
> perldoc doesn't seem display doc pages correctly.  I have tried a few
> things, including changing the terminal type.  It still behaves the same
> for TERM = linux, vt100 and xterm.  nroff is available (symlink to groff).
> 
> I can use -t to display as text, but would like a solution if available.
> 
> I can only find one reference to this in my research:
> 
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=b3kukr%241lvsrb%241%40ID-75561.news.dfncis.de&rnum=31&prev=/groups%3Fq%3Dperldoc%26hl%3Den%26lr%3D%26ie%3DUTF-8%26start%3D30%26sa%3DN
> 
> but, it's in German, and I only speak/read English :-(
> 
> This is what I get with a $ perldoc perl
> 
> PERL(1)               User Contributed Perl Documentation              PERL(1)
>  
>  
>  
> ESC[1mNAMEESC[0m
>        perl - Practical Extraction and Report Language
>  
> ESC[1mSYNOPSISESC[0m
>        ESC[1mperl ESC[22m[ ESC[1m-sTuU ESC[22m] [ ESC[1m-hv ESC[22m] [ ESC[1m-V
> ESC[22m[:ESC[4mconfigvarESC[24m] ]
> 
> 
> Any ideas.

The ESC[xyz stuff are ANSI escape sequences.  They're supposed to be caught by your terminal 
emulator and acted on (move cursor, clear screen, change color, bold, etc...) not displayed.

What terminal emulator software are you using ?  And does it accept ANSI escape sequences ?

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+410ceS99pGMif6wRAg/HAJ4vwLxNVQO1tRZ46VQoU5LfeZwKFwCg5Sod
ZVnI5eFBIPwO7ALLJXjW3XI=
=7seT
-----END PGP SIGNATURE-----



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

Date: Sun, 8 Jun 2003 17:29:13 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Perldoc formatting on Linux
Message-Id: <slrnbe6sj9.du1.efflandt@typhoon.xnet.com>

On Sun, 08 Jun 2003, S. Anthony Sequeira <tony@sequeira.com> wrote:
> Hi all,
> 
> $ perl -v
>  
> This is perl, v5.8.0 built for i686-linux
> 
> perldoc doesn't seem display doc pages correctly.  I have tried a few
> things, including changing the terminal type.  It still behaves the same
> for TERM = linux, vt100 and xterm.  nroff is available (symlink to groff).
> 
> I can use -t to display as text, but would like a solution if available.

Something is converting the ANSI escape sequences to text instead of
passing them on as escape sequences.  Which Linux distro and did it always
do that or did or did you change something?  Do you have a similar problem
with 'man perl' or color 'ls' output?  What is your PAGER?

Are you on a local console or xterm that matches your TERM, or remote
ssh|telnet|serial connection (Linux or other OS on remote?)?

I have never seen that problem with any perldoc on Linux, Solaris, FreeBSD
or NetBSD.  My most recent Perl in SuSE 8.2:

This is perl, v5.8.0 built for i586-linux-thread-multi

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Sun, 08 Jun 2003 15:20:57 +0200
From: Detlev Beiderbeck <rocky-beach@web.de>
Subject: Problem installing XML-DOM 1.42 for perl 5.8.0
Message-Id: <bbvd9u$rij$00$1@news.t-online.com>

Hello,

trying to install module XML-DOM fails:


Installation of XML::Parser v2.31 is okay.

First error appears in testing XML::Parser::PerlSAX:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" 
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/amsterdam...........ok
t/canon_xml_writer....ok
t/schema..............ok
t/stream..............FAILED test 11
         Failed 1/11 tests, 90.91% okay
t/subs................ok
t/xp_sax..............ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/stream.t                11    1   9.09%  11
Failed 1/6 test scripts, 83.33% okay. 1/45 subtests failed, 97.78% okay.
make: *** [test_dynamic] Error 29
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Ignoring this the nex problem occurs in test XML-DOM 1.42:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
~/install/XML-DOM-1.42 > make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" 
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/build_dom...........ok
t/dom_astress.........ok
t/dom_attr............ok
t/dom_cdata...........ok
t/dom_documenttype....ok
t/dom_encode..........ok
t/dom_example.........ok
t/dom_extent..........ok
t/dom_jp_astress......ok
t/dom_jp_attr.........ok
t/dom_jp_cdata........ok
t/dom_jp_example......ok
t/dom_jp_minus........ok
t/dom_jp_modify.......ok
t/dom_jp_print........FAILED test 2
         Failed 1/3 tests, 66.67% okay
t/dom_minus...........ok
t/dom_modify..........ok
t/dom_noexpand........ok
t/dom_print...........ok
t/dom_template........ok
t/dom_text............ok
Failed Test      Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/dom_jp_print.t                3    1  33.33%  2
Failed 1/21 test scripts, 95.24% okay. 1/129 subtests failed, 99.22% okay.
make: *** [test_dynamic] Error 29
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Finally ignoring the errors during testing, my perl script aborts
with this message:
syntax error at line 2, column 64, byte 109 at 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/XML/Parser.pm line 185

Any idea?

Best Regards
Detlev



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

Date: Sun, 08 Jun 2003 11:20:47 -0500
From: Joe Creaney <mail@annuna.com>
Subject: Question about a counter.
Message-Id: <3EE3625F.2010002@annuna.com>

I realize this a bit off topic but I wrote a counter that works I just 
want to access it from my web page.  How do I do it.  This is the only 
command I have:

<!--#exec cgi="/cgi-bin/count1.pl" -->

Is this right?



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

Date: Sun, 8 Jun 2003 12:18:23 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Question about a counter.
Message-Id: <slrnbe6ruv.f81.tadmc@magna.augustmail.com>

Joe Creaney <mail@annuna.com> wrote:

> I realize this a bit off topic


No, it is a completely unrelated topic, it does not belong here.

If your program was written in Python or Java the answer
would be the same.


><!--#exec cgi="/cgi-bin/count1.pl" -->


Ask questions about web stuff in one of the newsgroups about web stuff.


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


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

Date: Sun, 8 Jun 2003 15:10:34 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Strange errors with huge hash
Message-Id: <Pine.LNX.4.53.0306081505570.25378@lxplus002.cern.ch>

On Sat, Jun 7, Michael G. inscribed on the eternal scroll:

> "Cargo cult code" is pretty clear to me, but what do you mean by
> "Matt-factor?" Enquiring minds want to know...

I think this web page puts it more diplomatically than I could myself:

http://nms-cgi.sourceforge.net/


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

Date: Sat, 7 Jun 2003 22:15:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Strange errors with huge hash
Message-Id: <slrnbe5aj2.6rg.tadmc@magna.augustmail.com>

emcee <res1uzbe@verizon.net> wrote:
> Tad McClellan wrote:
>> emcee <res1uzbe@verizon.net> wrote:


>>>		s/'/\'/g;
>> 
>> That does not change anything, so why bother writing it?

>> That code might be useful in the winter, since the cycles
>> may have the effect of keeping your feet warm, but it is summer(ish).
> 
> What part exactly is so inefficent?


It burns CPU cycles yet changes nothing.


> source, it seems no more efficent than my code.


Your code was missing the backslash. I commented regarding the
code that I could actually see.


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


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

Date: Sat, 7 Jun 2003 22:17:16 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Strange errors with huge hash
Message-Id: <slrnbe5als.6rg.tadmc@magna.augustmail.com>

emcee <res1uzbe@verizon.net> wrote:

> Who said I was a beginner?  


Your code spoke for you.


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


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

Date: Sun, 08 Jun 2003 08:54:22 -0500
From: bob <bob@nowhere.com>
Subject: Re: Strange errors with huge hash
Message-Id: <3ee33fff$1_1@127.0.0.1>

On Sat, 07 Jun 2003 11:53:38 -0500, emcee wrote:

> 
> I'm talking about remote shared hosting, with services such as powweb or
> tripod.  Even if I could install my own module, they wouldn't let me.
> 

If you can put your scripts into a directory, you may be able to put
modules into the same directory and get them to work.


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


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

Date: Sun, 8 Jun 2003 09:13:56 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Strange errors with huge hash
Message-Id: <slrnbe6h54.f07.tadmc@magna.augustmail.com>

emcee <res1uzbe@verizon.net> wrote:
> Alan J. Flavell wrote:
>> On Sun, Jun 8, emcee inscribed on the eternal scroll:

>>>I've looked through the Data::Dumper
>>>source, it seems no more efficent than my code.
>> 
>> 
>> Rule number 1 of programming is "don't optimise yet".


The OP is lacking in some Computer Science fundamentals, and seems
resistant to changing that situation.


>> Getting the right answer is important.  Doing it fast is _usually_
>> of secondary importance.  Very few computer applications _need_ to be
>> efficient at runtime.  All of them need to be efficient in terms of
>> developer time.


> I agree I shouldn't optimise first, but the nonoptimised version would 
> just use Data::Dumper, and since that obviously would work, I guess I'm 
                                        ^^^^^^^^^^^^^^^^^^^^
> ready to move on to optimisation.


That is not the test that you apply to determine if you must
do optimization.

The test to apply is:

   The non-optimized version *has been shown* to be "too slow".

ie. You do profiling/benchmarking to see if the first try is 
    "good enough" before taking on the additional task of
    making it compile (or run) faster.


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


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

Date: Sun, 8 Jun 2003 09:34:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Strange errors with huge hash
Message-Id: <slrnbe6ic6.f07.tadmc@magna.augustmail.com>

emcee <res1uzbe@verizon.net> wrote:
> Uri Guttman wrote:
>>>>>>>"e" == emcee  <res1uzbe@verizon.net> writes:
>> 
>> 
>>   e> Who said I was a beginner?  


That is obvious to an expert. Since you cannot see it, you are
likely not an expert. You can become more expert if you take
the benefit of the expert's experience and training, or you can
stay where you are by ignoring advice from folks that know more
than you do.


>>   e> I wrote it and it worked fine right from the first run,


No it didn't.

It has bugs, as has been shown elsewhere in this thread.

It may be that you did not _notice_ the bugs yet, but they are
there nonetheless. Your test suite is deficient, since it did
not expose those bugs.


>>   e> exception of this one situation, 


There are other situations that you appear to be (as yet) unaware of.

We are doing our best to make you aware, but you seem determined
to not advance yourself.


>>   e> which wasn't an issue of me not
>>   e> grasping some concept or something,


You are a self-taught programmer. Yes?

Nothing wrong with that[1], but you must recognize that you must
*seek out* information that has been force-fed to those who've
followed a specified curriculum.

Teaching yourself is fine, but it will be harder than taking a
formal course of study. ie. you must expend more effort to become
a professional-grade programmer than a college student does.

One way of getting the benefit of a formal course of study is to
have someone who _has_ done it to summarize for you what they've learned.

But it won't help you if you refuse it when it is offered.


>> i saw many general errors in your code but since you know better i won't
                                              ^^^^^^^^^^^^^^^^^^^^^
>> correct them.


The OP has an attitude that will limit his becoming a better programmer.


>> use Data::Dumper ;


> Alright fine, next time you need to save a hash, you can go ahead and 
> use Data::Dumper, I will use my module 


I give up. Into the scorefile you go:

   % too clueless to be helped in 3 minutes
   Score:: -9998
           From: res1uzbe@verizon.net



> because it meets the criteria:
> 
> A: It does what I need it to do.


No it doesn't. It has bugs. 

It has been reviewed by only one person.

It has been run on only one website.

The more a module is used, the more likely it is that bugs will
be discovered.


> B: It's more efficent than the alternative.


Efficiency doesn't matter much if it does not even work correctly.

Your code also burns cycles to no effect, which is bad efficiency-wise.

So your module does not do either of the 2 things you claim!


Data::Dumper has been reviewed by dozens/hundreds of people.

Data::Dumper has been run on thousands and thousands of differing
environments.

Bugs in Data::Dumper are nearly guaranteed to be discovered quickly,
and repaired by a Real Programmer.



[1] My boss is self-taught and can program circles around 
    college-educated me.

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


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

Date: Sun, 08 Jun 2003 15:19:00 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Strange errors with huge hash
Message-Id: <x7n0gstx5n.fsf@mail.sysarch.com>

>>>>> "TvP" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:

  TvP> Also sprach Uri Guttman:
  >>>>>>> "TvP" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:
  >> 
  TvP> So even if he is reinventing the wheel: What is so wrong when the
  TvP> OP asks why his reinvention doesn't work? He can naturally use
  TvP> Data::Dumper and he is in fact advised to do so. Still, he has
  TvP> provided some code (finally) and he'll surely benefit if a few
  >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                  
  >> 
  TvP> regulars of this group have a look at it and make some
  TvP> suggestions.
  >> 
  >> that says it all.

  TvP> Hmmh, I can't quite follow you now. What does that say?

after all of his whining about the group not helping and his bitching
about how much better his code is than data::dumper, he finally posted
the generating code. and now he is getting coding help. i agree with
your coding comments and his code could be dramatically simplified but i
am not in the mood to do it.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Sun, 8 Jun 2003 18:20:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Strange errors with huge hash
Message-Id: <Pine.LNX.4.53.0306081815030.25378@lxplus002.cern.ch>

On Sun, Jun 8, bob inscribed on the eternal scroll:

> On Sat, 07 Jun 2003 11:53:38 -0500, emcee wrote:
>
> > I'm talking about remote shared hosting, with services such as powweb or
> > tripod.  Even if I could install my own module, they wouldn't let me.
>
> If you can put your scripts into a directory, you may be able to put
> modules into the same directory and get them to work.

Indeed; but you'd only do that _after_ verifying that the module
in question is not already available as a standard part of the
perl installation  ;-}

For example at http://www.perldoc.com/perl5.8.0/lib.html

I seem to have missed making that point in my earlier posting on this
thread - for which, due apologies!

all the best

-- 

      ISO-8859-1 is one of two charsets appropriate for use in
      Western Europe (the other is ISO-8859-15).  The US has not
      been politically part of Europe for nearly 227 years.  - Mark Crispin


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

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


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