in reply to How to hash without the hash- basic

<contradictor>

but i cannot use the built-in hash data structure

Sure you can ;)

Oh, yes and i have to stick to only basic conditionals and iterators

No you don't ;)

Can anyone make a creative suggestion on how to do this in more effective and economic way ?

use a hash ;)

</contradictor>

substr

sub getNth { my $nth = shift; my $index = $width * $nth; substr $_[0], $index, $width; }

Replies are listed 'Best First'.
Re^2: How to hash without the hash- basic
by ww (Archbishop) on Oct 26, 2011 at 15:27 UTC

    OP smells like a challenge or homework so perhaps read it again after some substitutions?

    s/cannot/am not allowed to/
      and
    s/have to stick to/am allowed to use only/