Perl One Liners

  • 将字符串进行URL编码(Percent-encoding, aka URL encoding)

  • $ ls *.mp4 | perl -MURI::Escape -lpe '$_ = uri_escape($_)'
    

    或者

    $ ls *.mp4 | perl -lpe 's/([^\w\-~.])/sprintf("%%%02X", ord($1))/seg'
    

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.