Help for this page

Select Code to Download


  1. or download this
    my @one = ('$apple', '$pear');
    my $two = '$orange';
    eval "$one[0] = 'hello'";  # evaluates  $apple = 'hello'
    eval "$two = 'goodbye'";   # evaluates  $orange = 'goodbye'
    print "$apple $orange";    # hello goodbye
    
  2. or download this
    use strict;
    use warnings;
    ...
        ${substr $two,1}    = 'goodbye';  # ${'orange'} = 'goodbye';
    }
    print "$apple $orange";   # hello goodbye