summarylogtreecommitdiffstats
path: root/StdScalar.pm
diff options
context:
space:
mode:
Diffstat (limited to 'StdScalar.pm')
-rw-r--r--StdScalar.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/StdScalar.pm b/StdScalar.pm
new file mode 100644
index 000000000000..c0d4c8288f96
--- /dev/null
+++ b/StdScalar.pm
@@ -0,0 +1,23 @@
+package Tie::StdScalar;
+@ISA = qw(Tie::Scalar);
+
+sub TIESCALAR {
+ my $class = shift;
+ my $instance = shift || undef;
+ return bless \$instance => $class;
+}
+
+sub FETCH {
+ return ${$_[0]};
+}
+
+sub STORE {
+ ${$_[0]} = $_[1];
+}
+
+sub DESTROY {
+ undef ${$_[0]};
+}
+
+1;
+