i find an error message saying "cant use string<1> while strict ref"? please also say how can we find the number of matches for any regexp.
#! usr/bin/perl use warnings; use strict; my $x = "Mmm...donut, thought Homer"; $x =~ /^(Mmm|Yech)\.\.\.(donut|peas)/; # matches foreach my $expr (1..$#-) { print "Match $expr: '${$expr}' at position ($-[$expr],$+ [$expr])\n +"; }
In reply to can't use string refs while "strict refs" by artifact
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |