Anonymous
public text v1 · immutablesub get_text {
my @a = split /\./,"$_[0]";
$type = $filetypes{"$a[1]"};
unless ($type) {
$type = 'null';
}
#my $target = "$_[1].$type";
#scp from remote $_[0] to $target
my $target=$_[0];
my $return = '';
if ($type eq 'pdf') {
#system("pstotext $target $tempfile");
exec("/usr/local/bin/pdftotext $target $tempfile");
open(INFILE, "$tempfile");
@text=<INFILE>;
close(INFILE);
$return=join("",@text);
$return='';
}