Click here to get back home

skip path prune

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
skip path prune weberw@adelphia.net 07-17-2006
Posted by weberw@adelphia.net on July 17, 2006, 12:34 pm
Please log in for more thread options


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;


Posted by Paul Lalli on July 17, 2006, 2:21 pm
Please log in for more thread options


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


Posted by David Combs on August 5, 2006, 11:34 pm
Please log in for more thread options


>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



Posted by Jim Gibson on August 7, 2006, 3:34 pm
Please log in for more thread options



[advice against multi-posting snipped]

> Man, whenever *I* try that (crossposting), do I get flamed!

You were advised against 'multi-posting', not 'cross-posting'. Do you
know the difference?

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

No, most Usenauts would say 'Thou shalt never multi-post'.

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

Yes, cross-posting can be useful in limited circumstances. Did anyone
tell you otherwise?

>
> Especially when the groups are somewhat unrelated, perhaps
> perl and php and lisp, or engineering and physics.
>
> Broadens the scope of idea-sources.

Please make sure you know the difference between multi-posting and
cross-posting, and why one is bad and the other is OK. OK?

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Posted by A. Sinan Unur on August 7, 2006, 4:19 pm
Please log in for more thread options



>
> [advice against multi-posting snipped]
>
>> Man, whenever *I* try that (crossposting), do I get flamed!

...

> Please make sure you know the difference between multi-posting and
> cross-posting, and why one is bad and the other is OK. OK?

FYI, I am pretty sure David's post a humor piece.

Sinan
--
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

Similar ThreadsPosted
how to skip some xml records using XML::SAX parser? February 15, 2007, 5:59 am
Why is nothing found in @INC path ?!?! April 21, 2006, 2:39 pm
CGI Cookie Path Question December 26, 2005, 10:53 am
In SVG, persistent signs in path ? October 25, 2007, 7:20 pm
Graph Path Module April 14, 2008, 5:37 am
Getting Path of an external DLL in Perl: Inline C. October 2, 2005, 8:41 pm
XML::XSLT does not accept an absolute path November 15, 2007, 5:02 pm
Customizing include path with CPAN install November 22, 2004, 9:46 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap