title: How can I qualify a variable as const/final in Perl?
body: <p>For example, in situations like below, I do not want to change the value of <code>$infilename</code> anywhere in the program after initialization.</p>
  
  <pre><code>my $infilename = "input_56_12.txt";
  open my $fpin, '&lt;', $infilename
      or die $!;
  
  ...
  print "$infilename has $result matches\n";
  
  close $fpin;
  </code></pre>
  
  <p>What is the correct way to make sure that any change in <code>$infilename</code> results in not just warnings, but errors?</p>