When you do this:
a file handle is created, the data file is opened for reading, some amount of it (I don't know how much) is read into memory and processed in some way, the file handle is closed, and the result of processing is returned as a scalar value.my $group = get_page_cnt($append_pdf);
Then, when you do this:
another file handle is created, that same input file is opened and read, and this time its contents are copied to an output file. In this latter case, it's very likely that the OS and/or system hardware have cached the file and its contents, so the second open/read/close will almost certainly be faster than the first one, but there are still two instances of opening the file and linking it to a file handle for access.my $otherpdf = CAM::PDF->new($dir."data2\\".$append_pdf); $pdf->appendPDF($otherpdf);
Meanwhile, there's the separate issue of how many times a given output file needs to be closed and then reopened, depending on how the particular ordering of input file names (as returned by "readdir") relates to the page counts of the files.
In reply to Re^5: Am I on the right track?
by graff
in thread Am I on the right track?
by Pharazon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |