in reply to Re: Simple iteration problem
in thread Simple iteration problem

I used your suggestions to create the following script, which is still not quite right. It spits out all of the values in tab[0], whether or not they meet the criterion of the difference in $seed minus $tab[0] being greater than 0.1 I removed the use warnings and strict, just for the moment.
#!/usr/bin/perl open TAB, '<', 'test.txt' or die "Cannot open 'test.txt' $!"; <TAB>; $seed = 1.04; while (<TAB>){ @tab = split ' '; $diff = $tab[0] - $seed; if ($diff >= 0.1) {print "@tab\n"; $seed eq $tab[0]} else {next}; }

Replies are listed 'Best First'.
Re^3: Simple iteration problem
by roboticus (Chancellor) on Nov 29, 2007 at 16:51 UTC
    Gah!!

    I removed the use warnings and strict, just for the moment.
    Why, oh why would you do that?

    <tongue_in_cheek>

    Are you trying to make debugging more "interesting" by hiding clues from yourself?

    If so, don't bother reading about "use diagnostics" which may make debugging even less interesting!

    </tongue_in_cheek>

    ...roboticus

Re^3: Simple iteration problem
by toolic (Bishop) on Nov 29, 2007 at 14:59 UTC