File: SharedHash.pm

package info (click to toggle)
libtest-spec-perl 0.54-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 308 kB
  • sloc: perl: 2,502; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 280 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package Test::Spec::SharedHash;
use strict;
use warnings;
use Tie::Hash;
use base qw(Tie::StdHash);

# a semaphore
our $Initialized = 0;

our %STASH;

sub TIEHASH {
  my $class = shift;
  my $ref = \%STASH;
  bless $ref, $class;
  return $ref;
}

sub reset {
  %STASH = ();
}

1;