CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Comparing Arrays please help

 



triveni1125
New User

Jan 13, 2010, 10:47 AM

Post #1 of 2 (425 views)
Comparing Arrays please help Can't Post

use strict;
use warnings;
my @fruits = ('orangoue','apple','pear','banana');
my @varlist = ('banana','spinach','apple');

Hi,

I want to compare the two arrays fruits and varlist and if the values of varlist are in fruits array then build a new array whichh doesnot have values of varlist.

Can someone please how can I do this?




(This post was edited by triveni1125 on Jan 13, 2010, 10:50 AM)


toolic
User

Jan 13, 2010, 4:28 PM

Post #2 of 2 (411 views)
Re: [triveni1125] Comparing Arrays please help [In reply to] Can't Post

You could use a hash. The following FAQ should give you some ideas:


Code
perldoc -q array


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives