in reply to strmode in Perl (convert octal permissions to symbolic)

Your code won't display symbolic links properly because you are using stat instead of lstat.

Just change:

next unless -e $file; my ( $mode, $nlink, $uid, $gid, $size, $mtime ) = ( stat(_) )[ 2 .. 5, 7, 9 ];

To:

my ( $mode, $nlink, $uid, $gid, $size, $mtime ) = ( lstat $file )[ 2 .. 5, 7, 9 ] or next;

Replies are listed 'Best First'.
Re^2: strmode in Perl (convert octal permissions to symbolic)
by afresh1 (Hermit) on Mar 28, 2011 at 02:40 UTC

    Thanks, fixed.

    l8rZ,
    --
    andrew