Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^6: Search and Remove

by PyrexKidd (Monk)
on Jun 26, 2010 at 00:16 UTC ( #846625=note: print w/replies, xml ) Need Help??

in reply to Re^5: Search and Remove
in thread Search and Remove

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:

$./ test.list test_master.1 readline() on closed filehandle $DELLIST at ./ line + 12. Use of uninitialized value $ARGV[1] in concatenation (.) or string at +./ line 17. Cant open Bad file descriptor at ./ line 17.


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.

Replies are listed 'Best First'.
Re^7: Search and Remove
by PyrexKidd (Monk) on Aug 23, 2010 at 22:14 UTC


    You ever have an issue and it's as simple as a missing `=` ?

    This line: if (@ARGV = 2){

    Should be: if (@ARGV == 2){ Talk about a n00b mistake. Grrr...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://846625]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-05-24 10:32 GMT
Find Nodes?
    Voting Booth?