Regular Expression Annoyance

Tom Hukins tom at eborcom.com
Sun Jun 13 07:22:29 PDT 2010


On Sat, Jun 12, 2010 at 06:49:25PM +0200, Jan Henning Thorsen wrote:
> Can't you just store the value of $1? Like:
> 
>  my $s;
>  $mech->content_unlike( ($s) = qr/Error: ([^>]+)/, 'No error message' );
>  diag $s if $s;

No, you can't:
perl -e 'use Test::More "no_plan"; like( "X", ($x) = qr/(X)/ ); diag $X'

Tom


More information about the MiltonKeynes-pm mailing list