Net::Telnet - Library Application



I have a problem with something I am doing using net::telnet in perl.
I am trying to write a script that will access an automated library system via telnet and basically mimic what the company that sold us the system did in VB. I am basically reverse engineering their code only in perl.. anyway... My problem is that I am having to search for different flags using waitfor. sometimes it is the word Description, sometimes it is \x8f (I have no idea why but they seem to use that as a delimiter quite often) My problem is that when I get to a particular piece of data, I am not getting everything from the stream in my waitfor variable.

This is a snippit of the code

#cleaning out the buffer
($info) = $galaxy->waitfor("/\x8f/");
print "1 $info\n";

($info) = $galaxy->waitfor("/\x8f/");
print "2 $info\n";


$galaxy->print("5000 5018 30 0 0 ");

($info) = $galaxy->waitfor("/\x8f/");
$info =~ s/\\b/\n/g;
$info =~ s/\\B/\<b\>/g;
$info =~ s/\n/\<\/b\>\n/g;
print "$info\n";


($info) = $galaxy->waitfor("/Description/");
$info =~ s/\\b/\n/g;
$info =~ s/\\B/\<b\>/g;
$info =~ s/\n/\<\/b\>\n/g;
print "$info\n";

#got stuff up to description now
($info) = $galaxy->waitfor("/\x5C\x62/");
$info =~ s/\\b/\n/g;
$info =~ s/\\B/\<b\>/g;
$info =~ s/\n/\<\/b\>\n/g;
print "Description: $info\n";


print "\nLogging out of galaxy\n";
#$ok = $galaxy->waitfor("/\x8f/");
$ok = $galaxy->print("999");
$ok = $galaxy->print("0005 GALAXY||20");
$ok = $galaxy->print("0010 ");

$galaxy->close;
-----------------------------------
0x000e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0x000f0: 20 5c 62 20 20 54 79 70 65 2f 6c 61 6e 67 75 61 \b Type/langua
0x00100: 67 65 3a 20 5c 42 42 6f 6f 6b 2f 65 6e 67 5c 62 ge: \BBook/eng\b
0x00110: 0d 20 20 20 49 53 42 4e 2f 49 53 53 4e 3a 20 5c . ISBN/ISSN: \
0x00120: 42 2f 5c 62 0d 20 44 65 73 63 72 69 70 74 69 6f B/\b. Descriptio
0x00130: 6e 3a 20 5c 42 31 37 38 20 70 2e 2c 20 32 30 20 n: \B178 p.. 20
0x00140: 63 6d 2e 20 20 20 20 20 20 20 20 20 5c 62 cm. \b

0x00000: 39 39 39 0d 999.

0x00000: 30 30 30 35 20 47 41 4c 41 58 59 7c 7c 32 30 0d 0005 GALAXY||20.

0x00000: 30 30 31 30 20 0d 0010 .

----------------------------------------------
above is the dump file (a little difficult to read :( )


it SEES the word description and gives me the info up to that.. BUT after description the delimiter is \b (\x5c\x62) which is what I do a waitfor on. all I get is a \

Everything after 0x00140: is my program signing out of the telnet session..

Any way to get that information into my variable?? Ive been beating my head for 4 days now... any help is appreciated.


Carl Lafferty
System Admin
Floyd County Public Library
Prestonsburg, KY
.