Group
Extension

Matches 10

Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/17_alias_lex_inner.t ( view source; MetaCPAN )
($x = $z), \$z;
is \$x, \$z;
isnt \$y, \$z;

is \alias($x ||= $T), \$T;
is \$x, \$T;
isnt \alias($x ||= $y), \$y;
is \$x, \$T;
is \alias($x &&= $z), \$z;
is \$x, \$z;
isnt \alias($x &&= $T), \$T;
is \

isnt \@y, \@z;

@x = (); @z = (42);
isnt \alias(@x = (@z)), \@z;
isnt \@x, \@z;
is \$x[0], \$z[0];

my (%x, %y, %z);

is \alias(%x = %y), \%y;
is \%x, \%y;
is \alias(%x = %z), \%z;
is \%x, \%z;
isnt 
\%y, \%z;

%x = (); %z = (x => 42);
isnt \alias(%x = (%z)), \%z;
isnt \%x, \%z;
is \$x{x}, \$z{x};

my $outer = "outer";

sub foo {
	no warnings 'closure';
	alias $outer = "inner";
	sub { $outer }
}

Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/03_copy.t ( view source; MetaCPAN )

is copy { $x }, $x;
isnt \copy($x), \$x;
isnt \copy { $x }, \$x;

is_deeply [copy $x, $y, $z], [$x, $y, $z];
our @r = refs(copy $x, $y, $z);
isnt $r[0], \$x;
isnt $r[1], \$y;
isnt $r[2], \$z;

sub mo
nonmortal () { 42 }

$x = "".\mortal;
$y = "".\copy mortal;
is $x, $y;

$x = "".\nonmortal;
$y = "".\copy nonmortal;
isnt $x, $y;

$x = "".\scalar copy();
$y = "".\undef;
isnt $x, $y;

# vim: ft=perl
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/19_alias_aelem.t ( view source; MetaCPAN )
, \$x[2];
isnt \$x[1], \$x[2];

is \alias($x[0] ||= $T), \$T;
is \$x[0], \$T;
isnt \alias($x[0] ||= $x[1]), \$x[1];
is \$x[0], \$T;
is \alias($x[0] &&= $x[2]), \$x[2];
is \$x[0], \$x[2];
isnt \alias($
, \$y[2];
isnt \$y[1], \$y[2];

is \alias($y[0] ||= $T), \$T;
is \$y[0], \$T;
isnt \alias($y[0] ||= $y[1]), \$y[1];
is \$y[0], \$T;
is \alias($y[0] &&= $y[2]), \$y[2];
is \$y[0], \$y[2];
isnt \alias($
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/20_alias_helem.t ( view source; MetaCPAN )
, \$x{2};
isnt \$x{1}, \$x{2};

is \alias($x{0} ||= $T), \$T;
is \$x{0}, \$T;
isnt \alias($x{0} ||= $x{1}), \$x{1};
is \$x{0}, \$T;
is \alias($x{0} &&= $x{2}), \$x{2};
is \$x{0}, \$x{2};
isnt \alias($
\alias($y->{0} = $y->{2}), \$y->{2};
is \$y->{0}, \$y->{2};
isnt \$y->{1}, \$y->{2};

is \alias($y->{0} ||= $T), \$T;
is \$y->{0}, \$T;
isnt \alias($y->{0} ||= $y->{1}), \$y->{1};
is \$y->{0}, \$T;
is
 \alias($y->{0} &&= $y->{2}), \$y->{2};
is \$y->{0}, \$y->{2};
isnt \alias($y->{0} &&= $T), \$T;
is \$y->{0}, \$y->{2};

alias { is \(local $y->{0} = $y->{1}), \$y->{1}; is \$y->{0}, \$y->{1} };
is \$
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/14_alias_pkg_hash.t ( view source; MetaCPAN )
ias(%x = %z), \%z;
is \%x, \%z;
isnt \%y, \%z;

alias { is \(local %x = %y), \%y; is \%x, \%y };
is \%x, \%z;

%x = (); %y = (x => 42);
isnt \alias(%x = (%y)), \%y;
isnt \%x, \%y;
is \$x{x}, \$y{x};

is \%x, \%z;
alias { is \(local %$gx = %y), \%y; is \%x, \%y };
is \%x, \%z;

my $gy = *y;

%x = (); %y = (x => 42);
isnt \alias(%$gx = (%$gy)), \%y;
isnt \%x, \%y;
is \$x{x}, \$y{x};

# vim: ft=perl
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/13_alias_pkg_array.t ( view source; MetaCPAN )
alias(@x = @z), \@z;
is \@x, \@z;
isnt \@y, \@z;

alias { is \(local @x = @y), \@y; is \@x, \@y };
is \@x, \@z;

@x = (); @y = (42);
isnt \alias(@x = (@y)), \@y;
isnt \@x, \@y;
is \$x[0], \$y[0];

my 
y };
is \@x, \@z;
alias { is \(local @$gx = @y), \@y; is \@x, \@y };
is \@x, \@z;

my $gy = *y;

@x = (); @y = (42);
isnt \alias(@$gx = (@$gy)), \@y;
isnt \@x, \@y;
is \$x[0], \$y[0];

# vim: ft=perl
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/12_alias_pkg_scalar.t ( view source; MetaCPAN )
($x = $z), \$z;
is \$x, \$z;
isnt \$y, \$z;

is \alias($x ||= $T), \$T;
is \$x, \$T;
isnt \alias($x ||= $y), \$y;
is \$x, \$T;
is \alias($x &&= $z), \$z;
is \$x, \$z;
isnt \alias($x &&= $T), \$T;
is \
s \$x, \$z;

is \alias($$gx ||= $T), \$T;
is \$x, \$T;
isnt \alias($$gx ||= $y), \$y;
is \$x, \$T;
is \alias($$gx &&= $z), \$z;
is \$x, \$z;
isnt \alias($$gx &&= $T), \$T;
is \$x, \$z;

alias { is +(l
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/15_alias_pkg_misc.t ( view source; MetaCPAN )
\&x }, \&foo;
isnt \&x, \&foo;
is alias { local *x = *foo{FORMAT}; *x{FORMAT} }, *foo{FORMAT};
isnt *x{FORMAT}, *foo{FORMAT};
is alias { local *x = *STDIN{IO}; *x{IO} }, *STDIN{IO};
isnt *x{IO}, *STDI
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/05_alias_parse2.t ( view source; MetaCPAN )
y 42 }

alias { BEGIN { do "./t/lib/assign.pm" or die $! } };
isnt \$x, \$y;
is $x, 42;

our $z = 1;
alias($x = $y) = $z;
is \$x, \$y;
isnt \$x, \$z;
is $x, $z;

alias { sub foo { $x = $y } };
is \foo
Data-Alias ( X/XM/XMATH/Data-Alias-1.25_01.tar.gz, XMATH, 2021; MetaCPAN )
Data-Alias/t/24_alias_cond.t ( view source; MetaCPAN )

use lib 'lib';
use Test::More tests => 6;

use Data::Alias;

for (0, 1) {
	my ($x, $y, $z);

	is \alias($_ ? $y : $z = $x), \$x;
	is $_ ? \$y : \$z, \$x;
	isnt $_ ? \$z : \$y, \$x;
}

# vim: ft=perl

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.