Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055155]
help
Chatterbox?
[robby_dobby]: Corion: Oh, that's awesome! Your timing is perfect enough to see all hell break loose when you get back at work :P
[marto]: well, let me know in advance, I'll buy you a pint :)
[Corion]: robby_dobby: No, I'm returning in the second workweek of January. The main hectic parts are in the first days after the start of the new year
[robby_dobby]: marto: and, I'm not sure I'd be around here long enough for YAPC::EU
[marto]: Corion nice, what are you plans for Christmas?
[robby_dobby]: Corion: Nice, you just won't be around to deal with the mess - enjoy your vacation :-)
[robby_dobby]: marto: Sure, will do. Thanks!
[Corion]: marto: No great plans - I'll meet with my sister, my brother and my mother, but that's all :)
[Corion]: ... and also a visit to my godson+family of course :)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-12-15 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (431 votes). Check out past polls.

    Notices?