lang/perl/ HomePage
Important man pages
print loop
cat a.php | perl -pe 'tr/[a-z]/[A-Z]/' # converts lowercase to uppercase
cat a.php | perl -ne '/echo/ && print' # prints only matching lines
Record separator
Usually this is newlines. As an example of using something else, this uses uppercase A
as the record separator:
echo helloAworldAmrAflibble | perl -0x41 -pe 'tr/A/\n/;tr/[a-z]/[A-Z]/'