use warnings; sub argscan{ if ($#ARGV == 1) {return (0)}

All in all, what a mess! First, I'm confused by your indenting style. Then you miss the important

use strict;

line. And last (for these three lines), you write a sub to work on the global @ARGV variable. Subs are for having args passed into them. It may not that bad to have it like this, instead, but as a general rule it's not that nice a programming technique. And subs are typically for factorizing code that is to be applied in different situations, but if that's for cmd line arguments scanning, that code may well not be factorized away.

As far as the rest goes, I have the overall impression that you're doing far too much work, but I don't feel like trying to guess your task. May you describe in words what your script is supposed to do? We may offer a hopefully simpler alternative as a starting point to you...


In reply to Re: Confused by blazar
in thread Confused about 'Name "main::whenfound" used only once:' by Maze

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.