perl -e 'undef $/; $ENV{f}=$ARGV[0]; $_=`cat -- "\$f"`;
Backquotes in scalar context already do what you want regardless of the contents of $/ and you can use $ARGV[0] directly instead of copying it to the environment, so that then becomes:
perl -e ' $_=`cat -- "$ARGV[0]"`;
You could also simplify that whole thing with the use of the -0 switch and the -p switch:
perl -0777pe's/^(\w+[^\n;]*?\([^\n;]*\n\{\n)[\s\S]+?\n(\}\n)/$1$2/mg' +FILE.c > FILE_MODIFIED.c
In reply to Re^2: empty out C function bodies
by jwkrahn
in thread empty out C function bodies
by biocc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |