in reply to Traversing through a directory structure
No need to figure out how to pass a function reference (which dmorelli points out may be the culprit in your original script). More importantly, the find command allows you to specify many search parameters, something which may be harder to do programmatically with Perl. Check the manpages for find (and perl, if you're unfamiliar with the -n switch).#!/usr/bin/perl -w use strict; my $output; $output .= $_ for ($_, qx/ls -l $_/, qx/lsac */); # Get output for fil +e # Print output to file s!/!.!g; # Generate suitable filename open FH, ">/home/mis/tstanley/Migrate/$_" or die $!; print FH $output;
|
|---|