If you look at the code snippet I posted, you'll see that I did not redirect the output of "find" to /dev/null -- as pointed out in the other replies above, that's why your array remained empty.
One other point: now that you're pushing entries into an array, you'll probably want to use chomp -- e.g. like this:
open(my $find,"|-:utf8","find /usr/local/bin -type f") or die "find fa
+iled: $!\n";
while( <$find> ){
chomp;
push @array, $_;
}
or leave out the while loop and chomp the whole array, like this:
open( my $find, ... ) # (same as above, without redirecting to "/dev/n
+ull")
my @array = <$find>; # reads all lines into array
chomp @array; # strips linefeeds from all array elements