Help for this page

Select Code to Download


  1. or download this
    my $myname = myname();
    # or
    print myname(), "\n";
    
  2. or download this
    sub myname {
        my $name = "bill";
    }
    
  3. or download this
    my $myname = myname();
    print "my name is $myname\n";
    ...
        my $name = "bill";  # notice subtle change in variable name
        return $name;       # not necessary, $myname works too
    }                           # but it is not the same $myname ;)