$ perl -e'@f=qw/foo bar baz/;for (@f) {print;shift @f}' foobaz$