Hi I tried the code and the 2nd one is really preferable (I even understand it better than the first option). However, I have been trying to change so that for example I give the code the reference "Cat" and it returns me "Dog". What I mean is that it searches the 2nd row for the position not the first one and I cannot do it yet. I have been reading the Text::CSV_XS file but I find it a bit hard to grasp (I guess beucase I am still a little confused with the Perl way of working/thinking). I understand that I need to make the change in either getline() OR getline_hr_all but not sure where and what. I think all I have to do is make getline read from the 2nd line for example but I don't know how to do it. Any suggestions? Thanks in advance!
EDIT: I figured it out. What i did was instead of using getline() I used getline_all and then all I have to is offset as much as I want. Thank you all, if I have more questions I will feel free to ask :)
-
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.
|