If you're a beginner (and even if you're not), it's almost always a good idea to  usewarnings; and  usestrict; in all your scripts. Take a look at the warnings (not errors) below and try to fix them, then come back for more enlightenment.

c:\@Work\Perl\monks\Sellerzzz>type text line 1 second line line the third c:\@Work\Perl\monks\Sellerzzz>perl -e "use warnings; use strict; ;; my @sig; ;; print \"Enter file name: \n\"; my $file = <STDIN>; chomp $file; ;; open (INPUT, $file) || die(\"Could not find $file\"); while (my $line = <INPUT>) { push @sig, <INPUT>, $_; for (my $i; ($i<=scalar @sig); $i++){ for (my $j=($i+1); ($j<=scalar@sig); $j++){ print \"@sig[$j]\n\"; } } close; } " Scalar value @sig[$j] better written as $sig[$j] at -e line 1. Enter file name: text Use of uninitialized value $i in numeric le (<=) at -e line 1, <INPUT> + line 3. Use of uninitialized value $i in addition (+) at -e line 1, <INPUT> li +ne 3. line the third Use of uninitialized value $sig[2] in join or string at -e line 1, <IN +PUT> line 3. Use of uninitialized value in join or string at -e line 1, <INPUT> lin +e 3. Use of uninitialized value $sig[2] in join or string at -e line 1, <IN +PUT> line 3. Use of uninitialized value in join or string at -e line 1, <INPUT> lin +e 3. Use of uninitialized value in join or string at -e line 1, <INPUT> lin +e 3.
I have taken out the use of Text::CSV_XS in the example code since it adds nothing to the point I want to make. BTW: congratulations on the use of a nice Short, Self Contained, Correct (Compilable), Example; pursue the problems it highlights and you will be well on your way to wisdom.


Give a man a fish:  <%-{-{-{-<


In reply to Re: For loop abortions by AnomalousMonk
in thread For loop abortions by Sellerzzz

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.