Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I very much agree with "once and only once", my origins as a programmer were steeped in Asm and C. I realized quickly how it sucked cutting and pasting code (or making changes), then hunting down all the errors I cut and pasted. But on the other hand, I do a lot of CGI and including a dozen odd modules (and there includes) can quickly kill response time. (mod_perl isn't always an option.)

I'm not advocating people not use modules, but for myself, when it is something like this, were it amounts to a a few lines of code, I tend to keep it in a snippet file and cut and paste it into the source. In the simplest form..
sub add { my ($self,$name,$value) = @_; return if $name !~/^\w+$/; my $pack = ref $self; no strict 'refs'; *{$pack.'::'.$name} = sub : lvalue { $Attrs{+shift}->{$name} }; }
seems extreme for a module. On the other hand, if your attributes are more complex it could easily become worthy of using a module.

And yes I was confusing you with the poster, my bad.


"To be civilized is to deny one's nature."

In reply to Re: Re: Re: Re: Re: A different OO approach by shotgunefx
in thread A different OO approach by fruiture

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-07-04 21:35 GMT
Find Nodes?
    Voting Booth?

    No recent polls found