Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)

by GrandFather (Saint)
on Oct 10, 2005 at 01:15 UTC ( [id://498666]=note: print w/replies, xml ) Need Help??


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

But what is the question? What do you expect to see printed?


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

Replies are listed 'Best First'.
Re^2: Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)
by gman (Friar) on Oct 10, 2005 at 01:19 UTC
    I would like my output to be the same using as
    explecit for(1..5) or a string in it's place for($string)
    where $string = "1..5";
    Thanks

      Do you want something like:

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

      Perl is Huffman encoded by design.
        Exactly!!!!
        Thanks! Should I have looked in the docs about eval?

        Thanks again!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://498666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found