Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How can you check if a word in a array occur in another array?

by Anonymous Monk
on Nov 29, 2012 at 09:06 UTC ( #1006205=note: print w/replies, xml ) Need Help??


in reply to How can you check if a word in a array occur in another array?

This is FAQ, perlfaq4
  • Comment on Re: How can you check if a word in a array occur in another array?

Replies are listed 'Best First'.
Re^2: How can you check if a word in a array occur in another array?
by ashish20092009 (Novice) on Nov 29, 2012 at 11:54 UTC
    your code is write just remove the last code part::::::what are u doing here in last part. take a look : #!/usr/bin/perl -w use strict; use warnings; use utf8; open (INPUT, "<:utf8", "short.txt") or die "can't open"; open (INPUT2, "<:utf8", "woordelysEng.txt") or die "can't open"; open (OUTPUT, ">output.txt") or die "can't open"; my @words; my @EN; while (<INPUT>) { my $word = $_; chomp $word; @words = split(/ /, $word); } while (<INPUT2>) { my $word = $_; chomp $word; @EN = split(/ /, $word); } for(my $z = 0; $z <= $#EN; $z++) { for(my $y = 0; $y <= $#words; $y++) { if($EN$z eq $words$y) { print OUTPUT "$EN$z\n"; } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006205]
help
Chatterbox?
[LanX]: several people told me they like saigon. ..
[choroba]: well, beer is good here, surprisingly
[choroba]: also, I discovered several vegan/vegetarian restaurants, so I can avoid meat
[LanX]: ha ha ... happy Czech :)
[choroba]: been to the War Remnants Museum, too. Quite a brutal experience
[choroba]: but still, small-talk about smuggling guns and how Trump is great with US expats isn't my cup of tea
[LanX]: brutal beer?
[LanX]: met a Canadian yesterday, he suggested building a wall and let the US pay for it

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-02-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (371 votes). Check out past polls.