in reply to Re^2: Turning a hash into a line of links
in thread Turning a hash into a line of links
tr//--Now there's another element of perl with which I am not very familiar. When I was devising my plan, I decided that I wanted to only loop through/traverse the string once, thus the array of positions of the pipes. Does tr not loop through the string? I'll have to look that up. I was focused on the thought that I will have to loop through the string once to count all the pipes; might as well save the positions while I am there so I don't have to go back through to "find" the middle one. Yeah I had to use the number of elements in the @pipes array to do some funky arithmetic, but only one time through the string.
I've seen the q{} contruct more than once now. Do you guys use a lot of strings that contain embedded quotes? What are the relative merits of q{hi} vs 'hi'?
Thanks,
Terrence
UPDATE: I figured out what tr/// does. I kept bouncing back and forth between tr///, which says "same as y///" and y///, which says "same as tr///." Finally saw the part that says "see perlop." Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Turning a hash into a line of links
by johngg (Canon) on Dec 13, 2006 at 20:45 UTC | |
by OfficeLinebacker (Chaplain) on Dec 14, 2006 at 01:39 UTC |