Bill Jonas on Mon, 4 Sep 2000 15:22:01 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] cueurl


Hi, all.

I already sent this to Darxus last night, but I thought that I'd pass
this around.

The script that he posted last night looked good, but it didn't work for
me;  I would just get a couple of newlines whenever I scanned in one of
the barcodes from the Radio Shack catalog.  So I looked at the code, did
a little experimenting, re-read
http://slashdot.org/features/00/09/01/149223.shtml, and realized that
the initial F10 character sequence was being sent along with the rest of
the CueCat output, so I added an s/// command to get rid of it, and it
now works perfectly for me.  For those who like patches, here you go:

---begin patch---
--- cueurl      Mon Sep  4 06:08:49 2000
+++ cueurl-new  Mon Sep  4 06:09:30 2000
@@ -27,6 +27,7 @@
   chomp $line;
   # Invert case.
   $line =~ tr/[a-z][A-Z]/[A-Z][a-z]/;
+  $line =~ s/^[^.]+(.+)$/\1/;
 
   # Connect to webserver.
   unless ($handle = IO::Socket::INET->new(Proto     => 'tcp',
---end patch---

(For those who don't like patches... look at the code and at the above,
and edit the file appropriately.)

Anyway, it works perfectly for me now.  (I was seeing blank lines from the
print statement; it wasn't matching any of the lines the server returned,
thus leaving the variables with null values, but still printing the
newlines.)  Hope this helps.

Bill
-- 
>Ever heard of .cshrc?             | "Linux means never having to delete
That's a city in Bosnia. Right?    |  your love mail." -- Don Marti
(Discussion in comp.os.linux.misc  |  http://www.billjonas.com/
on the intuitiveness of commands.) |  http://www.harrybrowne.org/


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug