shan_emails has asked for the wisdom of the Perl Monks concerning the following question:
my $KPI0=10; my $KPI1=20; my $KPI2=30; my $KPI3=40; my $KPI4=50; for($i=0;$i<5;$i++){ my $var="$KPI$i"; print "line"."$var"."\n"; } my expected output is line10 line20 line30 line40 line50
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how can print the variable values
by Corion (Patriarch) on Dec 01, 2008 at 11:29 UTC | |
|
Re: how can print the variable values
by ccn (Vicar) on Dec 01, 2008 at 11:28 UTC | |
|
Re: how can print the variable values
by oko1 (Deacon) on Dec 01, 2008 at 13:32 UTC | |
|
Re: how can print the variable values
by JavaFan (Canon) on Dec 01, 2008 at 13:02 UTC | |
|
Re: how can print the variable values
by linuxer (Curate) on Dec 01, 2008 at 12:41 UTC | |
|
Re: how can print the variable values
by dharanivasan (Scribe) on Dec 01, 2008 at 13:26 UTC |