in reply to error:Global symbol "$stopwords" requires explicit package
#!/usr/bin/perl use strict; # declare the variables my $stopwords = "word"; my @data = qw( a word another and a verb a noun a phrase); my @lessWords; foreach my $word (@data) { if ($stopwords !~ / $word /) { push @lessWords, $word; } } print "@lessWords\n";
|
|---|