(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.
It's still an issue in version 1.21 also.
Only the simple interface defaults to exact matching, the callback interface deafults to regexp. This is not very clear documented.