in reply to Re: divide one file into multiple arrays
in thread divide one file into multiple arrays
I'll have to remember to upvote that one when I get a new load of votes :).
You can make the bad_hash straightaway with map :
Which would be my %isBad = map { $_ => 1 } @sites; for tevus_oriley. And with the hash values being 1, you can just write if ( $isBad{$www} ) instead of if (exists $isBad{$www})my %isBad= map { $_ => 1 } qw/ www.yahoo.com www.google.com www.comcast.com /;
Edit : Whoops, posted too fast, chomp returns the number of chomped elements, not the chomped list.
|
---|
In Section
Seekers of Perl Wisdom