You can't expect to tell the difference between the size of an array (such as '3'), and a plain old number (such as '3').

Again: I can tell the difference between scalar and an array, but just not for constants.

You're still missing the point ... I marked it for you, to make it clearer:

DB<4> sub tst (\[$@]) { print ref $_[0] } DB<5> $a="a";@a=(1..3) DB<6> tst $a SCALAR DB<7> tst @a ARRAY DB<8> tst "a" # <--------- that's the point ! Type of arg 1 to main::tst must be one of [$@] (not constant item) at +(eval 12)[/usr/share/perl/5.10/perl5db.pl:638] line 2, at EOF

Cheers Rolf


In reply to Re^6: Prototype for constant items??? by LanX
in thread Prototype for constant items??? by LanX

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.