Unable to read the string
- From: sajapuram.arun.prakash@xxxxxxxxx (Arun)
- Date: Wed, 30 Jul 2008 21:55:22 -0700 (PDT)
Hi this is Arun here, i am new to perl.Here i am trying to read a
string from the serial port but i am not able to and this is my
program:
# Read serial port until message or timeout occurs
sub ReadPort($$$) {
(my $String, my $TimeOut, my $Display) = @_;
$ob->read_const_time($TimeOut); # Setup timeout value in mS
my $Reply = ""; # Initialize message
do {
($Count, $Result) = $ob->read(1); # Read serial port
$Reply .= $Result; # Build message
print "$Result" if ($Display); # Display messages if enabled
} while($Count > 0 and $Reply !~ m/$String/);
print "\n" if ($Display); # Put carriage return at end of
displayed output
if ($Reply !~ m/$String/) {
print "ERROR: Read timed out waiting for '$String' \n";
return(1);
}
return($Reply);
So just needed help for the above program to be solved.
.
- Follow-Ups:
- RE: Unable to read the string
- From: Bob McConnell
- Re: Unable to read the string
- From: Rob Dixon
- RE: Unable to read the string
- Prev by Date: Problems w/ MVS::JESFTP.pm
- Next by Date: can perl program do this?
- Previous by thread: Problems w/ MVS::JESFTP.pm
- Next by thread: Re: Unable to read the string
- Index(es):
Relevant Pages
|