Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: Use of "my" after Perl v5.14

by Rohit Jain (Sexton)
on Sep 20, 2012 at 22:55 UTC ( #994773=note: print w/replies, xml ) Need Help??

in reply to Re: Use of "my" after Perl v5.14
in thread Use of "my" after Perl v5.14

I think $TRUE variable will not be visible in second file from t2 package.. Because it is declared to be private in that package.. Will it show compiler error??

Replies are listed 'Best First'.
Re^3: Use of "my" after Perl v5.14
by marinersk (Priest) on Sep 21, 2012 at 01:10 UTC
    I didn't get an error. But then I am not using v5.14.
      I didn't get an error. But then I am not using v5.14.

      You're also not using warnings, which would have made Perl complain about "Use of uninitialized value $t2::TRUE in concatenation (.) or string at line 7" (line 7 in my altered file) regardless of Perl version. Note also that
          print " my:  \$t2::TRUE        = '$t2::TRUE'\n";
          my:  $t2::TRUE        = ''
      (empty single-quotes instead of '1') with or without warnings.

      Update: Upon re-reading your post, it occurs to me that your intention may have been to point up the fact that the value of the lexical  $TRUE defined in the  .pm file is not visible in the  .pl file ("Pay attention to the value of $TRUE in the sample..."). If so, I offer my own apologies! (In any event, the use of warnings remains a valuable, albeit implicit, recommendation.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994773]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-03-21 07:08 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (264 votes). Check out past polls.