Hacker News new | past | comments | ask | show | jobs | submit login

> From someone who loves Perl, please do not use it in production :)

From another someone who has written fair amount of perl, some of them are simple idioms suitable for production use; rest are just an exercise in curiosity.

The venus operator "0+ $input"(or `0 + $input` as I will write it) is an acceptable and recommended way to convert input to number(i.e if you know your your input is a valid number in string form). !! isn't unique to perl - I have used it in JS, C etc to convert a value to boolean. @{[ ]} is useful for logging, thought it does look difficult to grok in first look. Goatse is basically list assignment and then using it in scalar context; I won't do that but assigning to list is frequently done `my ($a, $b) = $input =~ /regex/`. =<>~ is just badly formatted `my ($a, $b) = <> =~ /regex/` will read fine to a perl programmer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: