Posted By

symsec on 10/20/12


Tagged

link recursive loop perl symbolic symlink


Versions (?)

Perl recursive loop symbolic link final destination using Unix readlink command


 / Published in: Perl
 

Snippet obtained from Stackoverflow courtesy of Loki Astari

  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4.  
  5. while(chomp(my $file = <>))
  6. {
  7. while(-l $file)
  8. {
  9. $file = readlink $file;
  10. }
  11. print "$file\n";
  12. }

Report this snippet  

You need to login to post a comment.