Created
November 22, 2013 07:55
-
-
Save anonymous/7596385 to your computer and use it in GitHub Desktop.
An example of File::Map's map_anonymous used with Storable's freeze/thaw. Might be a crappy example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use feature ':5.10'; | |
use Data::Dumper; | |
use Storable qw(freeze thaw); | |
use File::Map qw(map_anonymous); | |
my @arr = ('hi', 'there'); | |
my $frozenarr = freeze \@arr; | |
my $length = length $frozenarr; | |
map_anonymous my $map, $length, 'shared'; | |
substr $map, 0, $length, $frozenarr; | |
say Dumper thaw $map; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment