Are you saying a slice is less clear than spelling out the pointer with each element?

I don't think I emphasized the point clearly enough -- the above was a transitory debug line put in to look at those values. I didn't want a loop or supporting routines... just wanted to print. Pe is a shortcut routine all in of itself, It' alternate of P, which prints to STDOUT by default (or to a string, in string context). Auto traps/handles undef's in printed args and auto deals with linefeed (adds as final char going to a file handle if needed).

Each item I am printing is a 'class variable' and all of those subs are 'accessor routines'...writing additional routines just to print the value of accessor routines is way overkill for a debug statement.

It's all about easy of programming... computers were designed to be the servants of humans -- not the otherway around.

I just thought a slice like statement where each accessor is called off the same pointer would be more clear than retyping the accessor 5 times. Aren't we supposed to avoid duplication in code?

Sorry if I was unclear, but I did try to stress it was only debugging code.


In reply to Re^2: slice of ptr-based-output routines? by perl-diddler
in thread slice of ptr-based-output routines? by perl-diddler

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.