|
Posted by Jürgen Exner on May 21, 2008, 8:27 am
Please log in for more thread options >[A complimentary Cc of this posting was NOT [per weedlist] sent to
>Jürgen Exner
>> >[A complimentary Cc of this posting was NOT [per weedlist] sent to
>> >Jürgen Exner
>> >> use strict; use warnings;
>> >> use File::Find;
>> >> sub wanted{print "$_\n" if length>26;}
>> >> find(\&wanted, '.');
>> >
>> >Wrong. You do not want to use $_ there (or use 'nochdir').
>>
>> Why? The docs say
>> "$_" [contains] the current filename
>> As far as I can tell that's exactly what the OP asked for: filenames
>> longer than 26 characters.
>
>Try it.
I did.
>It is not good to give to print() -
print() has no problems with that value. It prints the filename just
fine.
> it will be no longer
>"current enough", since current directory is "wrong".
I have no idea what you are trying to say.
>> >Better, use
>> > pfind . "length > 26"
>>
>> C:\tmp>perldoc -f pfind
>> No documentation for perl function `pfind' found
>
>use it anyway. ;-)
Bareword "pfind" not allowed while "strict subs" in use at c:\tmp\t.pl
line 3.
Execution of c:\tmp\t.pl aborted due to compilation errors.
>Hope this helps,
Sorry, it didn't.
jue
|