Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and it correctly grabs from the telnet connection the string ATREPLY 27,12 +CUSD: 0,"Your Number is +233266684011",15 but if I make:$exp->expect($timeout, [ qr/.*$card,$sim.*Your Number is \+([0-9]+).*/, sub { ($gsm_number_gotten) = @{$exp->matchlist()}; print "Got gsm_number=$gsm_number_gotten for card=$card + sim=$sim\n\n"; } ]);
and then:my $number_string = 'Your number is \+([0-9]+)';
it stops grabbing the line. Could you please enlighten me to what am I doing wrong? Humbly and gratefully, Jose$exp->expect($timeout, [ qr/.*$card,$sim.*$number_string.*/, sub { ($gsm_number_gotten) = @{$exp->matchlist()}; print "Got gsm_number=$gsm_number_gotten for card=$card + sim=$sim\n\n"; } ]);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: qr// for Expect.pm problem
by toolic (Bishop) on Jun 25, 2011 at 19:17 UTC | |
by silentius (Monk) on Jun 25, 2011 at 19:20 UTC | |
|
Re: qr// for Expect.pm problem
by BrowserUk (Patriarch) on Jun 25, 2011 at 19:26 UTC | |
by silentius (Monk) on Jun 25, 2011 at 20:08 UTC | |
by AnomalousMonk (Archbishop) on Jun 25, 2011 at 21:17 UTC | |
by silentius (Monk) on Jun 26, 2011 at 19:19 UTC |