in reply to Matching for the second,fourth, and fifth word in a text

#!/usr/bin/perl -wl use strict; while(<>) { /^printer/ ? chomp : next; print join ", ", (/(\w+)/g)[1,3,4]; } __END__ llp, idle, enabled ps, idle, enabled

Makeshifts last the longest.