in reply to weird subroutine behavior
It is truly a weird and difficult problem. Lacking any deep expertise in this area, I'm inclined to suppose that you're hitting a strange perl bug related to pad handling. Anyway...
... output of the "section 2" will contain 5 strings (I consider this the proper behavior of the subroutine "all")
Are you absolutely sure? Let me make a suggestion. I notice that you're not really using %substrings in a way suited to a hash. You add values sequentially, and then iterate over the (sorted) values. You never use the keys at all. Try replacing that hash with an array, pushing the values (those 4-tuples) onto it, and sorting that array of values. When I modified your program in this way, I got consistent behavior — but it was consistently the way other than what you said you consider the correct way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: weird subroutine behavior
by flaviusm (Acolyte) on Apr 03, 2008 at 22:03 UTC | |
by jdporter (Paladin) on Apr 03, 2008 at 23:51 UTC | |
by flaviusm (Acolyte) on Apr 04, 2008 at 14:54 UTC | |
|
Re^2: weird subroutine behavior
by flaviusm (Acolyte) on Apr 03, 2008 at 16:16 UTC |