File: _FieldHash.pm

package info (click to toggle)
libje-perl 0.066-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,008 kB
  • sloc: perl: 31,288; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 747 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package JE::_FieldHash;

our $VERSION = '0.066';


use strict;
use warnings;

BEGIN {
	eval { require Hash::Util::FieldHash;
	       import  Hash::Util::FieldHash 'fieldhash'; };
	if ($@) {
		require Tie::RefHash::Weak;
		eval 'sub fieldhash(\%) {
			tie %{$_[0]}, "Tie::RefHash::Weak";
			$_[0];
		}';
	}
}

use Exporter 5.57 'import';

our @EXPORT = 'fieldhash'; # this returns a veracious value

__END__

=head1 NAME

JE::_FieldHash - This module is solely for JE's private use.

=head1 SYNOPSIS

  use JE::_FieldHash;
  fieldhash my %foo;

=head1 DESCRIPTION

This is a thin wrapper around Hash::Util::FieldHash, or Tie::RefHash::Weak
if the former is not available. B<It is liable to change or vanish without
notice.>

=head1 SEE ALSO

L<JE>