[EMAIL PROTECTED] writes: : On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote: : > Reading EX4 and seeing those "place-holder" variables made me wonder what : > happens when someone (probably Damian ;) wants to use more than 26 of them. : > Do the place-holder names scale up as if they're being automagically : > incremented? (e.g. ..., y, z, aa, ab, ...) : : Hmm. I was just reading on use.perl.org and Damian said this: : : Magic $^ variables are only magic in that they allow a : subroutine to be declared without an explicit sub keyword or an : explicit parameter list. Instead, their parameter list is : constructed implicitly: it's just the alphabetically sorted list : of the names of all the magic $^ variables within the block. : : So I may be wrong about { $^foo * $^bar } being equivalent to : {$^a * $^b }. : : Waiting for the Damian or the Larry to chime in ...
They are assumed to be declared in alphabetical order. Whoa! you say, that could get confusing. It surely can. But if you're doing something complicated enough that alphabetical order would be confusing, don't use this shorthand. Declare an explicit order instead by saying -> $foo, $bar { $foo * $bar } or sub ($foo, $bar) { $foo * $bar } (You can still declare them as $^foo etc. if you want them to be curriable parameters.) Larry