Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Issue with capture the output of android command in perl

by shmem (Canon)
on Nov 27, 2013 at 09:27 UTC ( #1064587=note: print w/ replies, xml ) Need Help??


in reply to Issue with capture the output of android command in perl

At the moment the list of lines is assigned to your @lnes variable (why do you omit the i? iShortage?), the telnet command already has returned. No need to sleep here.

The problem might be that a) there are no lines returned or b) the lines are empty and/or c) they have no newline character at the end. Try:

@lines= $port->cmd("input keyevent 66"); # added i print "Number of lines returned: ", scalar(@lines), "\n"; print "Console Log:\n"; # added newline character for( @lines ) { print ">$_<\n" }
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'


Comment on Re: Issue with capture the output of android command in perl
Select or Download Code

Log In?
Username:
Password:

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

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

    When choosing user names for websites, I prefer to use:








    Results (203 votes), past polls