Paste-bin.xyz
Archive
Sign In
Login
Register
Username
Current Password
Keep me signed in.
Username
Full Name
Email
New Password
PERL
22
dict search
Guest on 30th April 2022 11:47:11 PM
#!/usr/bin/perl -w
my
(
$name
,
$junk
)
;
open
(
PW
,
"</usr/share/dict/words"
)
||
die
"No open da file"
;
while
(
$line
=
<PW>
)
{
$found
{
$name
}
=
1
;
}
while
(
$in
=
<STDIN>
)
{
if
(
defined
(
$found
{
$in
}
)
)
{
print
"yes
\n
"
;
}
else
{
print
"no
\n
"
;
}
}
for
$name
(
sort
keys
%found
)
{
print
"Word $name
\n
"
;
}
Raw Paste
#!/usr/bin/perl -w my($name, $junk); open(PW, ") { $found{$name} = 1; } while ($in =
) { if (defined($found{$in})) { print "yes\n"; } else { print "no\n"; } } for $name (sort keys %found) { print "Word $name\n"; }
Login
or
Register
to edit or fork this paste. It's free.