Jump to content

Create an object/Native demonstration: Difference between revisions

m
→‎{{header|Perl}}: future-proof for 5.36, explicit :prototype
m (syntax highlighting fixup automation)
m (→‎{{header|Perl}}: future-proof for 5.36, explicit :prototype)
Line 668:
 
=={{header|Perl}}==
<syntaxhighlight lang="perl">packageuse LockedHashstrict;
 
use parent Tie::Hash;
package LockedHash;
use parent 'Tie::Hash';
use Carp;
use strict;
 
sub TIEHASH {
Line 711 ⟶ 712:
}
 
sub lock_hash :prototype(\%) {
my $ref = shift;
tie(%$ref, __PACKAGE__, %$ref);
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.