понедельник, 25 июня 2012 г.

А вы знаете про perlsecret?

English test is here
Читаю perlsecret. Оказалось забавная штука, всем советую. Ообенно понравился оператор "~~<>", называемый kite (воздушный змей) или ... sperm (тут и без перевода думаю понятно).
Приведу выдержку из документации полностью -

"Discovered by Philippe Bruhat, 2012. (Alternate nickname: "sperm")
This operator is actually a combination of the inchworm and the diamond operator. It provides scalar context to the readline() builtin, thus returning a single line of input.
It's only useful in list context (since <> already returns a single line of input in scalar and void contexts), for example for getting several lines at once:
@triplets = ( ~~<>, ~~<>, ~~<> ); # three sperms in a single egg?
Like the other operators based on bracketing constructs, the kite is a container, and can carry a payload (a file handle, in this case).
Mnemonic: It provides a feature that is tied to one line, a string, as it were. (Tye McQueen in http://www.perlmonks.org/?node_id=959906)."

1 комментарий: