Also, strict won't complain if you fully qualify the package variables. For example:

% perl -le 'use strict; $x = 1; print $x' Global symbol "$x" requires explicit package name at -e line 1. Global symbol "$x" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. % perl -le 'use strict; $main::x = 1; print $::x' 1
strict nixed the first one-liner, but the second one worked fine.

In your case you can use $main::INPUT, or, taking advantage of the special treatment given to the main package, you can also use $::INPUT (I used both forms of qualification in the second one-liner, for the sake of illustration).

But I concur with nobull that you should read perlmod so that you better understand Perl5's module scheme. (Good follow-up reading after perlmod are perltoot and perlobj.)

Update: One more thing about strict: if you want to bypass it, instead of postponing the use strict line until after the last place in the code that make it complain (as you did in auth.pl), the thing to do is to turn strict off in a block set up for the purpose, like this:

use strict; # ... code under strict { # strict-free block no strict; $nya_nya = 1; } # ... code under strict
You will often see this sort of thing, especially the more limited version of it, such as:
use strict; sub foobar { print "hello from foobar\n" } my $sub_name = 'foobar'; { no strict 'refs'; $sub_name->(); } __END__ hello from foobar
This example is certainly contrived, but it is common to run into real cases in which you have the name of a sub or a method in a string, and you want to be able to execute it; one way to do it is to switch off strict 'refs' in a narrow scope. As you can see, in the absence of strict's surveillance, perl will interpret the string 'foobar' as if it were a reference to the subroutine foobar. (Without the no strict 'refs' line you'd get a compile time error: Can't use string ("foobar") as a subroutine ref while "strict refs" in use....)

the lowliest monk


In reply to Re: using strict setup by tlm
in thread using strict setup by tanger

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.