Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Overloading Weirdness

by pudge (Sexton)
on Jun 23, 2018 at 15:01 UTC ( [id://1217280]=note: print w/replies, xml ) Need Help??


in reply to Re: Overloading Weirdness
in thread Overloading Weirdness

What version of perl is that? I saw no difference whether it was in a separate file. Thanks!

Replies are listed 'Best First'.
Re^3: Overloading Weirdness
by Athanasius (Archbishop) on Jun 24, 2018 at 03:26 UTC

    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,

      I see no difference in any perl by moving it to the top of the file, or to a different file. I can't see why it would make a difference, and I do not see that it does make a difference. Odd. Even though you're using Windows, I don't know why the behavior would be different.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found