Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
perl5
/
vendor_perl
/
Test
/
SharedFork
Upload
5 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
Array.pm
955 B
-rw-r--r--
2015-12-21 23:25:54
Edit
Del
Scalar.pm
530 B
-rw-r--r--
2015-12-21 23:25:54
Edit
Del
Store.pm
2.49 KB
-rw-r--r--
2015-12-21 23:25:54
Edit
Del
Editing: Scalar.pm
(530 B)
Path: /usr/share/perl5/vendor_perl/Test/SharedFork/Scalar.pm
Back
package Test::SharedFork::Scalar; use strict; use warnings; use base 'Tie::Scalar'; # create new tied scalar sub TIESCALAR { my ($class, $share, $key) = @_; die "missing key" unless $key; bless { share => $share, key => $key }, $class; } sub FETCH { my $self = shift; my $lock = $self->{share}->get_lock(); $self->{share}->get($self->{key}); } sub STORE { my ($self, $val) = @_; my $share = $self->{share}; my $lock = $self->{share}->get_lock(); $share->set($self->{key} => $val); } 1;