# no need to join perl -0x25 -e '$_{$.}=$_ while<>; print %_' # dumps one random cookie (not just shuffling): perl -0x25 -e '$_{$.}=$_ while<>; print ((%_)[$.==$.])' # and this but slicing it perl -0x25 -e '@_{<>}=1; print ((%_)[$.-$.]);' # not sure but this works too (re: looks like slice key is created after slurping) perl -0x25 -e '@_{1..$.}=<>; print %_;'