Help for this page

Select Code to Download


  1. or download this
    my $value = "four"; # lexical variable
    my @array = ( "one", "two", "three" );
    ...
        # with its initial value
        print "function value: $value\n";
    }
    
  2. or download this
    $value = "four";
    my @array = ( "one", "two", "three" );
    ...
    foreach value: one      function value: one
    foreach value: two      function value: two
    foreach value: three    function value: three
    
  3. or download this
    my $value = "four";
    my @array = ( "one", "two", "three" );
    ...
    foreach value: one      function value: four
    foreach value: two      function value: four
    foreach value: three    function value: four
    
  4. or download this
    my $value = "four";
    my @array = ( "one", "two", "three" );
    ...
    foreach value: one      function value: 
    foreach value: two      function value: 
    foreach value: three    function value: