Of Interest
Business Intelligence and Analytics
Oracle Training
|
UNIX
»
Perl
»
Programming
»
Code
Perl: Stripping out function calls
Doing a Perl global replace via reg ex is the best way to strip out matching parens from a program.
-- Strip out all MAX function calls
#!/usr/bin/perl
while (<STDIN>)
{
$line1 = $_ ;
chomp $line1;
$line1 =~ s/max +/max/ig ;
$line1 =~ s/max\((.+?)\)/\1/ig ;
print $line1 . "\n" ;
}
|
|
|
Get the latest Rocket99 news and tech tips via
|