Could you please tell me where I can find out about the syntax of the 

@subset{@subset} = ();

line? I see what it does (only by printing out the %subset hash after the line is 
run), but I
don't think I've ever seen this construction documented. Particularly, how does an 
item get placed
in a hash by using an lvalue which is a standard array using the @ sign? I also have 
to start
learning more about and using grep. This is a very elegant solution, and one I would 
never have
thought of. Thanks, Philip!

--Chuck

--- "Newton, Philip" <[EMAIL PROTECTED]> wrote:

> Oh, you wanted an answer? :) There's one in the FAQ above; here's another
> one:
> 
>     # Assume your two arrays are @main and @subset
>     my %subset;
>     @subset{@subset} = ();
>     @main = grep !exists $subset{$_}, @main
> 
> Cheers,
> Philip


__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to