Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: RFC: beginner level script improvement

by jwkrahn (Monsignor)
on Sep 21, 2013 at 21:54 UTC ( #1055155=note: print w/ replies, xml ) Need Help??


in reply to RFC: beginner level script improvement

## set the Newline/Carriage Return character(s) this device expect +s (e.g. NL = \n, CR = \r, CRLF=\r\l) $NL = "\r\l"; $NL = "\r\l";

The \l escape sequence in interpreted by perl to mean "lower case the next character" so those strings are just the one character \r.    See lcfirst.

$NL = "\0xa";

'x' is not a valid octal digit so that string consists of three characters, "\0", 'x' and 'a'.    Perhaps you meant "\x0a"?

If you need help with network compatible line endings see the Socket module.

sleep 0.1;

You use this statement 18 times but sleep does not accept fractions of a second, only whole seconds.    Perhaps you should look at the Time::HiRes module or Perl's select function.


Comment on Re: RFC: beginner level script improvement
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2014-08-22 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (148 votes), past polls