Help for this page

Select Code to Download


  1. or download this
    my @array = (1,2,3,4,5);
    
  2. or download this
    $_ *= 2 for 1,2,3,4,5; # doesn't work because you're modifying constan
    +ts.
    
    @a = (1,2,3,4,5);
    $_ *= 2 for @a; # modifies @a because @a has copies of the constants i
    +nstead of the constants themselves