#!/usr/bin/perl -w
#
# $Revision: 1.2 $ $Date: 2009/07/27 22:12:15 $
# $UUID: 6fdcbcdc-c224-378d-86d3-77b03cd8ad97 $
#
#<rl: reads symlinks, shows where they point.

use strict;

if (@ARGV) { show($_) foreach (@ARGV); }
else       { show($_) while (<>); }
exit(0);

sub show {
    chomp(my $file = shift);
    if (-l $file) { print "$file: ", readlink($file), "\n"; }
    else          { print "$file: NOT a symlink\n"; }
}
