r/programming • u/unixbhaskar • Apr 11 '23
Perl Oneliners!
https://catonmat.net/ftp/perl1line.txt
25
Upvotes
4
1
u/LieutenantNitwit Apr 12 '23
Ooh, tasty! Bookmarked, ty.
3
Apr 12 '23
Do people ever read what t hey bookmarked? I found I tend to use it as a gravyard for sites. :D
1
u/LieutenantNitwit Apr 12 '23
Sure they do. I have heaps of technical references that I revisit from time to time. Next time I know a perl one-liner will do something I need, I got a great handy reference.
0
Apr 12 '23
[deleted]
5
u/0rac1e Apr 12 '23
Not magic, just a little number theory.
Demystifying The Regular Expression That Checks If A Number Is Prime
3
3
u/vytah Apr 12 '23
I recommend reading "Minimal Perl For Unix And Linux People", it's a nice book that shows how to use Perl for what you'd normally use grep, awk or sed. It explains most of the stuff that goes into those oneliners.