Help for this page

Select Code to Download


  1. or download this
    my $my_path = $0;
    
    foreach my $path (split(/:/, $ENV{PATH}))
    {
         $my_path = "$path/$0" if (-f "$path/$0");
    }
    
  2. or download this
    my ($called_name) = $0 =~ m#/([^/]+)$#;
    
    {
    ...
    {
         # If program is called as "moo"
    }