Zo has asked for the wisdom of the Perl Monks concerning the following question:
I am just reading the above file, if all matches, then print out to an error file that the info is already there. if doesn't match, print unmatched to the above file and set the variabe $trans_code to 'true'. when opening Tracking at beginning of program, it is opened with >> for appending. All variables are global.0246801357;12345678;000425 # aba, acct, time
This subroutine is called in the script by &table; Is there something missing? I've tried calling with &table();, I've put the last variable initialized in a return statement -- return($trans_code_valid).. how to make it work, help please.. thanks in advance... i'm learning (atleast i used code tags in this posting!) Zosub table{ seek(TRACKING, 0, 0); while (defined($t_table = <TRACKING>)){ chomp($t_table); @trk = split(/;/, $t_table); if (($trk[0] == $aba) && ($trk[1] == $acct) && ($trk[2 +] == $time)) { print ERROR "ABA:$aba\tAccount:$acct\t$time already in +table\n"; } else { print TRACKING "$aba;$acct;$aba\n"; $trans_code = "true"; } # end else / if } # end while tracking } # end sub table
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: nonworking subroutine
by chromatic (Archbishop) on Oct 17, 2000 at 00:21 UTC | |
by Zo (Scribe) on Oct 17, 2000 at 00:36 UTC | |
by lhoward (Vicar) on Oct 17, 2000 at 00:47 UTC | |
by Zo (Scribe) on Oct 17, 2000 at 18:41 UTC | |
by chromatic (Archbishop) on Oct 18, 2000 at 08:54 UTC |