http://www.perlmonks.org?node_id=91318


in reply to m{} within grep{} causing problems? (code)

You are confusing perl. According to perldoc -f grep, you have two choices:
grep BLOCK LIST grep EXPR,LIST
Your usage is a hybrid of the two, as the curly braces indicate the beginning of a block. Both of these two forms work
scalar( grep m[\d{3}-\d{3}], values %batch_ids ) == 6;
or
scalar( grep { m[\d{3}-\d{3}] } values %batch_ids ) == 6;

mikfire