Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Consider the following code snippet:
my %options; my $options->{'heredoc'} = '1'; my $config_copy = ReadINI ($copy,%options);

What this is actually saying is annotated below.

# Create a hash called %options my %options; # Create a *scalar* variable called $options and then try # to use it as a reference. Since it's just been created, # it's undefined. Hence this won't work. my $options->{'heredoc'} = '1'; # Call ReadINI passing it $copy and your %options hash. my $config_copy = ReadINI ($copy,%options);

I imagine that the line you want to have in the middle there is:

$options{heredoc} = 1;

It's a hash look up. %options is a hash, not a hash reference. If its not a reference, you don't want the arrow.

I hope this helps.

jarich

In reply to Re^3: more fun w/ HASh ref's by jarich
in thread more fun w/ HASh ref's by hesco

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 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?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found