-p, perl can do what grep/awk/sed can, what about ruby?
Let's take the result of
ls -l as input and process it with ruby
grep with ruby
\ls -l | ruby -ne 'print if /^d/'
awk with ruby
\ls -l | ruby -ne 'puts split(/\s+/).last if /^d/'