neidu2, 1 year ago (edited 8 months ago) using regex to find the absolute value of a number: $number =~ s/-//; using regex to check if a number is odd: print “odd!\n” if (($number / 2) =~ /./) …and generally abusing regex for weird stuff it wasn’t intended for, because the regex engine is surprisingly efficient. 🌼 Just PERLy Things! 🌼
using regex to find the absolute value of a number: $number =~ s/-//;
using regex to check if a number is odd: print “odd!\n” if (($number / 2) =~ /./)
…and generally abusing regex for weird stuff it wasn’t intended for, because the regex engine is surprisingly efficient.
🌼 Just PERLy Things! 🌼