File: copy.pl

package info (click to toggle)
libvariable-magic-perl 0.64-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 476 kB
  • sloc: perl: 4,256; ansic: 633; makefile: 8
file content (18 lines) | stat: -rwxr-xr-x 390 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env perl

use strict;
use warnings;

use lib qw<blib/arch blib/lib>;
use Variable::Magic qw<wizard cast>;
use Tie::Hash;

my $wiz = wizard copy => sub { print STDERR "COPY $_[2] => $_[3]\n" },
                 free => sub { print STDERR "FREE\n" };
my %h;
tie %h, 'Tie::StdHash';
%h = (a => 1, b => 2);
cast %h, $wiz;
$h{b} = 3;
my $x = delete $h{b};
$x == 3 or die 'incorrect';