On 3/12/09 Thu  Mar 12, 2009  6:18 AM, "Aglipay, Recelyn"
<recelyn.agli...@ehmc.com> scribbled:

> Hi Dave,
> 
> I'm using a third party application to call the perl script.  This
> application only allows for subroutines to be written since the app also
> uses some perl.  So the code below is all I have.  My goal was to open
> the directory which contains .dat files.  Print all of them to the
> printer.

You should first test your subroutine by writing your own Perl main program
that calls your subroutine, provides it with whatever data it needs, and
then you can inspect the results.

> 
> I've tried using different syntax for the open command but all I get is
> the message I've created within the code "Unable to open the printer".
> I had thought that my line of code for the open would do the printing?
> Is there another command I would need to use?
> I know there is a print command but I thought that would only be used if
> you want to print text that you define?  Can you use it to print a file?

Perl's built-in print command writes data to a data stream. By default, that
data stream is STDOUT, and, again by default, the characters appear on your
monitor or terminal session. The print command may also be used to write
data to any data stream or device that has been opened using the open
command. The data stream or device may be a file, a network socket, a
printer, or some other device. It is up to your operating system to direct
the characters to the appropriate device. In other words, Perl doesn't
really know whether the characters it emits are going to a printer or not.
It is up to the programmer to arrange that a Perl output data stream is
connected to a printer. How this is done is very system-dependent.

If you want more help, you should post some code.



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to