Re: Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread David Vergin
David Vergin wrote: system(qq/echo -en "$data_str" | lpr -oraw/); That does not work in cygwin. Lasse wrote: Why would want use echo for this? Just use a piped open directly to lpr: open(FH, '| lpr -oraw'); print(FH, $data_str); close(FH); Thank you Lasse. This is seriousl

Re: Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread Lasse
Igor Pechtchanski wrote: [SNIP] (parens are optional, Not in the coding guidelines at work... :-) but the main thing is that there can't be a comma after FH in the print statement). Oops, yes that's correct... :-) -- /Lasse -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-sim

Re: Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread Eric Blake
> > $ echo -en "hello\nworld" > hello > world > [EMAIL PROTECTED] /c/bin > $ #Good! The basic approach works on the command line. >#Control codes are interpreted and no trailing newline. >#So I'll try the same thing from perl letting the echo ># command convert the cont

Re: Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread Igor Pechtchanski
On Fri, 1 Jul 2005, Lasse wrote: > David Vergin wrote: > > I'm adapting a working linux program to cygwin. The process has been > > relatively painless except for this issue which has delayed me way > > past deadline. > > > > I need to output text and printer codes (which may include \000) from >

Re: Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread Brian Dessent
David Vergin wrote: > system(qq/echo -en "$data_str" | lpr -oraw/); > ...or whatever >From a security standpoint, this is horrific. Passing user-supplied data on the command line to a system command is just a recipe for disaster. I don't understand why you need to use 'echo' to do you

Re: Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread Lasse
David Vergin wrote: I'm adapting a working linux program to cygwin. The process has been relatively painless except for this issue which has delayed me way past deadline. I need to output text and printer codes (which may include \000) from a perl program to a printer which may be on a parall

Trouble Sending Printer Codes from Perl to Printer

2005-06-30 Thread David Vergin
I'm adapting a working linux program to cygwin. The process has been relatively painless except for this issue which has delayed me way past deadline. I need to output text and printer codes (which may include \000) from a perl program to a printer which may be on a parallel port or a USB port