This could also be wrapped in a conditional so as to warn if fed any non-matching input, e.g.: if ( ! /^(.+)?@@.*(.)$/ ) { warn( "Unknown line format: \"$_\"" ); } - might also be worth adding a quick explanation what the non-greedy expression does, after all you're using the /x operator, which allows you to spread the regexp over multiple lines and add comments
–
PP.Feb 23 '10 at 12:50