Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

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

I'm not at all familiar with Spreadsheet::Read (in fact, I'm not greatly familiar with spreadsheets in general), but the code you show seems close to being workable. Do this:

  • Get rid of the whole
        my %sheet = ();
    statement. In the code you show, it seems to be doing nothing more than confusing the heck out of you.
  • The  foreach (@x) { ... } loop seems OK for looping over the values of the  @x array, with the  $_ default scalar being "topicalized" to each column-name string in turn.
  • Form the cell name as has been discussed and access the cell within the  $sheet hash reference (I'm assuming this is a valid operation) using the  -> arrow operator, e.g.
        $name = $sheet->{"${_}28"};
    or perhaps
        $name = $sheet->{$_ . '28'};
  • Report results. Don't just say "it doesn't work", that's almost useless. Describe your expectations and report how the code fails to meet your expectations. Report exact warning or error messages.
  • Ponder the Basic debugging checklist.

Good luck.


In reply to Re^13: Iterating Through Cell Blocks with Spreadsheet::Read by AnomalousMonk
in thread Iterating Through Cell Blocks with Spreadsheet::Read by Hammer2001

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 exploiting the Monastery: (4)
As of 2024-04-24 05:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found