Posted By

noah on 12/29/10


Tagged

php testing Bash whitespace perl debugging programming tools analysis static one-liners lint


Versions (?)

Detect PHP files with trailing whitespace, using Perl


 / Published in: Perl
 

The following incantation returns nonzero exit status when the terminating ?> of a PHP file, is followed by whitespace.

  1. perl -lne 'BEGIN{undef $/}; m/(\?>\s+)/ and exit 1' my_file.php

Report this snippet  

You need to login to post a comment.