NAME

File::LsColor - Colorize input filenames just like ls does

SYNOPSIS

use File::LsColor qw(ls_color);

for my $file(glob("$ENV{HOME}/*")) {
  print ls_color($file);
}

DESCRIPTION

This module provides functionality for using the LS_COLORS variable for colorizing output in a way that's immediately recognized.

Say that you have a list of filenames that's the result of some complex operation, and you wish to present the result to the user.

If said files have an extension and that extension is present in the users LS_COLORS variable, they will be colored just like they would have been if the filenames were output from ls(1) or tree(1).

EXPORTS

None by default.

FUNCTIONS

ls_color()

Arguments: @files | \@files

Returns: @files

AUTHOR

Magnus Woldrich
CPAN ID: WOLDRICH
magnus@trapd00r.se
http://japh.se

REPORTING BUGS

Report bugs on rt.cpan.org or to magnus@trapd00r.se

CONTRIBUTORS

None required yet.

COPYRIGHT

Copyright 2011 THIS MODULEs "AUTHOR" and "CONTRIBUTORS" as listed above.

LICENSE

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.