Based on this part of the error diagnostics:

"my" variable $book_ref masks earlier declaration in same scope at DisplayStuff.pm line 100

the first thing I'd do is search backward in the module from line 100, looking for "$book_ref", to see if it's declared with "my" at some point outside of any other subroutine -- i.e. lexically "global" within the module file (excuse me if those terms are not exactly correct, but I hope you get the idea).

The other possibility, given the nature of the syntax error reports, is that a previous sub or other block is lacking a closing curly brace, causing the "sub display_basic" to be considered as part of some other block of code (which also happens to declare its own "my $boof_ref"); if you use a programmer's text editor that supports automatic indentation (like (x)emacs) -- in the sense that the editor can parse the code well enough to indent a line appropriately, based on the current bracketing depth -- this can help a lot to watch for cases where you've forgotten a close-bracket somewhere.


In reply to Re: Passing hash references into subs by graff
in thread Passing hash references into subs by Indomitus

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.