I have got a program written up and I have one scalar which I wish to pass from one file to another directly. So I had our $thingy; but the machiene I tried to run it on informed me that "Use of reserved word "our" is deprecated" so I opened up the library file and changed it to my $thingy. But now I am informed that $thingy is undefined when I run the program, its just a warning, but when $thingy is declared as an our the warning does not appear.
Furthermore, when attempting to construct a sample program to demonstrate what on earth I am talking about, I ran into a REALLY odd set of output.
program.pl #!/usr/bin/perl -w use strict; use lib '/home/httpd/cgi-bin/testing/WORTHLESS'; use library; print $library::my; print $library::our; my $thing = $library::my; my $other = $library::our; print "$thing\n$other"; -------------- library.pm my $my = "my"; our $our = "our"; print "lib $my\n$our endlib";
those are my sample programs, so why is it exactly that I get this output?
#./program.pl lib my Use of uninitialized value in print at ./program.pl line 6. Use of uninitialized value in print at ./program.pl line 7. Use of uninitialized value in concatenation (.) or string at ./program +.pl line 12. Use of uninitialized value in concatenation (.) or string at ./program +.pl line 12. our endlib
It is my understanding that the "lib my" and the "our endlib" should be printed out directly after each other given they are part of the same print statement. Obviously I am wrong.
Anyone know how to correct these errors or take a shortcut around the "Use of reserved word "our" is deprecated" problem?

jcpunk
all code is tested, and doesn't work so there :p (varient on common PM sig for my own ammusment)

In reply to odd things with my and our by jcpunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.