http://www.perlmonks.org?node_id=108218


in reply to OK... I am confused and lost :( Editing FlatFile

use strict and warnings (-w). Consider using an array or a hash instead of all those variable names. E.g.:
my @fields = qw(position institution dept etc); for my $rec (@records) { chomp $rec; my %old; @old(@fields} = split /\t/, $rec; if ($old{position} != $viewposition) { print join("\t", @old{@fields}),"\n"; } else { ... } }

Replies are listed 'Best First'.
Re: Re: OK... I am confused and lost :( Editing FlatFile
by LostS (Friar) on Aug 27, 2001 at 22:50 UTC
    Thanks for the kick in the head... found the issue... :)


    -----------------------
    Billy S.
    Slinar Hardtail - Guildless
    Datal Ephialtes - Guildless
    RallosZek.Net Admin/WebMaster
    Aerynth.Net Admin/WebMaster

    perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'