I am very confused as to what this thing is supposed to do!
I ran just the first part of the code and this is what I get.
The n array is not multi-dimensional. There is not data in that array anyway in this first loop. $x[$n[$j]][$j] doesn't make sense to me.
Update: I guess $x[$n[$j]//=0][$j] = $column[$j]; "works", but I still don't quite get it.
#! /usr/bin/perl use warnings; use strict; use Data::Dumper; my @n=0; my @x; my $j; my $i; my $dg; my @x_jack; my @x_tot=0; my $cols; my $col_start=0; # read in the data while(<DATA>) { my @column = split(); $cols=@column; foreach my $j ($col_start .. $#column) { $x[$n[$j]][$j] = $column[$j]; $x_tot[$j] += $x[$n[$j]][$j]; $n[$j]++; } } print "\n"; print "THE X ARRAY IS\n"; foreach my $rowref (@x) { print "@$rowref\n"; } print "\n"; print "THE N ARRAY IS:\n"; print "@n"; =PRINTS: Use of uninitialized value within @n in array element at line 22, <DAT +A> line 1. Use of uninitialized value within @n in array element at line 23, <DAT +A> line 1. Use of uninitialized value within @n in array element at line 22, <DAT +A> line 1. Use of uninitialized value within @n in array element at line 23, <DAT +A> line 1. Use of uninitialized value within @n in array element at line 22, <DAT +A> line 1. Use of uninitialized value within @n in array element at line 23, <DAT +A> line 1. THE X ARRAY IS 1.1 2.1 3.1 4.1 1.2 2.2 3.2 4.2 1.3 2.3 3.3 4.3 1.4 2.4 3.4 4.4 THE N ARRAY IS: 4 4 4 4 =cut __DATA__ 1.1 2.1 3.1 4.1 1.2 2.2 3.2 4.2 1.3 2.3 3.3 4.3 1.4 2.4 3.4 4.4

In reply to Re: Calculate jackknife error from of each column of a multi-column file by Marshall
in thread Calculate jackknife error from of each column of a multi-column file by pyari_billi

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.