in reply to Re: Operator held in scalar/array element
in thread Operator held in scalar/array element

Thank you this also works perfectly. Can I just clarify why in the method/subroutine I need the index to $_. I tried it without and it doesn't work. "sub { -e $_ }" instead of "sub { -e $_[0] }". Why does the file parameter need to be referenced as index[0]?
  • Comment on Re^2: Operator held in scalar/array element

Replies are listed 'Best First'.
Re^3: Operator held in scalar/array element
by ikegami (Patriarch) on May 07, 2009 at 00:00 UTC
    sub { -e $_[0] }
    is short for
    sub { my ($file) = @_; -e $file }

    I hope that clarifies things.

Re^3: Operator held in scalar/array element
by AngryKumquat (Initiate) on May 06, 2009 at 23:40 UTC
    Sorry. Don't worry about that secondary question. My brain has gone to bed before my body. Thanks for the help.