My GEDCOM file has 5,174 lines in it, and the code below is intended to print out each line on the screen.

Each line contains a string of alphanumeric characters The only problem is, the output display starts at line # 723 and goes right through to the end. Even the count number is not shown as the first line of output of this code.

I use Padre as my Perl editor and compiler, and the results of 'run' are shown on the screen c:\Dwimper\perl\bin\perl.exe You can see an image of that screen here:
http:\\www.dasq.com.au\perl
If I change the counter to show only the first 20 records, then they all show correctly, including the records count number.

Would anyone like to comment on why this is so, please?

regards to all you generous Monks. Be gentle.
Jill

#!/usr/bin/perl use strict; use warnings; my $file_in = "C:/Users/Joe/Documents/Genealogy/birdt.ged"; open my $FILE, "<", $file_in or die "could not open $file_in $!"; + # three-argument open syntax my @ged = <$FILE>; # slurp the file contents into + @ged my $count = $.; print "no. of records: $count \n" ; # counting the number of recor +ds my $i=0; # stepping through the array $ +count = 5174 for ($i= 0; $i<$count; $i=$i+1) {print "$i $ged[$i]\n"; }

In reply to Array size too big? by JillB

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.