Re: Dynamic replacement of the variable

2011-04-19 Thread Shlomi Fish
On Tuesday 19 Apr 2011 20:20:27 Jenda Krynicky wrote: > From: Rob Dixon > > > On 19/04/2011 12:56, Jenda Krynicky wrote: > > >>>SF> Well, you are right naturally, but there is no need to be so > > >>>SF> rude. Start your email with a greeting, continue with a > > >>>SF> compliment,

Re: Dynamic replacement of the variable

2011-04-19 Thread shawn wilson
> > and i will still reply with strong (but not rude) words about very bad > code here. newbies need to learn to not touch the stove before they get > burned. nothing is worse than a newbie who learns symrefs and string > eval and starts to use them for everything. i have seen that before and > it

Re: Dynamic replacement of the variable

2011-04-19 Thread Uri Guttman
> "JK" == Jenda Krynicky writes: JK> Let me quote again Uri's response: >> NEVER do that for such a simple problem. eval string is a last resort >> when no other technique can work well. i used one upper case word for emphasis, not rudeness. if you call that rude, you are way too sen

Re: Dynamic replacement of the variable

2011-04-19 Thread Jenda Krynicky
From: Rob Dixon > On 19/04/2011 12:56, Jenda Krynicky wrote: > >>> > >>>SF> Well, you are right naturally, but there is no need to be so > >>>SF> rude. Start your email with a greeting, continue with a > >>>SF> compliment, use soft words, etc. Otherwise, you may be scaring > >>>

Re: Dynamic replacement of the variable

2011-04-19 Thread Rob Dixon
On 19/04/2011 15:27, shawn wilson wrote: On Tue, Apr 19, 2011 at 9:22 AM, Rob Dixon wrote: On 19/04/2011 12:56, Jenda Krynicky wrote: Try Alcoholics Anonymous. This is not a post-traumatic mutual support group, this is a technical mailing list! If you can't handle a terse and to the point rep

Re: Dynamic replacement of the variable

2011-04-19 Thread Alan Haggai Alavi
Hello friends in the list, I did not want to reply, however, I have now been forced to reply. On 04/19/2011 05:26 PM, Jenda Krynicky wrote: Try Alcoholics Anonymous. This is not a post-traumatic mutual support group, this is a technical mailing list! If you can't handle a terse and to the point

Re: Dynamic replacement of the variable

2011-04-19 Thread shawn wilson
On Tue, Apr 19, 2011 at 9:22 AM, Rob Dixon wrote: > On 19/04/2011 12:56, Jenda Krynicky wrote:   SF>  Well, you are right naturally, but there is no need to be so   SF>  rude. Start your email with a greeting, continue with a   SF>  compliment, use soft words, etc.  Otherwise,

Re: Dynamic replacement of the variable

2011-04-19 Thread Rob Dixon
On 19/04/2011 12:56, Jenda Krynicky wrote: SF> Well, you are right naturally, but there is no need to be so SF> rude. Start your email with a greeting, continue with a SF> compliment, use soft words, etc. Otherwise, you may be scaring SF> many people away. See some of my advice

Re: Dynamic replacement of the variable

2011-04-19 Thread Jenda Krynicky
From: Shlomi Fish > On Monday 18 Apr 2011 08:50:43 Uri Guttman wrote: > > > "SF" == Shlomi Fish writes: > > SF> Hi Uri, > > SF> thanks for all your input on this list. See below for my response. > > > > SF> On Monday 18 Apr 2011 07:56:16 Uri Guttman wrote: > > >> > "mr" == marcos

Re: Dynamic replacement of the variable

2011-04-18 Thread Shlomi Fish
Hi Chap, thanks for supporting me. Regards, Shlomi Fish On Monday 18 Apr 2011 20:55:49 Chap Harrison wrote: > On Apr 18, 2011, at 7:07 AM, Shlomi Fish wrote: > > You could have said that it is not a good thing, while being polite and > > much less hostile and angry. As it is, you are s

Re: Dynamic replacement of the variable

2011-04-18 Thread Chap Harrison
On Apr 18, 2011, at 7:07 AM, Shlomi Fish wrote: > You could have said that it is not a good thing, while being polite and much > less hostile and angry. As it is, you are scaring many people from this list. You're right. I find it staggering that, on a list contributed to by so many intelligent

Re: Dynamic replacement of the variable

2011-04-18 Thread Shlomi Fish
Hi Uri, On Monday 18 Apr 2011 08:50:43 Uri Guttman wrote: > > "SF" == Shlomi Fish writes: > SF> Hi Uri, > SF> thanks for all your input on this list. See below for my response. > > SF> On Monday 18 Apr 2011 07:56:16 Uri Guttman wrote: > >> > "mr" == marcos rebelo writes: > mr>

Re: Dynamic replacement of the variable

2011-04-18 Thread shawn wilson
On Apr 18, 2011 1:51 AM, "Uri Guttman" wrote: > > > "SF" == Shlomi Fish writes: > > >> NEVER do that for such a simple problem. eval string is a last resort > >> when no other technique can work well. > > SF> Well, you are right naturally, but there is no need to be so > SF> rude. Start y

Re: Dynamic replacement of the variable

2011-04-17 Thread Uri Guttman
> "SF" == Shlomi Fish writes: SF> Hi Uri, SF> thanks for all your input on this list. See below for my response. SF> On Monday 18 Apr 2011 07:56:16 Uri Guttman wrote: >> > "mr" == marcos rebelo writes: mr> Ugly but may work, with a simple eval mr> use strict; mr> use warni

Re: Dynamic replacement of the variable

2011-04-17 Thread Shlomi Fish
Hi Uri, thanks for all your input on this list. See below for my response. On Monday 18 Apr 2011 07:56:16 Uri Guttman wrote: > > "mr" == marcos rebelo writes: > mr> Ugly but may work, with a simple eval > mr> use strict; > mr> use warnings; > > mr> my $var = '$str. q( abc_xyz)'; >

Re: Dynamic replacement of the variable

2011-04-17 Thread Uri Guttman
> "mr" == marcos rebelo writes: mr> Ugly but may work, with a simple eval mr> use strict; mr> use warnings; mr> my $var = '$str. q( abc_xyz)'; mr> my $str; mr> for(my $i=1;$i <= 5; $i++){ mr>$str = $i; mr>my $line = 'Line: '.eval $var; mr>print "$line\n"; mr>

Re: Dynamic replacement of the variable

2011-04-17 Thread marcos rebelo
Ugly but may work, with a simple eval use strict; use warnings; my $var = '$str. q( abc_xyz)'; my $str; for(my $i=1;$i <= 5; $i++){ $str = $i; my $line = 'Line: '.eval $var; print "$line\n"; } Best Regards Marcos On Sun, Apr 17, 2011 at 20:23, Shlomi Fish wrote: > Hi Parag, > > On Su

Re: Dynamic replacement of the variable

2011-04-17 Thread Uri Guttman
> "RD" == Rob Dixon writes: RD> use strict; RD> use warnings; RD> my $str; RD> sub var { "$str abc_xyz" } RD> for my $i (1 .. 5) { RD> $str = $i; RD> my $line = 'Line: ' . var; RD> print "$line\n"; RD> } using a global to get around symrefs is not a win. a template

Re: Dynamic replacement of the variable

2011-04-17 Thread Rob Dixon
On 17/04/2011 19:07, Parag Kalra wrote: Hi, I am not sure if this can be done. But just asking it out of curiosity. I have written this snippet. use strict; use warnings; my $var = '$str abc_xyz'; my $str; for(my $i=1;$i<= 5; $i++){ $str = $i; my $line = 'Line: '.$var; print "$

Re: Dynamic replacement of the variable

2011-04-17 Thread Shlomi Fish
Hi Parag, On Sunday 17 Apr 2011 21:07:27 Parag Kalra wrote: > Hi, > > I am not sure if this can be done. But just asking it out of curiosity. I > have written this snippet. > > use strict; > use warnings; > > my $var = '$str abc_xyz'; > my $str; > > for(my $i=1;$i <= 5; $i++){ > $str = $i;