#!/usr/bin/perl -w use strict; use constant NL => qq[\012]; $| = 1; use CGI::Carp qw(fatalsToBrowser); print('Content-Type: text/html' . NL x 2); print ${ &getINCarray() } and exit; sub getINCarray { my $inc = '
@INC contains:' . NL; foreach (@INC) { $inc .= "
$_:" . NL; opendir(DIR, $_) or die ("error loading dir $_ $!" . NL); foreach (grep /.pm|.pod/i, readdir DIR) { $inc .= '
' . $_ . NL; } closedir(DIR); $inc .= '
' . NL; } $inc .= '
' . NL; return \$inc; }