CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Need help with reading string from USB port

 



kiroz237
New User

Mar 21, 2013, 11:01 PM

Post #1 of 3 (293 views)
Need help with reading string from USB port Can't Post

Hi all,

I'm quite new in PERL and would like to ask how am I going to read a string from a USB bar code scanner on every scan and save it directly to a text file for further manipulation? The scanner originally will emulate keyboard input upon every read and include a carriage return after every read.
Please kindly help, thanks.


robertico
Novice

Mar 22, 2013, 12:54 AM

Post #2 of 3 (291 views)
Re: [kiroz237] Need help with reading string from USB port [In reply to] Can't Post

I'm also a beginner but maybe i can help you with this;


Code
open (OUTFILE, '>>D:\data.txt');  

$userinput = <STDIN>;
#chomp ($userinput); #optional
print OUTFILE "Code: $userinput\n";

close (OUTFILE);


Let me know if I'm completely wrong


(This post was edited by robertico on Mar 22, 2013, 5:40 AM)


kiroz237
New User

Mar 22, 2013, 1:41 AM

Post #3 of 3 (288 views)
Re: [robertico] Need help with reading string from USB port [In reply to] Can't Post

Thanks a lot. It works for me. I'm currently working on the program flow. Will update my question once I face new issue.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives