Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: define variable name on the way

by amon (Scribe)
on Apr 27, 2014 at 18:10 UTC ( [id://1084015]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $index = 0;
    my @array;
    $array[0] = "hello";
    $array[1] = "world";
    print "$names[0] $names[1]"; #=> "hello world"
    
  2. or download this
    my $index = 0;
    my %hash;
    $hash{greeting} = "hello";
    $hash{name} = "world";
    print "$hash{greeting} $hash{name}"; #=> "hello world"
    
  3. or download this
    my $key = "greeting";
    $hash{$key} = "hello";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1084015]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-07-13 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.