find2perl 
Author Message
 find2perl

Hi folks,

I've been teaching people about the wonders of File::Find lately, and
happened to try out find2perl.  Here's a simple example of what I was doing:

        yt:~> find2perl . -name "*.pl" -print
        #!/usr/bin/perl

                if $running_under_some_shell;

        require "find.pl";

        # Traverse desired filesystems

        &find('.');

        exit;

        sub wanted {
            /^.*\.pl$/ &&
            print("$name\n");
        }

Now, why doesn't it use File::Find directly instead of find.pl?  The
wanted subroutine is useful, of course, but the rest of it generates more
questions than answers when I'm trying to teach people.

TBH, this isn't a real question, it's just a grumble.  But if someone were
to give me a) a good reason, b) an alternative, or c) AU$2000 to fly to
YAPC, I'd certainly stop grumbling.

OK, I don't really expect to get $2000.  It was worth a try.

K.

--

"Does anybody have a 10 foot pole that I can not touch this with?"
        -- Christian Bauernfeind in a.s.r



Sat, 03 Nov 2001 03:00:00 GMT  
 find2perl

Quote:
> Hi folks,

> I've been teaching people about the wonders of File::Find lately, and
> happened to try out find2perl.  Here's a simple example of what I was doing:

<snip>

> Now, why doesn't it use File::Find directly instead of find.pl?  The
> wanted subroutine is useful, of course, but the rest of it generates more
> questions than answers when I'm trying to teach people.

A cursory glance at find2perl indicates that it possibly hasnt been
changed since 1993.  It is the same find2perl that came with Perl 4
basically.

/J\
--



Mon, 05 Nov 2001 03:00:00 GMT  
 find2perl

Quote:

>A cursory glance at find2perl indicates that it possibly hasnt been
>changed since 1993.  It is the same find2perl that came with Perl 4
>basically.

OK, since this seems to be the main answer I've got, here's some trivial
changes to make it more perl5-ish.  Probably need more stuff to make the
whole thing perl 5, though :)

yt:~> diff /usr/bin/find2perl ./find2perl
10a11,16

Quote:
> #
> # Further modified May 1999, to use File::Find rather than find.pl

> #   Netizen Pty Ltd
> #

246c252
< require "$find.pl";
---
Quote:
> use File::Find;

250c256
< &$find($roots);
---

Quote:
> $find(\\&wanted, $roots);

I probably won't have time to go through it in any more depth than that.  
Anyone else want to do it?

K.

--

Life imitates satire.



Sat, 10 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. diff <(find / -mount |find2perl) <(find / |find2perl) # no diffs?

2. difficulty with find2perl

3. find2perl library interferes with buffered output?

4. find2perl and GNUish find

5. perl5a11 find2perl bug

6. find2perl which understands the -follow option

7. Problem with find2perl

8. find2perl

9. Bug in find2perl

10. find2perl -size no work

11. Bug in find2perl with fix

12. find2perl doesn't follow symbolic links

 

 
Powered by phpBB® Forum Software