- or download this
my @in;
while (<>) {
push @in, $1 if /(\$[A-Za-z_]\w*)/;
}
- or download this
while (<>) {
push @in, /(\$[A-Za-z_]\w*)/g;
}
- or download this
my %hsh;
@hsh{@in} = ();
print $_, $/ for keys %hsh;
- or download this
my %hsh;
@hsh{ /(\$[A-Za-z_]\w*)/g } = () while <>;
delete $hsh{''}; # tidy up
print $_, $/ for keys %hsh;