![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple variable in a variable in Perl | Raynon | Shell Programming and Scripting | 3 | 05-04-2009 11:10 PM |
| Pass csh variable to Perl | Raynon | Shell Programming and Scripting | 9 | 10-19-2007 10:46 PM |
| perl not reading my variable | yoonixq4u | Shell Programming and Scripting | 3 | 08-24-2007 10:24 PM |
| PERL: how to tell if variable is NULL | dangral | Shell Programming and Scripting | 4 | 03-19-2003 01:34 PM |
| perl variable assingment | seismic_willy | Shell Programming and Scripting | 2 | 01-29-2002 04:54 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
perl get variable value ???
hi i have following code
Code:
my $a1 = "A" ;
my $a2 = "B" ;
my $a3 = "C" ;
foreach my $k ( 1,2,3 )
{
my $msg = ${a{$k}} # this should be at runtime i am creating variable a1 and assigning it value to msg .
print "$msg\n" ;
}
i want when k = 1 msg = "A" how can i do that ?? -----Post Update----- i got it working i created array instead of 3 variables .. but still if you can tell me how can do it without array just for curiosity ... Last edited by zedex; 05-27-2009 at 07:41 AM.. Reason: removed extra update ... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|