use strict;
my $str = '
DrawRect barX-2 ,barY-2 ,barW+4 ,barH+4 ;
SetColor rgb[0]*colorMultipler,rgb[1]*colorMultipler,rgb[2]*colorMultipler;
public static TImage DelayTimer_in=BM
SetAlpha - float(n) / Fade1 //nn
DrawRect 0, 0,tApplication.ScrW(),tApplication.ScrH();
SetVirtualResolution(SourceScreenWidth, SourceScreenHeight);
SetColor 0, 0, 0
Delay 10; //mmm
Flip;
SetScale 10, 10;
CloseStream tLog.file;
';
my $regex = qr/(?<spaceBefore>^[ \t]*)(?<function>SetColor|SetAlpha|DrawRect|Delay|Flip|SetScale|SetVirtualResolution|CloseStream)[ \t]*(?!\()(?<parameters>[\w \(\)\-,\.\/\[\]\*\t\+]+)?;?/mp;
my $subst = '$1$2\\($3\\);';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html