I notice you cat the script. I was using vi editor to write that script. Does that mean I can't use vi editor to write my script when it comes to Find command? I had #!/usr/bin/perl -w on top of my script but didn't type in above, but still got that error message.
your (or anyone's) first question would've been - "huh?? what the heck is f27.pl ?"
By displaying
(a) the script content and then
(b) the execution of the script
I've tried to make the testcase complete. You see the script first and then you see it in action.
In fact, in most cases, the input (which was left out here) should also be included. So then you have:
(1) the input
(2) the algorithm/program
(3) the output
to complete the picture.
My post tries to tell you - "here's my homegrown script that I've named f27.pl and here is what I see when I execute it... so it works fine on my system...".
Of course, that is just a guide, an indication. Just because it works on my system doesn't mean it would work on yours. Quite possibly, a million things could be different on your system. Different doesn't mean wrong. It means just that - different; nothing more, nothing less. Taking that post as the directive, the onus of finding out what's different is on you.
I understood your script above- your code named f27.pl and then you run it by perl f27.pl to get the output below it.
What got me confused was I wrote the same code above using vi editor- vi f27.pl, then the code, and then I go perl f27.pl and I got the message "Not a CODE reference..."
I'm just wondering if I can use vi editor when it comes to File::Find command?