Atkinson, Robert <[EMAIL PROTECTED]> wrote:
> I've downloaded the modules for counting PDF pages with Perl.
> I then copied the example :-
> 
> use PDF;
> $pdf=PDF->new ;
> $pdf=PDF->new(filename);
> 
> $result=$pdf->TargetFile( filename );
> 
> print "is a pdf file\n" if ( $pdf->IsaPDF ) ;
> print "Has ",$pdf->Pages," Pages \n";
> 
> When I run the program though, I get this error :-
> 
> 
> ALPHA_ROB$$ perl sys$login:rob.tmp webreport$store:S2HV_NL_20040512_0A7A.PDF
> can't open filename: no such file or directory at sys$login:rob.tmp line 3
> %SYSTEM-F-ABORT, abort

Change the example script to
- get the filename from the command line (@ARGV array)
- feed it into the PDF module methods (filename -> $filename)

Modified example:

use PDF;
$filename = $ARGV[0];

$pdf=PDF->new ;
$pdf=PDF->new($filename);

$result=$pdf->TargetFile( $filename );

print "is a pdf file\n" if ( $pdf->IsaPDF ) ;
print "Has ",$pdf->Pages," Pages \n";


Hope it helps,
  Martin
-- 
 Your mouse has moved.      | Martin Vorlaender  |  OpenVMS rules!
 Windows must be restarted  | work: [EMAIL PROTECTED]
 for the change to take     |   http://www.pdv-systeme.de/users/martinv/
 effect. Reboot now? [OK]   | home: [EMAIL PROTECTED]

Reply via email to