On Sep 10, Stephen said: >> find( { >> wanted => \&wanted, >> preprocess = \&preprocess, >> postprocess = \&postprocess, >> }, 'C:/SomeFolder'); > >Starting to make sense. Just a small question, though. The use of \& >before the sub name -- my understanding is that the "\" character is >used as an escape, the "&" character defines a sub (but is regularly >omitted), and the format for calling a sub is "sub_name ()" rather than >"&sub_name ()". If that's correct, why is "\&" being used in the hash?
Outside of strings, \ is used to take a reference to something. We don't want to CALL the wanted(), preprocess(), and postprocess() functions when building the hash, we just want the values in the hash to be the places to FIND the functions to call. The find() function expects references to functions, so it can call them later. sub foo { print "Hi, $_[0]!\n" } my $ref_to_foo = \&foo; $ref_to_foo->("Jeff"); -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]