DanielM0412 has asked for the wisdom of the Perl Monks concerning the following question:
using a 4 by 4 file as input, but the data dumper just shows $var1 = []; ive been looking at it for a while now, and i am completely clueless on what the problem is, do yall see anything? thanks in advance, heres the code
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my $filepath = "OP.txt"; my $olddata = readdt2($filepath); print Dumper($olddata); sub readdt2 { my $ifn = shift; open(my $IFH, "<$ifn") or die "cannot open file $ifn\n"; my $line; my @nt = qw(A C T G); my @ret; my @tmp; for (my $j=0; $j<=$#tmp; $j++) { $ret[$nt[$j]] = []; $line = <$IFH>; chomp($line); @tmp = split(/\s+/,$line); for (my $i=0;$i<=$#tmp;$i++) { $ret[$nt[$j]][$i]= $tmp[$i] +0.0001; } } close($IFH); return(\@ret); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: data dumper not showing anythin
by moritz (Cardinal) on Aug 01, 2011 at 16:11 UTC | |
by DanielM0412 (Acolyte) on Aug 01, 2011 at 16:28 UTC | |
by jethro (Monsignor) on Aug 01, 2011 at 17:08 UTC | |
by DanielM0412 (Acolyte) on Aug 01, 2011 at 21:10 UTC |