in reply to dbf_dump to apply to multiple files in a directory

You should use warnings; use strict; at the top of all your scripts, and you should check the return values of functions for errors (in this case opendir). Here's a version incorporating that and a bit of cleanup:

#!/usr/bin/env perl use warnings; use strict; use IPC::System::Simple qw/system/; # recommended but optional opendir my $dh, "." or die "opendir failed: $!"; my @files = grep {/\.dbf$/} readdir $dh; closedir $dh; foreach my $file (@files) { system(qq{dbf_dump --fs "," "$file" > $_.csv})==0 or die "system() failed (\$?=$?)"; }

Note the error handling code on system isn't really needed if you use IPC::System::Simple.

Replies are listed 'Best First'.
Re^2: dbf_dump to apply to multiple files in a directory
by Anonymous Monk on Aug 03, 2014 at 21:23 UTC
Re^2: dbf_dump to apply to multiple files in a directory
by solanum (Initiate) on Aug 03, 2014 at 19:13 UTC

    thank you very much for your help! this worked like a charm!