sub Reformat { local ($_) = shift; my ($out) = ''; while (/<\?([A-Za-z_][A-Za-z0-9_]*\s*\( (?: (?: (?:"(\\"|[^"])*?") | (?:'(\\'|[^'])*?') | \)(?!\s*\?\>) | (?:[^'"\)]+) )*? ) \))\s*\?>/sx) { $out .= $`; $_ = $'; $out .= eval $1; } $out .= $_; return $out; }