> > A hardware device connects to the socket and sends characters (barcode
> > scanner output, variable length, alphanumeric) followed by '/r'
> > 
> > My (very basic) understanding is that if it used '/r/n' my code would work.

Okay, sounds like you need to:

  Read with newlines as /r, change to /r/n and resend someplace.

However, you need to remember:

  Perl maps /n to whatever the operating system considers the One True Way [tm]
  of terminating newlines.  Hence it is different under Windows and Unix, VMS,
  VAX, Mac or whatever.

  Unix line terminators are usually used for Internet protocols.

So we have:

  INPUT: Line with /r at the end
  OUTPUT: Line with /n at the end (where we set what /n is)

Felix's idea:

> Just an idea. What happens if you do the following:
> 
>     {
>         local $/ = "\r";
>         while (<$remote>) {
>             print;
>         }
>     }

If you are writing the socket server (seems like you are), then this
will work perfectly.  $/ is the input record seperator, and is
different from your output record seperator.

When writing software that has to be cross platform you need to
consider which newline sequence you are to be using... and set it
explicitly.  Only when printing to display should it be converted
to the os sequence.

> > And as you can probably see I'm not too clued up on the software
> > side of things.

I hope Felix wasn't making a statement by leaving that in as the only
quote from your original post (j/k - I'm sure he didn't mean it that
way!) :P

Jonathan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to