On Mon, 2006-07-24 at 13:13 -0400, Ryan Moszynski wrote: > thanks, that works, but it won't solve my problem. > > I'm writing a program where the user enters a list through the keyboard, like: > "0..10,33..43,100..111" > > I would like to pass this list directly into a foreach function. The > problem is, when i pass my scalar in, i get: > ### > Argument "0..15,33..43,100..111" isn't numeric in array element > ### > > i guess a better question is, can I ?cast? that string into a variable > that can be recognized by the foreach? >
You could eval() the string, but a better solution is outlined in Dr.Ruud's message because if you eval() the string that is passed in, you're opening yourself up to a trivial exploit of your code by the user. -- Joshua Colson <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>