#!/usr/bin/env perl

use strict;
use warnings;

use File::Temp qw(tempdir);

use Perl6::Slurp;
use File::Slurp; # for write_file

my $file = $ARGV[0];
if ($file eq "-") {
  my $tempdir = tempdir(CLEANUP => 1);
  $file = "$tempdir/tmp.pdf";
  write_file($file, {binmode => 'raw'}, scalar(slurp '<:raw', \*STDIN));
}
system "pdf2ps", $file, "-";
