I write perl everyday, I never use this stuff.
Perl secret operators and constants
21–30 of 46 posts
Re: Perl secret operators and constants
#22I have been using Perl since 1996, but I only use a handful of the secret operators. For me, the power with Perl is CPAN and the stability of Perl 5.
Re: Perl secret operators and constants
#23I write perl everyday, I never use this stuff.
List interpolation is occasionally necessary for syntax reasons, though I don't think of that as an operator, but the composition of its parts.
!! is for if you don't really love the loosey-goosey nature of Perl, and want to have a function that really, truly returns a boolean, and doesn't just return something that may or may not be a value that is either falsy or not. If you think in OO you may not want people coming to depend on the exact falsy value returned, which may expose internals. Generally I just go with the general Perl/scripting language approach, except when I know I'm leaking internals that I really, really don't want people to couple to.
The rest are mostly for show.
Re: Perl secret operators and constants
#24Re: Perl secret operators and constants
#25Re: Perl secret operators and constants
#26I know of C's secret "limit" operator:
int x = 10; while (x --> 0) { printf("%i", x); }
prints 9876543210
Of course, in some ML dialects you can define your own opreators - such as (f |> g) to mean (g o f) which is actually very useful.
Re: Perl secret operators and constants
#27Re: Perl secret operators and constants
#28It's articles like this that give Perl a bad reputation.
https://www.google.com/search?q=perl+"baby+talk"
in the real world it's called clean, maintainable code.
Re: Perl secret operators and constants
#29Re: Perl secret operators and constants
#30I wonder how many other languages have well-known secret operators? I know of C's secret "limit" operator: int x = 10; while (x --> 0) { printf("%i", x); } prints 9876543210 Of course, in some ML dialects you can define your own opreators - such as (f |> g) to mean (g o f) which is actually very useful.
while ((x--) > 0)