Skip to content

Instantly share code, notes, and snippets.

@ifduyue
Last active November 9, 2021 01:13
Show Gist options
  • Save ifduyue/79026f7a025d60068eb2ba6d2e01a7fa to your computer and use it in GitHub Desktop.
Save ifduyue/79026f7a025d60068eb2ba6d2e01a7fa to your computer and use it in GitHub Desktop.
My Perl one liner collections
# Check if FILES contain lines ending with whitespaces
perl -Mopen=IO,:raw -ne 'print "$ARGV $.\n" if /\s\R/; $.=0 if eof;' FILES
# shuffle lines
perl -MList::Util=shuffle -e 'print shuffle <>'
# random string
perl -le 'print map chr 33 + rand 94, 1..pop||20' 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment