in reply to Why chomp doesn't work?
Others said why chomp doesn't do what you want.
Here is a workaround that should do what you expect in Windows and Unix:
#!/usr/bin/perl -w use strict; my @words; open FH, "banned.txt" or die "can't open\n"; { local $/; my $bannedwords = <FH>; close FH; eval "\@words = qw($bannedwords)"; }
HTH
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why chomp doesn't work?
by calin (Deacon) on Jun 13, 2004 at 18:05 UTC | |
Re^2: Why chomp doesn't work?
by bart (Canon) on Jun 14, 2004 at 13:41 UTC |
In Section
Seekers of Perl Wisdom