Chi si ricorda della variabile $~?
perlvar viene in aiuto:


HANDLE->format_name(EXPR)
$FORMAT_NAME
$~ The name of the current report format for the currently selected
output channel. The default format name is the same as the
filehandle name. For example, the default format name for the
"STDOUT" filehandle is just "STDOUT".

Da piccolo usavo molto i formati Perl, anche se li trovavo poco leggibili. Probabilmente
proveniendo dal mondo della carta stampata su modulo continuo avevo l'abitudine mentale di
voler "immaginare" l'output in formato tabellare (non saprei pensare ad altro
utilizzo dei formati).
Ecco quindi che spesso i miei programmi assumevano la forma:


format most_called_format=
|@<<<<<<<<<<<<<<<<<<<<<|@>>>>>>|
$number, $call
.

Ormai, almeno per me (ma penso anche per moltissimi sviluppatori Perl), i formati non sono altro
che un ricordo!

The article Ti ricordi dei formati Perl? has been posted by Luca Ferrari on May 7, 2017

Tags: perl