Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default skip path prune

    How do you use the prune function to skip a printing all of the
    contents of a folder? It will not print folder 3 but does print the
    contents of folder 3 which I do not want printed.

    #!C://Perl/bin/perl
    use CGI ':standard';
    use CGI::Carp 'fatalsToBrowser';
    #use strict;
    use warnings;
    use File::Find;
    my $file_count = 0;
    my $dir_count = 0;


    $title = "Find Files";
    print header,
    start_html($title),
    h1($title);

    find ( {
    wanted => \&wanted}, 'C:/Documents and
    Settings/whatever/Desktop/test');

    printf "\nThere are %d files in %d directories.\n",
    $file_count,
    $dir_count;

    sub wanted {

    if (-d) {

    print $File::Find::name, "\n" unless -d =~ /^folder3/;

    $dir_count++;
    }

    elsif (-f _) {
    print " <TR> <TD ALIGN=RIGHT>File name is
    $File::Find::name</TD></TR><BR></BR>";


    $file_count++;

    }
    }


    end_hmtl;

    weberw@adelphia.net Guest

  2. Similar Questions and Discussions

    1. Skip record set results
      Hi, just wondering if anyone knows a simple way to filter out the 1st 5 records in a record set. I'm trying to get a page to display the 1st 5...
    2. RIS - skip auth. proces
      Hi there, is there any way to skip the authentication on the beginning of a RIS installation proces ??? regards, Christian
    3. Skip to chapter...
      Being a great one for learning things from the middle on out, I would like to make a button in Flash MX for my plain-HTML website. I'm familiar...
    4. Delay/Skip Rollover
      I have a menu bar, with a delayed rollover action. That keeps the user from activating another button by cutting corners. There is one problem...
    5. [PHP] htmlentities -- can it skip tags
      Justin French wrote: You'll have to build one. If you know what characters are causing trouble, you could just use str_replace on them. Or...
  3. #2

    Default Re: skip path prune

    [email]weberw@adelphia.net[/email] wrote:
    > How do you use the prune function to skip a printing all of the
    > contents of a folder? It will not print folder 3 but does print the
    > contents of folder 3 which I do not want printed.
    You have posted the same message (at least) three different times to
    (at least) three different newsgroups. This is called "Multiposting"
    and is extremely rude. I have answered you in perl.beginners, and
    someone else answered you in comp.lang.perl.misc. If I had realized
    you multiposted in the first place, I probably wouldn't have replied at
    all.

    In the future, if you really *need* to post to many different groups,
    please *crosspost* as I am doing here. That is, send one message to
    multiple groups, rather than sending multiple copies of a single
    message to multiple groups.

    Paul Lalli

    Paul Lalli Guest

  4. #3

    Default Re: skip path prune

    In article <1153160511.344516.302160@75g2000cwc.googlegroups. com>,
    Paul Lalli <mritty@gmail.com> wrote:
    >weberw@adelphia.net wrote:
    >> How do you use the prune function to skip a printing all of the
    >> contents of a folder? It will not print folder 3 but does print the
    >> contents of folder 3 which I do not want printed.
    >
    >You have posted the same message (at least) three different times to
    >(at least) three different newsgroups. This is called "Multiposting"
    >and is extremely rude. I have answered you in perl.beginners, and
    >someone else answered you in comp.lang.perl.misc. If I had realized
    >you multiposted in the first place, I probably wouldn't have replied at
    >all.
    >
    >In the future, if you really *need* to post to many different groups,
    >please *crosspost* as I am doing here. That is, send one message to
    >multiple groups, rather than sending multiple copies of a single
    >message to multiple groups.
    >
    >Paul Lalli
    >
    Man, whenever *I* try that (crossposting), do I get flamed!

    Like it's some religious principle, "Thou shalt never crosspost".

    I always thought crossposting was really useful, by
    enabling members of several newsgroups to communicate
    amongst each other on a given topic.

    Especially when the groups are somewhat unrelated, perhaps
    perl and php and lisp, or engineering and physics.

    Broadens the scope of idea-sources.

    David


    David Combs Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139