summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpdftool.pl24
-rwxr-xr-xpsresize2.pl2
2 files changed, 10 insertions, 16 deletions
diff --git a/pdftool.pl b/pdftool.pl
index 65898fe..0761ad1 100755
--- a/pdftool.pl
+++ b/pdftool.pl
@@ -135,7 +135,7 @@ unless (defined $margin) {
}
# Default unit: PostScript point
-&topoints (\$margin);
+&topoints( \$margin );
# Inner and outer margins
my ($mresize, $mnup) = (0,0);
@@ -246,8 +246,7 @@ if ($filetype eq "PDF") {
push @cmd, '-q' if defined $quiet;
my $pid = open PSIN, "-|", @cmd
or die "Can't run `" . &printcmd (@cmd) . "'";
- my @pair = ($pid, @cmd);
- push @pids, \@pair;
+ push @pids, [$pid, @cmd];
} else {
open *PSIN, "<&FIN" or die "Can't dup: $!";
}
@@ -262,8 +261,7 @@ if (defined $select) {
@cmd = ('psselect', "-p$select");
push @cmd, '-q' if defined $quiet;
my $pid = open2 *PSSELECT, "<&PSIN", @cmd;
- my @pair = ($pid, @cmd);
- push @pids, \@pair;
+ push @pids, [$pid, @cmd];
} else {
*PSSELECT = *PSIN;
}
@@ -273,13 +271,12 @@ if (defined $select) {
#
# Resize file to our paper
#
-@cmd = ('./psresize2.pl', "-p$paper", "-m$mresize");
+@cmd = ('psresize2.pl', "-p$paper", "-m$mresize");
push @cmd, "-c" if defined $crop;
push @cmd, '-q' if defined $quiet;
my $pid = open2 *PSRESIZE, "<&PSSELECT", @cmd;
-my @pair = ($pid, @cmd);
-push @pids, \@pair;
+push @pids, [$pid, @cmd];
# Note: open2 closes the filehandles for us :)
@@ -292,8 +289,7 @@ if (defined $book) {
push @cmd, '-q' if defined $quiet;
my $pid = open2 *PSBOOK, "<&PSRESIZE", @cmd;
- my @pair = ($pid, @cmd);
- push @pids, \@pair;
+ push @pids, [$pid, @cmd];
} else {
*PSBOOK = *PSRESIZE;
}
@@ -308,8 +304,7 @@ if ($nup > 1) {
push @cmd, '-q' if defined $quiet;
my $pid = open2 *PSOUT, "<&PSBOOK", @cmd;
- my @pair = ($pid, @cmd);
- push @pids, \@pair;
+ push @pids, [$pid, @cmd];
} else {
*PSOUT = *PSBOOK;
}
@@ -324,8 +319,7 @@ if ($filetype eq "PDF") {
@cmd = ('ps2pdf', "-dEmbedAllFonts=true", "-sPAPERSIZE=$paper", '-', '-');
$pid = open2 ">&FOUT", "<&PSOUT", @cmd;
- my @pair = ($pid, @cmd);
- push @pids, \@pair;
+ push @pids, [$pid, @cmd];
} else {
# cat > FOUT
while (<PSOUT>) {
@@ -358,7 +352,7 @@ unlink @auxfiles;
# In-place convert the given length to PostScript points
#
sub topoints {
- my $l = $_;
+ my $l = $_[0];
return unless defined $$l;
$$l =~ /^([+-]?\d*\.?\d+)(\w*)$/ or die "Unable to parse `$$l'";
diff --git a/psresize2.pl b/psresize2.pl
index ba92bf0..fc88ee4 100755
--- a/psresize2.pl
+++ b/psresize2.pl
@@ -464,7 +464,7 @@ sub round {
# In-place convert the given length to PostScript points
#
sub topoints {
- my $l = $_;
+ my $l = $_[0];
return unless defined $$l;
$$l =~ /^([+-]?\d*\.?\d+)(\w*)$/ or die "Unable to parse `$$l'";