Re: getting the most efficient ways

2005-08-16 Thread John Doe
Beast am Dienstag, 16. August 2005 13.29: > I have these following arrays : > > @employees = (); # has 1000 elements > @managers = (); # has 100 elements > @staffs = (); # employees - managers > > I have @employees and @managers in hand, what is the most efficient ways > to print @staffs? > > So fa

Re: getting the most efficient ways

2005-08-16 Thread Beast
Beast wrote: As you can see, the step will increase as the number of manager increase. Sorry, it should be: foreach my $emp (@employees) { foreach my $mgr (@managers) { if ($mgr eq $emp) { print "$emp is Manager\n"; next; } print "$emp is Staff\n";

getting the most efficient ways

2005-08-16 Thread Beast
I have these following arrays : @employees = (); # has 1000 elements @managers = (); # has 100 elements @staffs = (); # employees - managers I have @employees and @managers in hand, what is the most efficient ways to print @staffs? So far this is what I've done. ... foreach my $emp (@employe