why si this code not working (variable substitution)

2011-08-16 Thread Rajeev Prasad
    foreach $str1 (@arr1){  foreach (@arr2) {  @arr3 = split(/ /,"$_");  print "array = @arr3  element0 = $arr3[0] element1 = $arr3[1]";   #this is just to check, it showing values 0 and 1 as correctly assigned  print "$str1";  } }   arr1 contains lines like: (which will be values of str1 with eac

Re: why si this code not working (variable substitution)

2011-08-17 Thread Shlomi Fish
Hi Rajeev, On Tue, 16 Aug 2011 17:38:16 -0700 (PDT) Rajeev Prasad wrote: >   >   > foreach $str1 (@arr1){ >  foreach (@arr2) { >  @arr3 = split(/ /,"$_"); >  print "array = @arr3  element0 = $arr3[0] element1 = $arr3[1]";   #this > is just to check, it showing values 0 and 1 as correctly assigne

Re: why si this code not working (variable substitution)

2011-08-17 Thread Rajeev Prasad
b. thx to all coders out there. From: Shlomi Fish To: Rajeev Prasad Cc: Perl Beginners Sent: Wednesday, August 17, 2011 10:54 AM Subject: Re: why si this code not working (variable substitution) Hi Rajeev, On Tue, 16 Aug 2011 17:38:16 -0700 (PDT) Rajeev Prasad wrote: >   >   >

Re: why si this code not working (variable substitution)

2011-08-17 Thread Uri Guttman
> "RP" == Rajeev Prasad writes: RP> foreach $line (@arr1){ RP>  foreach (@arr2) { RP>  chomp($_); RP>  @arr3 = split(/ /,$_); RP>  $mystringvar = eval "qq{$line}"; <--this suggestion came from web search. and it is a very bad idea. string eval is very dange

Re: why si this code not working (variable substitution)

2011-08-19 Thread Shlomi Fish
Hi, On Wed, 17 Aug 2011 16:15:18 -0400 "Uri Guttman" wrote: > > "RP" == Rajeev Prasad writes: > > RP> foreach $line (@arr1){ > RP>  foreach (@arr2) { > RP>  chomp($_); > RP>  @arr3 = split(/ /,$_); > RP>  $mystringvar = eval "qq{$line}"; <--this > RP> su

Re: why si this code not working (variable substitution)

2011-08-19 Thread Shlomi Fish
Hi Anant, next time please reply to all recipients instead of only to me as you did just now (as I suggest in my signature which you should have read.). I'll reply to you while CCing the list. On Fri, 19 Aug 2011 22:36:42 +0530 anant mittal wrote: > what does this eval do? There's block eval (

Re: why si this code not working (variable substitution)

2011-08-19 Thread Rajeev Prasad
Beginners Sent: Friday, August 19, 2011 2:59 AM Subject: Re: why si this code not working (variable substitution) Hi, On Wed, 17 Aug 2011 16:15:18 -0400 "Uri Guttman" wrote: > >>>>> "RP" == Rajeev Prasad writes: > >  RP> foreach $line (@arr1){ >