Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl vs C and Lisp

Name: Anonymous 2014-10-07 18:36

Why use Perl?

Name: Anonymous 2014-10-12 8:32

>>36
At least Larry had the fucking brains to make sure it doesn't bite you in the ass. There are separate operators for concatenation and addition, and for numeric and string equivalence.

All these are zero but true in numeric context if you need it ("0E0" and "0 but true" seem to be the most common):

"0.0" "0E0" "00" "0x0"
"+0" "-0" " 0" "0\n"
".0" "0." "0 but true"
"\t00" "\n0e1"


If you write Perl 6 instead you can do whatever you want:

> "0" ?? 1 !! 0
0 # shucks, still false in Perl 6, jerks.
> "0" but True ?? 1 !! 0
1 # what's this?
> ("0" but True) ~ "12"
012 # oh my


"but True" isn't special. "but" overrides roles, and you can say "but Something" and it will work as long as Something is actually composable.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List