Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Traversing SVN Tree

by brwarn (Novice)
on Mar 06, 2008 at 05:56 UTC ( #672372=note: print w/ replies, xml ) Need Help??


in reply to Re: Traversing SVN Tree
in thread Traversing SVN Tree

Sorry for the delay. I modified code that I found but get out of memory errors after six or so file names are listed. I see in the File::Slurp documentation that there's a way to read just filenames (and not the entire file contents as I believe that I'm doing below), but am not sure what to do with the following to just read the filenames.

#!/usr/bin/perl use strict; use warnings; use File::Slurp; use File::Find; my $dir="C:\\Documents and Settings\\Administrator\\Desktop\\SVN\\trun +k"; # read an entire file into a scalar (a.k.a. 'slurping') find( \&show_subdirectories, $dir); sub show_subdirectories{ if ( -d ) { if ( $_ eq '.svn' ) { # don't traverse into subversion related directories $File::Find::prune = 1; return; } # for directories, only print path my $filepath ="$File::Find::name"; return; } -f or return; # if not a file /\.(xls|mdb)$/ or return; # if not the right extension my $perl = read_file( $_ ); my $filepath="$File::Find::name"; my @filearray=split(/\\trunk\//,$filepath); my $fileElt = $filearray[1]; print "FILEARRAY is $fileElt and FILE is $_\n"; }


Comment on Re^2: Traversing SVN Tree
Download Code
Re^3: Traversing SVN Tree
by blahblahblah (Priest) on Mar 07, 2008 at 01:09 UTC
    This line is reading in the file contents:
    my $perl = read_file( $_ );
    If you don't want to read the file contents, then just remove that line.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://672372]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-12-18 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (67 votes), past polls