How does double arrow (=>) operator work in Perl?

I know about the hash use of the => operator, like this

$ cat array.pl
%ages = ('Martin' => 28,
         'Sharon' => 35,
         'Rikke' => 29,);

print "Rikke is $ages{Rikke} years old\n";
$ perl array.pl
Rikke is 29 years old
$

and I thought it was just syntax to initialize hashes, but in answers to How can I qualify a variable as const/final in Perl?, => has been used like this

use Readonly;
Readonly my $infilename => "input_56_12.txt";

What exactly does => mean? Are there more ways in which => can be used?

22
задан Community 23 May 2017 в 12:02
поделиться