Try the following:
$spec{V20} = { delete_code => 1, ... ordered => 5 };
Note the braces around the hash instead of the parens. You get this error when you use parentheses around a list reference instead of square or curly brackets.

The square or curly brackets turn list values into scalar values, while parentheses do not. A parenthesized list, when evaluated in scalar context, throws away the left argument(s). If you had printed your value, you would see that it equals '5', instead of being a hash.

Oddly enough ;), if you picked up Programming Perl, this is explained in the back under

Useless use of %s in void context.
My explanation above is almost verbatim.

Cheers,
Ovid

Update: still laughing my head off (ha, ha, thump) at merlyn's response :)

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re: useless use of a constant in a void context? by Ovid
in thread useless use of a constant in a void context? by princepawn

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.