Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:
Now of course the foreach never gets run because what I am getting is the exit status of the File::Find and not its output.EXAMPLE #!/usr/local/bin/perl -w use File::Find; use Config::IniFiles; use strict; my $cfg = new Config::IniFiles( -file => "config.ini" ); my $start = $cfg->val('FIND', 'start'); my $wanted = $cfg->val('FIND', 'wanted'); my @filesfound = File::Find::find( sub {eval $wanted} , "$start" ); foreach my $file (@filesfound) { print "$file is in the $start directory\n"; } contents of config.ini [FIND] start = /tmp wanted = print("$File::Find::name\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: output of Find::File into an array
by Zaxo (Archbishop) on Aug 25, 2002 at 01:33 UTC | |
by Limbic~Region (Chancellor) on Aug 25, 2002 at 01:56 UTC | |
|
Re: output of Find::File into an array
by blakem (Monsignor) on Aug 25, 2002 at 02:27 UTC | |
|
Re: output of Find::File into an array
by mkmcconn (Chaplain) on Aug 25, 2002 at 01:43 UTC | |
by Limbic~Region (Chancellor) on Aug 25, 2002 at 02:02 UTC |