rea...@newsguy.com (Harry Putnam) writes:
> What surprised me is the that when I ran them prefaced with the `time'
> utility, I see the sloppy mess I wrote is nearly twice as fast.
I may have found a reason.
in the find sub {}
part you did two returns
return unless -f;
return un
t your logic depends upon detecting when the
> directory name changes, and will therefore not work on the last file
> encountered. It also depends upon all of the files in a directory
> being scanned sequentially. While that seems to work, it is not
> guaranteed by File::Find.
>
> A sim
, and will
therefore not work on the last file encountered. It also depends upon all of
the files in a directory being scanned sequentially. While that seems to work,
it is not guaranteed by File::Find.
A simpler method for counting files in each directory would be to use a hash
with the
Working on script using File::Find to count the number of news posts
in a semi-extensive hierarchy. As some may know, news posts are
commonly stored in numeric named files, one file per posting.
The following script tries to plow thru a hierarchy returning the
directory name and file count for
{
return unless /\A\d+\z/;
$oacnt++;
if ($data{$File::Find::dir}++ == 0 ) {
if ($cnt) {
printf "%-17s %d\n",$d, $cnt;
}
$cnt = 0;
}
$d = $File::Find::dir;
$cnt ++;
}, $dir;
{
return unless /\A\d+\z/;
$oacnt++;
if ($data{$File::Find::dir}++ == 0 ) {
if ($cnt) {
printf "%-17s %d\n",$d, $cnt;
}
$cnt = 0;
}
$d = $File::Find::dir;
$cnt ++;
}, $dir;
;
> I know that all the information I want to extract is available in
> File::Find.
>
> Just having trouble seeing how to get at it when I want it.
>
> Connecting the directory name with the file count is the rub for me.
>
> I googled extensively but have not found thi
1) I want to count numeric named files in each directory.
2) I want to capture the name of the directory those files are in
3) I want to print the directory name and the count (if any) for each
directory.
I know that all the information I want to extract is available in
File::Find.
Just
and...@geekuni.com (Andrew Solomon) writes:
[...]
> The way it works it that `find` is traversing through the directories and
> `$File::Find::dir` is the directory it's *in* when it calls your subroutine
> on `$File::Find::name` which is inside that directory. When it was sittin
Here's a small tweak to your initial script which goes some way toward
shedding light on what was going wrong:
#!/usr/bin/env perl
use strict;
use warnings;
use File::Find;
use feature 'say';
my $d = './one';
find sub {
return if -f;
say $File::Find::name;
shlo...@shlomifish.org (Shlomi Fish) writes:
> $File::Find::dir is the containing directory of the path item (= the
> dirname in http://perldoc.perl.org/File/Basename.html ). Finally,
> note that File::Find has
OK, I guess I follow that. As you see in my reply to Andrew S, I kind
of f
erstand what is
happening.
>> find sub {
>> return if -f;
>> print "\$File::Find::dir<$File::Find::dir>\n";
>> }, $d;
Seemed to me, would do that. Skip -f type files and print all
directory names.
Instead I see:
>> Output:
>>
Hi Harry!
On Fri, 23 Jun 2017 16:56:13 -0400
Harry Putnam wrote:
> Trying for a better understand of using File::Find, butI'm missing
> something pretty basic I think
>
> First: The directory structure in this test:
>
> ./one/tst.pl
> two/tst.pl
> three/
Hi Harry
What do you want your code to do?
Andrew
On Fri, Jun 23, 2017 at 9:56 PM, Harry Putnam wrote:
> Trying for a better understand of using File::Find, butI'm missing
> something pretty basic I think
>
> First: The directory structure in this test:
>
> ./one/
Trying for a better understand of using File::Find, butI'm missing
something pretty basic I think
First: The directory structure in this test:
./one/tst.pl
two/tst.pl
three/tst.pl
So each directory in the layering has the same type -f file in it.
Or
ls -R ./one
./one:
t
I think the issue is as you mentioned exporting find from File::Find::Rule.
However File::Find I am not sure I will get that flexibility to search only
1 level depth.
On Thu, Jan 10, 2013 at 6:07 PM, David Precious wrote:
> On Thu, 10 Jan 2013 17:56:18 +0530
> punit jain wrote:
>
&
ome processing.
That is easy enough to do:
for my $file ( ) {
open my $FH, '<', $file or die "Cannot open '$file' because: $!";
# process $file contents here
}
I wrote code below
:-
#!/usr/bin/perl
use strict;
use warnings;
use File::Basename qw(
e qw(basename dirname);
> use File::Find qw(find);
> use File::Find::Rule;
[...]
> find( sub {
> print $File::Find::name;
> if ($File::Find::name =~ /Contacts/ && -s
> $File::Find::name > 0 ) {
> print
low
:-
#!/usr/bin/perl
use strict;
use warnings;
use File::Basename qw(basename dirname);
use File::Find qw(find);
use File::Find::Rule;
my $indir = shift;
my $Users = {};
my @userdirs=File::Find::Rule->maxdepth(1)->directory->in($indir);
# this will give me user directories which I want onl
Hi,
I have a requirement where I have directory structure like : -
test --> test/user1/files, test/user2/files, test/user3/files etc.
under sub-directories with usernames I have file with name usersettings.
So the final structure as : -
test / user1 / usersettings
user2 / usersettings
gt; $VAR1 = 1;
> > > >
> > > > The start method is a method that doesn't return anything
> > > > important, but manipulates things for other methods to use. What
> > > > you want to do instead is set up the rules for $plf and then call
> > >
method
> separately:
>
I see. In meantime Shlomi adjusted the code to the documetation which
makes it very convenient to work with the package.
> use strict;
> use warnings;
>
> use Data::Dumper;
>
> use File::Find::Object::Rule ;
>
> my $plf = File::
int Dumper($plf) . "\n";
> > >
> > > returns
> > >
> > > $VAR1 = 1;
> > >
> > > The start method is a method that doesn't return anything
> > > important, but manipulates things for other methods to use. What
> > >
turn anything important, but
> > manipulates things for other methods to use. What you want to do instead
> > is set up the rules for $plf and then call the start method separately:
> >
> > use strict;
> > use warnings;
> >
> > use Data::Dumper;
>
e start method separately:
>
> use strict;
> use warnings;
>
> use Data::Dumper;
>
> use File::Find::Object::Rule ;
>
> my $plf = File::Find::Object::Rule->file->name("*.pl");
> $plf->start("./");
>
> while ( my $perl_fil
27;t return anything important, but
manipulates things for other methods to use. What you want to do instead is
set up the rules for $plf and then call the start method separately:
use strict;
use warnings;
use Data::Dumper;
use File::Find::Object::Rule ;
my $plf = File::Find::Object::Rule->f
Hi,
I'm trying out File::Find::Object::Rule and get a problem.
Here a minimal example:
#! /usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use File::Find::Object::Rule ;
my $plf = File::Find::Object::Rule->file->name("*.pl")->start( "./" );
w
Sender => 'u...@z.com',
Subject => 'foo bar',
} ) ;
my $foo_text = join '', map "$_\n", @new_foos ;
print $mailer $foo_text ;
$mailer->close() ;
M> find(\&wanted, $path_to_search);
modules and there seems to be a million of them.
Could you recommend a couple that you like?
Thanks again,
Marc
--
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
use File::Slurp;
my $path_to_search = $ENV{HOME}.'/public_html';
my $file_name = '
without it, but it seems like I should be able
M>to. =:\
M> use strict;
M> use warnings;
good.
M> use File::Find;
M> use File::HomeDir;
M> find(\&wanted, $path_to_search);
M> sub wanted {
M>if ($File::Find::name =~ /$file_name/) {
it wo
> "HW" == Hal Wigoda writes:
HW> Why clean it up when it works and is not obfusticating.
because he asked for comments and it will be educational to all on the
list.
uri
--
Uri Guttman -- uri AT perlhunter DOT com --- http://www.perlhunter.com --
Perl Developer Recruit
e welcome.
Also, do I really need the foreach block in there? I couldn't get it
to work without it, but it seems like I should be able to. =:\
Thanks,
Marc
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
use File::HomeDir;
my $path_to_search
ems like I should be able to. =:\
>
> Thanks,
> Marc
>
> ----
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use File::Find;
> use File::HomeDir;
>
> my $path_to_search = File::HomeDir->my_home.'/public_html';
> my $file_name
comments are welcome.
Also, do I really need the foreach block in there? I couldn't get it
to work without it, but it seems like I should be able to. =:\
Thanks,
Marc
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
use File::HomeDir;
On 11-04-20 06:55 AM, Agnello George wrote:
Thanks a lot , but was just wondering if i could ignore it in the
File::Find function
Yup.
my @all = qw( /classes/mail.class.php
classes/dealer.class.php
classes/memcache.class.php
classes/phpmailer
classes/phpmailer/.htaccess
classes/phpmailer
On Wed, Apr 20, 2011 at 4:34 PM, Shlomi Fish wrote:
> Hi Agnello,
>
> On Wednesday 20 Apr 2011 13:59:24 Agnello George wrote:
>> On Wed, Apr 20, 2011 at 4:14 PM, Shlomi Fish wrote:
>> > On Wednesday 20 Apr 2011 12:50:45 Agnello George wrote:
>> >
>> > You can remove the ./:
>> >
>> > [CODE]
>> >
Hi Agnello,
On Wednesday 20 Apr 2011 13:59:24 Agnello George wrote:
> On Wed, Apr 20, 2011 at 4:14 PM, Shlomi Fish wrote:
> > On Wednesday 20 Apr 2011 12:50:45 Agnello George wrote:
> >
> > You can remove the ./:
> >
> > [CODE]
> > foreach my $filename (@all)
> > {
> >my $fn_wo_prefix =
On Wed, Apr 20, 2011 at 4:14 PM, Shlomi Fish wrote:
> On Wednesday 20 Apr 2011 12:50:45 Agnello George wrote:
>> Hi
>>
>> I have script where i need to go in to a directory and put all files
>> in to a array
>>
>> if ( chdir ("$dirtemp")
On Wed, Apr 20, 2011 at 4:14 PM, Shlomi Fish wrote:
> On Wednesday 20 Apr 2011 12:50:45 Agnello George wrote:
>> Hi
>>
>> I have script where i need to go in to a directory and put all files
>> in to a array
>>
>> if ( chdir ("$dirtemp")
On Wednesday 20 Apr 2011 12:50:45 Agnello George wrote:
> Hi
>
> I have script where i need to go in to a directory and put all files
> in to a array
>
> if ( chdir ("$dirtemp") ) {
> find (sub { push @all , $File::Find::name}, ".");
>
>
Hi
I have script where i need to go in to a directory and put all files
in to a array
if ( chdir ("$dirtemp") ) {
find (sub { push @all , $File::Find::name}, ".");
my %selectfiles = qw( /classes/mail.class.php
classes/dealer.class.php
classes/memcache.class.php
class
Unknown User wrote:
I have this script to find out where a perl module is on my machine:
[unkn...@knowme:~/bin]$ cat findmodule
#!/usr/bin/perl -w
use File::Find;
use strict;
if ($ENV{"INC"} ) { # INC=PATH1:PATH2 ./getmodule
perldoc perlrun
[ SNIP ]
PERL5LIB
I have this script to find out where a perl module is on my machine:
[unkn...@knowme:~/bin]$ cat findmodule
#!/usr/bin/perl -w
use File::Find;
use strict;
if ($ENV{"INC"} ) { # INC=PATH1:PATH2 ./getmodule
...
for my $toadd (split(/:/
On Saturday 24 Apr 2010 22:00:56 Harry Putnam wrote:
> When using File::Find;
> Is there any built in way to know when you are in the top level of one
> of the directories in @directories?
>
> I mean besides grepping $File::Find::dir.
>
> I know that give the current directo
When using File::Find;
Is there any built in way to know when you are in the top level of one
of the directories in @directories?
I mean besides grepping $File::Find::dir.
I know that give the current directory name and of course the top
directory could be massages out with something like
Harry Putnam writes:
>> Or perhaps:
>>
>> return if $File::Find::dir !~ /$dir_rgx/;
>>
>
> Thanks.
>
>>> or
>>> Like I've done in he code below. Just let the dir_rgx be a selector
>>> and not worry about pulling the next line i
"John W. Krahn" writes:
>> Like: next if(! $File::Find::dir =~ /$dir_rgx/);
>
> No. Because you are inside a subroutine you have to use return:
>
> return unless $File::Find::dir =~ /$dir_rgx/;
>
> Or perhaps:
>
> return if $File::Find::dir !~ /$
he text_regex
that might be in the files there.
The idea being to allow you to focus a search without having to know
the exact name of the newsgroup[s]. You would at least be searching a
group with the string `linux.' in it.
So what I'm curious about is if it would be good to `next'
Harry Putnam wrote:
> find(
> sub {
> ## if we have a directory name that matches
> if($File::Find::dir =~ /$dir_rgx/){
> ## if that directory has files with all numeric names
> if(/^\d+$/){
if( ! /\D/ ){
> ## Open the files and
Harry Putnam writes:
> [...]
>
> find(
> sub {
> ## if we have a directory name that matches
> if($File::Find::dir =~ /$dir_rgx/){
> ## if that directory has files with all numeric names
> if(/^\d+$/){
> ## Open the file
ht be in the files there.
The idea being to allow you to focus a search without having to know
the exact name of the newsgroup[s]. You would at least be searching a
group with the string `linux.' in it.
So what I'm curious about is if it would be good to `next' out if the
File::Find
On Monday 01 Mar 2010 19:31:15 Shawn H Corey wrote:
> Shlomi Fish wrote:
> > Well, Matt S. Trout shared his sentiments about "I cannot use CPAN" here:
> >
> > http://www.shadowcat.co.uk/blog/matt-s-trout/but-i-cant-use-cpan/
>
> Well, Matt is wrong. You can't always use CPAN. Yes, you can set i
Shlomi Fish wrote:
> Well, Matt S. Trout shared his sentiments about "I cannot use CPAN" here:
>
> http://www.shadowcat.co.uk/blog/matt-s-trout/but-i-cant-use-cpan/
>
Well, Matt is wrong. You can't always use CPAN. Yes, you can set it up
so you can use it in development, but that doesn't mean
On Monday 01 Mar 2010 15:00:26 raphael() wrote:
> On Mon, Mar 1, 2010 at 6:18 PM, Shawn H Corey wrote:
> > raphael() wrote:
> > > Hi,
> > >
> > > How can I stop File::Find to go below current dir? i.e. no recursion.
> > >
> > > Although
On Mon, Mar 1, 2010 at 6:18 PM, Shawn H Corey wrote:
> raphael() wrote:
> > Hi,
> >
> > How can I stop File::Find to go below current dir? i.e. no recursion.
> >
> > Although I can use glob or <*> to get file names in current dir.
> > But I wanted to
On Monday 01 Mar 2010 13:23:16 raphael() wrote:
> Hi,
>
> How can I stop File::Find to go below current dir? i.e. no recursion.
>
> Although I can use glob or <*> to get file names in current dir.
> But I wanted to know if File::Find has a maxdepth limit like linux &q
raphael() wrote:
> Hi,
>
> How can I stop File::Find to go below current dir? i.e. no recursion.
>
> Although I can use glob or <*> to get file names in current dir.
> But I wanted to know if File::Find has a maxdepth limit like linux "find".
>
> The scri
Hi,
How can I stop File::Find to go below current dir? i.e. no recursion.
Although I can use glob or <*> to get file names in current dir.
But I wanted to know if File::Find has a maxdepth limit like linux "find".
The script I created uses a switch which decides if recursion i
solaristar wrote:
First please forgive me if this is the wrong way to go about asking
this question.
I already answered this question on comp.lang.perl.misc. Do you want me
to answer it again here?
John
--
The programmer is fighting against the two most
destructive forces in the universe:
dont have the afore mentioned
criteria,
any feedback is appreciated
#!/usr/bin/perl
use strict;
use warnings;
use File::Find::Rule;
use File::Basename qw/basename dirname/;
my @data_dir =
qw { /data/backups };# list here the data dir if you want to
loop on it.
foreach my $dir (@data_d
Jim Gibson writes:
[...]
> See 'perldoc perllol' for more details on constructing and accessing nested
> data structures in Perl.
Will do, and as always you've given a useful and brief run through,
thanks.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-m
or example, if you want to process files in chronological order, in
>> the wanted routine save the file path and age as an array entry (untested):
>>
>> my @files;
>> my $dir = '/some/directory/path';
>>
>> find( sub{
>>
ile path and age as an array entry (untested):
>
> my @files;
> my $dir = '/some/directory/path';
>
> find( sub{
> my $age = -M $File::Find::name;
> push( @files, [ $File::Find::name, $age ] );
> }, $dir);
>
>
On 10/28/09 Wed Oct 28, 2009 12:55 PM, "Harry Putnam"
scribbled:
> Looking over the perldoc File::Find output (perl 5.8.4)
>
> I see at finddepth it says:
> [...] in part
>
>"finddepth()" works just like "find()" except that is invok
Looking over the perldoc File::Find output (perl 5.8.4)
I see at finddepth it says:
[...] in part
"finddepth()" works just like "find()" except that is invokes the
&wanted function for a directory after invoking it for the direc-
tory's c
Telemachus writes:
> On Mon Jul 06 2009 @ 3:31, Harry Putnam wrote:
>> Thanks to all ...
>> Now I'm curious about something else:
>>
>> Is the mode in a stat(file) readout something still different
>> than octal or decimal?
>
> As John answered, there's more there than just the permissions. If
On Mon Jul 06 2009 @ 3:31, Harry Putnam wrote:
> Thanks to all ...
> Now I'm curious about something else:
>
> Is the mode in a stat(file) readout something still different
> than octal or decimal?
As John answered, there's more there than just the permissions. If you
check perldoc -f stat, ther
Harry Putnam wrote:
Thanks to all ...
Now I'm curious about something else:
Is the mode in a stat(file) readout something still different
than octal or decimal?
I see `33261' show up in the `mode' slot on a file with 755 permissions
(from perldoc -f stat:
[...]
($dev,$ino,$mode,$nli
Thanks to all ...
Now I'm curious about something else:
Is the mode in a stat(file) readout something still different
than octal or decimal?
I see `33261' show up in the `mode' slot on a file with 755 permissions
(from perldoc -f stat:
[...]
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$si
On Mon Jul 06 2009 @ 7:00, Harry Putnam wrote:
> Can anyone tell me how printing of $mode = 0755 turns into 493?
Yup: what's in $mode is an octal number. Its decimal equivalent is 493. What
you really want to print out is the string '0755', but the string and the
octal number are not the same thi
On Mon, Jul 6, 2009 at 08:00, Harry Putnam wrote:
snip
> Can anyone tell me how printing of $mode = 0755 turns into 493?
snip
> my $mode = 0755;
snip
> print "hpdb chmod $mode $fname\n";
snip
0755 is 493. More specifically they are two representations of the
same number: the first i
Harry Putnam asked:
> The script below is my first usage of perls `chmod', but it appears to
> be in keeping with the info at perldoc -f chmod.
>
> But somehow in the print of $mode it turns into 493... even though it
> is set to 755. Its just the print though... the actual chmod appears
> to be
Can anyone tell me how printing of $mode = 0755 turns into 493?
#!/usr/local/bin/perl
use strict;
use warnings;
use File::Find;
my $myscript;
($myscript = $0) =~ s/^.*\///;
## chmod mode
my $mode = 0755;
if(!...@argv || $ARGV[0] eq "help"){
print &q
>>>>> ""Chas" == "Chas Owens" writes:
"Chas> Huh, never looked at File::Finder before, it looks like it would only
"Chas> make sense if you already knew the UNIX find command. I normally see
"Chas> people use File::Find::Rul
>
> http://search.cpan.org/~tty/kurila-1.19_0/lib/Benchmark.pm
>
> --
> Ron Bergin
Thanks to all for replying.
Greg.
signature.asc
Description: This is a digitally signed message part
On Mon, May 18, 2009 at 21:02, Gunnar Hjalmarsson wrote:
> AndrewMcHorney wrote:
>>
>> I am getting totally confused. All I want is a simple find function call
>> what will return all the files that are in c:\*.*.
>
> File::Find is useful for recursive tasks. If
Greg Eldridge wrote:
> On Mon, 2009-05-18 at 17:36 -0700, r...@i.frys.com wrote:
>
> What Benchmark .pm are you using ?
> CPAN i/benchmark/ => lists 66 entries, but none of which are simply
> Benchmark
>
> Thanks in advance.
>
> Greg.
>
http://search.cpan.org/~tty/kurila-1.19_0/lib/Benchmark.pm
Greg Eldridge wrote:
What Benchmark .pm are you using ?
CPAN i/benchmark/ => lists 66 entries, but none of which are simply
Benchmark
Thanks in advance.
http://search.cpan.org/~nwclark/perl-5.8.9/lib/Benchmark.pm
--
David Moreno
http://twitter.com/damog
--
To unsubscribe, e-mail: beginne
On Mon, 2009-05-18 at 17:36 -0700, r...@i.frys.com wrote:
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use File::Find;
> use Benchmark qw/cmpthese/;
>
> cmpthese( 10, {
> 'dir' => sub {my @files = `dir /b /a-d /s c:\test`
AndrewMcHorney wrote:
I am getting totally confused. All I want is a simple find function call
what will return all the files that are in c:\*.*.
File::Find is useful for recursive tasks. If all you want is to list the
files in one directory, there are simpler ways. Personally I would use
les that are in c:\*.*. This is on PC running
>>> windows. I thought you mentioned to use file:find() where one of the
>>> parameters would be a function which would be called once for each file
>>> found.
>> snip
>>
>> After these two lines run @files will hold e
ht you mentioned to use file:find() where one of the
>> parameters would be a function which would be called once for each file
>> found.
> snip
>
> After these two lines run @files will hold every file on the c drive.
>
> my @files;
> find sub { push @files, $File::Find:
AndrewMcHorney wrote:
Charles
I am getting totally confused. All I want is a simple find function call
what will return all the files that are in c:\*.*. This is on PC running
windows. I thought you mentioned to use file:find() where one of the
parameters would be a function which would be ca
here one of the
> parameters would be a function which would be called once for each file
> found.
snip
After these two lines run @files will hold every file on the c drive.
my @files;
find sub { push @files, $File::Find::name if -f }, "c:/";
--
Chas. Owens
wonkden.net
The most important
to *the module* File::Find.
snip
Huh, never looked at File::Finder before, it looks like it would only
make sense if you already knew the UNIX find command. I normally see
people use File::Find::Rule when they don't want to write their own
wanted function.
1. http://search.cpan.org/dist/File-F
Chas. Owens wrote:
On Mon, May 18, 2009 at 19:05, Gunnar Hjalmarsson wrote:
AndrewMcHorney wrote:
I looked at the documentation for this function and I find it confusing.
Try File::Finder for a less confusing interface to *the module* File::Find.
snip
Huh, never looked at File::Finder
On Mon, May 18, 2009 at 19:05, Gunnar Hjalmarsson wrote:
> AndrewMcHorney wrote:
>>
>> I looked at the documentation for this function and I find it confusing.
>
> Try File::Finder for a less confusing interface to *the module* File::Find.
snip
Huh, never looked at File::Fi
AndrewMcHorney wrote:
I looked at the documentation for this function and I find it confusing.
Try File::Finder for a less confusing interface to *the module* File::Find.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr
very file and directory on the
c drive. An easy way to create function for find is to use an
anonymous subroutine:
find sub {}, "c:/";
If you want to limit the function to files you can check to see if the
current item is a file or not with -f:
find sub {
return unless -f;
print &
Hello
I looked at the documentation for this function and I find it
confusing. What do you pass in to get all the files on drive letter c?
Andrew
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
n the script will create a folder
> folder/setup
> folder/cleanup
> /folder/2.1/setup
> /folder/2.1/cleanup
> /folder/2.1/2.1.1/setup
> /folder/2.1/2.1.1/cleanup
> /folder/2.1/2.1.1/2.1.1.1
> /folder/2.1/2.1.1/2.1.1.1/test
> /folder/2.2/2.2.1/2.2.1.2/test
Most of the
Rock Lifestyle wrote:
I am new to any programming language .I am trying to copy one file
structure.
I have a folder structures which contains setup files, cleanup files
and test file
Now I want to create another file structure where it will copy the
directory tree which I have mentioned i
--- On Sat, 21/2/09, Rock Lifestyle wrote:
From: Rock Lifestyle
Subject: Help regarding file find
To: beginners@perl.org
Date: Saturday, 21 February, 2009, 6:30 PM
Hi All,
I am new to any programming language .I am trying to copy one
file structure.
I have a folder structures
Hi All,
I am new to any programming language .I am trying to copy one file
structure.
I have a folder structures which contains setup files, cleanup files and test
file
like
/testplan
/testplan/setup
/testplan/cleanup
/testplan/2.1/setup
/testplan/2.1/cleanup
/testplan/2.1/2.1.1/
On Mon, Jan 12, 2009 at 16:05, icarus wrote:
> I'm trying to all count files in a home dir and all subdirs *except* a
> subdir called 'backup'.
When you run into the condition where you don't want to recurse
further, set $File::Find::prune to 1 (e.g. $File::Find::p
I'm trying to all count files in a home dir and all subdirs *except* a
subdir called 'backup'.
How do I that? thanks in advance.
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
my $dir = ("/home/foo");
my $counter = 0;
find( { wanted => \&proces
On Oct 24, 12:58 pm, [EMAIL PROTECTED] (John W. Krahn) wrote:
>
> I couldn't get $File::Find::prune to work on my system but this may be
> close to what you require:
>
> #!/usr/bin/perl
> use warnings;
> use strict;
> use File::Find;
>
> eval "use Fil
overlooking something simple. Here is the code and the output:
#!/usr/bin/env perl
use File::Find();
eval("use File::HomeDir;");
die "[err] File::HomeDir not installed. Use \"perl -e \"use CPAN;
install File::HomeDir;\"\" to install \n" if $@;
use strict;
use
ething simple. Here is the code and the output:
#!/usr/bin/env perl
use File::Find();
eval("use File::HomeDir;");
die "[err] File::HomeDir not installed. Use \"perl -e \"use CPAN;
install File::HomeDir;\"\" to install \n" if $@;
use strict;
use warn
ignore .svn subfolders, I do this at
the start of the subrouting that I hand to File::Find:
return $File::Find::prune = 1 if $_ eq '.svn';
HTH, T
pgpfaDXPh8cB4.pgp
Description: PGP signature
1 - 100 of 367 matches
Mail list logo