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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
i was skimming through the camel book (just revising the long forgotten things) when something struck me.....
i made a small program that creates a reference to a scalar and a hash like this
use strict; use warnings; my $scalar_ref=*foo{SCALAR}; print "scalar ref defined\n" if defined $scalar_ref; #------------------------# my hash_ref=*foo{HASH}; print "hash ref defined\n" if defined hash_ref; __END__ output scalar ref defined
the output is right in this case as the compiler need not see a scalar to create a reference but it needs to see a hash to create a reference.... so for this i did
use strict; use warnings; my $scalar_ref=*foo{SCALAR}; print "scalar ref defined\n" if defined $scalar_ref; #------------------------# my %hash=(); my hash_ref=*hash{HASH}; print "hash ref defined\n" if defined hash_ref; __END__ output Name "main::foo" used only once: possible typo at ref.pl Name "main::hash" used only once: possible typo at ref.pl scalar defined
now the problem is... the compiler sees that we do hv a hash existing then too the statement hash ref defined doesnt crop up..... why is that????
=====================================================
i'am worst at what do best and for this gift i fell blessed...
i found it hard it's hard to find well whatever
NEVERMIND

In reply to creating references by hnd

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2022-05-18 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (70 votes). Check out past polls.

    Notices?