ok so I reread your post. I made some changes to the way I open the file handles. I'm still getting one error.
#!/usr/bin/perl use strict; use warnings; #use diagnostics; if (@ARGV = 2){ my %delList; open my $BEEPON, '>>', "./beepon.file" || die "Can't open beepon.f +ile $!"; open my $BEEPOFF, '>>', "./beepoff.file" || die "Can't open beepof +f.file $!"; open my $DELLIST, '<', $ARGV[0] || die "Can't open $ARGV[0] $!"; foreach (<$DELLIST>){ chomp($_); $delList{$_} = 1; } close $DELLIST; open my $ORGLIST, '<' , $ARGV[1] || die "Cant open $ARGV[1] $!"; foreach my $entry (<$ORGLIST>){ chomp($entry); print { exists $delList{$entry} ? $BEEPON : $BEEPOFF } $entry +. "\n"; } close $BEEPON; close $BEEPOFF; }
here are the resulting errors:
$./delete_list_ver3.pl test.list test_master.1 readline() on closed filehandle $DELLIST at ./delete_list_ver3.pl line + 12. Use of uninitialized value $ARGV[1] in concatenation (.) or string at +./delete_list_ver3.pl line 17. Cant open Bad file descriptor at ./delete_list_ver3.pl line 17.
WTF???
as far as the BeepOn Vs BeepOff are concerned... Not very descriptive taken out of context are they.
this is part of a bigger project that generates a config file for an asterisk conference bridge. I often find it necessary to move ID's from one list to the other, and this is the result.
honestly the boss is happy from the first iteration of this code; I'm not because I am interested in learning Perl, and learning how to use Perl effectively and efficiently, and this seems like a good learning project, (at least I've learned alot I think) and progressing my perl abilities will help me not only professionally but academically as well.
For the record I really appreciate your help all along the way.
In reply to Re^6: Search and Remove
by PyrexKidd
in thread Search and Remove
by PyrexKidd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |