Help for this page

Select Code to Download


  1. or download this
    sub get_path_separator {
        for ($^O) {    # stores the OS in $_ to simplify the regex syntax
    ...
            return '/';
        }
    }
    
  2. or download this
    $_ = $^O;
    my $separator =  /mac/i ? ':'  :
                     /cyg/i ? '/'  :
                     /win/i ? '\\' :
                     '/';