
BillKSmith
Veteran
Mar 17, 2012, 12:47 PM
Post #3 of 3
(522 views)
|
|
Re: [gerble1000] simple little mod needed for my code with grep
[In reply to]
|
Can't Post
|
|
Refer to the /i option of m/PATTERN/ in perldoc perlop. Good practice demands several other changes. Use the three argument form of open. Ref: perldoc -f open Use lecical file handles. (open my $F, '<', contacts.txt) Always check for errors in open. The second close is not needed, if fact is wrong. Use qr{} rather than double quotes to build your regular expression
my $this = qr{$username,$password}i; my @f = grep $this, @list; Good Luck, Bill
|