[tpm] How to find my class name

Fulko Hew fulko.hew at gmail.com
Fri Mar 18 12:08:17 PDT 2011


On Fri, Mar 18, 2011 at 11:47 AM, Shlomi Fish <shlomif at iglu.org.il> wrote:
> Hi,
>
> a few comments on your code.
>
> On Friday 18 Mar 2011 16:42:27 Fulko Hew wrote:
>> I have the following (simplified, and artificial) scenario:
>>
>> package testClass;
>
> 1. A package should always start with an uppercase letter.
>
> 2. You should add "use strict;" and "use warnings;" somewhere.

I _did_ say it was an artificial scenario!

The code I was showing was an interpretation of code
that is actually programatically generated by my tool,
but... I did take your advise.

a) I added the strict and warning to the code generator's output,
    and although the generated code worked before, It did uncover
   some issue that makes my code generator output better
   ('more correct').

b) The package names generated are actually derived from the name
   of a 'thing' in the source file that the code generator consumes.

   I wanted the package name to be directly compatible with the
   source so that it was more intuitive to the user (relate-able).

   After reading words around the naming convention on packages,
   I decided that Perl pragma safety was more important than
   end-user intuitiveness, and so I now up-case the first letter
   of the input to generate the package name.

Fulko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20110318/fafe70c6/attachment.html>


More information about the toronto-pm mailing list