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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|