C<$_[2]> is an alias to the current key.
Nothing prevents you from changing it, but be aware that there lurk dangerous side effects.
C<$_[2]> is an alias to the current key.
Nothing prevents you from changing it, but be aware that there lurk dangerous side effects.
You can get a copy instead by passing C<< copy_key => 1 >> to L</wizard>, which allows you to safely assign to C<$_[2]> in order to e.g. redirect the action to another key.
This however has a little performance drawback because of the copy.
You can get a copy instead by passing C<< copy_key => 1 >> to L</wizard>, which allows you to safely assign to C<$_[2]> in order to e.g. redirect the action to another key.
This however has a little performance drawback because of the copy.
getdata [$@%&*]var, [$wiz|$sig]
This accessor fetches the private data associated with the magic C<$wiz> (or the signature C<$sig>) in the variable.
getdata [$@%&*]var, [$wiz|$sig]
This accessor fetches the private data associated with the magic C<$wiz> (or the signature C<$sig>) in the variable.
# Get the attached data, or undef if the wizard does not attach any.
my $data = getdata $x, $wiz;
# Get the attached data, or undef if the wizard does not attach any.
my $data = getdata $x, $wiz;