in reply to Re^2: Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)
in thread Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)

Do you want something like:

my $range = "2..5,10..15"; my @ranges = eval "($range)";

Perl is Huffman encoded by design.
  • Comment on Re^3: Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)
  • Download Code

Replies are listed 'Best First'.
Re^4: Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)
by gman (Friar) on Oct 10, 2005 at 01:39 UTC
    Exactly!!!!
    Thanks! Should I have looked in the docs about eval?

    Thanks again!!!