0

Okay, here's what I'm trying to do:

I have an email with a series of MIME attachments. I have sample code that will get me as far as creating a directory with the decoded attachments in it; what I need to do now is send the contents of that directory to lpr. (I'm not screening out bad file formats; I'm leaving it up to the spooler daemon to deal with.)

BrianX
  • 136
  • 4

1 Answers1

7

What about using glob:

my @files = glob($decode_directory/*);
system "lpr", @files;

You can make the glob argument more selective. The system function written thus avoids launching a shell and runs the lpr command directly.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278