Help for this page

Select Code to Download


  1. or download this
    my ($dir, $file);
    while( readdir DIR ){
    ...
    $cwd .= "/" . ($dir || $file || '.');
    $cwd =~ s#/#\\#g;
    warn $cwd;
    
  2. or download this
    my @listing = sort { -d $b <=> -d $a || $a cmp $b } grep { ! /^\.\.?$/
    + } readdir DIR;
    $cwd .= "/" . ($listing[0] || '.');
    $cwd =~ s#/#\\#g;