Menu

#13 expect() escaping issues

open-accepted
5
2009-12-17
2008-11-23
Anonymous
No

(Forwarded by jh@debian.org, Debian BTS #426192)

joey@kodama:~>perl -we 'use strict; use Expect; my $e=Expect->spawn("ls"); $e->expect(0, [q{[} => sub {}])'
Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ()/ at /usr/share/perl5/Expect.pm line 707.
joey@kodama:~>perl -we 'use strict; use Expect; my $e=Expect->spawn("ls"); $e->expect(0, ["-re" , q{[} => sub {}])'
Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ()/ at /usr/share/perl5/Expect.pm line 707.

According to the documentation, the '[' in the first expression should not be interpreted as
a regexp.

Discussion

  • Nobody/Anonymous

    It's still an issue in version 1.21 also.

     
  • Roland Giersig

    Roland Giersig - 2009-12-17
    • labels: --> Documentation
    • assigned_to: nobody --> rgiersig
    • status: open --> open-accepted
     
  • Roland Giersig

    Roland Giersig - 2009-12-17

    Only the simple interface defaults to exact matching, the callback interface deafults to regexp. This is not very clear documented.

     

Log in to post a comment.