http://qs321.pair.com?node_id=1217310


in reply to Re^2: Overloading Weirdness
in thread Overloading Weirdness

I was using Strawberry Perl 5.26.0 (64-bit), but I get the same result on my various Strawberry Perls going back to 5.10.1 (32-bit).

It occurred to me to try keeping the str package in the same file as the main code, but moving it to the top of the file:

package str; ... sub concat { ... } package main; use strict; use warnings; ...

And the output is the same as was obtained by moving the str package into a separate file. So the issue is (I think) not whether str is in a separate file, but whether it’s “visible” to the Perl compiler when the main code is parsed.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,