welle has asked for the wisdom of the Perl Monks concerning the following question:
Hi folks,
I have the following problem: I want to convert a directory PDF->TXT using a third party .exe and using system in Perl.
sub open_directory_file_pdf { my $Directory = File::Spec->canonpath( $mw->chooseDirectory() ); my $shortpath = Win32::GetShortPathName( "$Directory" ); chdir($shortpath) or die "$!"; opendir (DIR, "$shortpath") or die "$!"; my @files = grep {/.*?\.pdf/} readdir DIR; foreach my $file (@files) { system ("files/pdftotext.exe -nopgbrk -q \"$file\"" ); } close DIR; }
I get an error related to "system" -> "file" wrong written or not a command. What I am doing wrong?
PS: if I write
system ("$file" ); system ("pdftotext.exe $file");
it works fine for opening $file with the standard pdf viewer but same error when it comes to accessing the .exe.....pdftotext.exe works on command line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: System path
by elef (Friar) on Apr 30, 2011 at 18:49 UTC | |
|
Re: System path
by Anonymous Monk on Apr 30, 2011 at 12:19 UTC | |
by welle (Beadle) on Apr 30, 2011 at 12:31 UTC | |
by Eliya (Vicar) on Apr 30, 2011 at 12:53 UTC | |
by welle (Beadle) on Apr 30, 2011 at 13:12 UTC | |
by welle (Beadle) on Apr 30, 2011 at 13:10 UTC | |
by Eliya (Vicar) on Apr 30, 2011 at 13:19 UTC | |
by Anonymous Monk on Apr 30, 2011 at 12:57 UTC |