In the Perl documentation for reverse
I find this:
"Note that reversing an array to itself (as in @a = reverse @a ) will preserve non-existent elements whenever possible; i.e., for non-magical arrays or for tied arrays with EXISTS and DELETE methods."
What properties differentiate a magical from a non-magical array?
Magic Arrays are special tools that require a number of magic class players in order to activate the effect. They can be created by Magicians, purchased in special locations, obtained in quests, and found in dungeons and ruins.
The @_ variable is an array that contains all the parameters passed into a subroutine. The parentheses around the $string variable are absolutely necessary. They designate that you are assigning variables from an array.
Note: In Perl arrays, the size of an array is always equal to (maximum_index + 1) i.e. And you can find the maximum index of array by using $#array. So @array and scalar @array is always used to find the size of an array.
Magical variables are those that have special features that a normal variables of that type do not have.
See Magic Variables in perlguts. See also Variable::Magic which lets you "Associate user-defined magic to variables from Perl."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With