Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Yes, nice one! The keys you're creating to track Order ID/title will look something like "PO-9999,Item title here.", so that should work.

As a point of clarification, since you've declared %hash right below the start of the for loop that iterates through the records, it's not necessary to use a hash reference within that hash's scope. A hash reference to %hash was sent to the subroutine, so the entire hash wouldn't have to be copied in order to access the hash's values for writing to the Excel spread sheet.

Here are some equivalents:

$$hashReference{orderID} eq $hash{orderID} is true $$hashReference{title} eq $hash{title} is true

This means that the following:

if ($seen{$$hashReference{orderID},$$hashReference{title}}) { ...

Can be written as:

if ($seen{$hash{orderID},$hash{title}}) { ...

It's certainly OK if you prefer working with the hash reference. I'd tend to work with the hash within its scope, and a reference to it outside its scope, e.g., within a subroutine.

It's been nice working with you on this, and it's clear to me that you would have done it on your own, but I appreciate this opportunity, as I learn from each task.

As before, please let me know if you have any more questions about this...


In reply to Re^15: How best to strip text from a file? by Kenosis
in thread How best to strip text from a file? by bobdabuilda

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 chanting in the Monastery: (5)
As of 2024-04-19 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found