Hi Mayhem50

Perl treats $INPUT{$field} as a hash variable. without using stricts it works because it will lexically create a variable called %INPUT inside the sub. So it would work well without using strict. When you use strict , we need to explicitly declare the variable.So be sure what data type you would want to use. if you need a scalar $INPUT then remove $INPUT{$field}=$Value; as this is not the right way to store a value in scalar. Else if you want to store a vector ie hash then declare your variable as my %INPUT=(); and also remove the return $INPUT statement.

NOTE: FYI %INPUT and $INPUT are two different varibales and can coexist. so you can declare  my ($INPUT,%INPUT);

Thanks
SasiKumar

In reply to Re: Use Strict & subs by sasikumar
in thread Use Strict & subs by Mayhem50

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.