#!/usr/local/bin/perl5 -w
#  Simple glob wildcarding Example
#
require "cgi-lib.pl"; # Public Domain library to read form data
#
$statusofread =  &ReadParse(*formdata); # read data in associate array formdata
#
if( $statusofread )     { # If $statusofread nonzero, data read OK
        $pattern = $formdata{"pattern"}; # The input pattern
}
#
$today =`date`;
chomp($today); # Today's date captured from UNIX
#
print <<EOF; # Generate the HTML responding page starting with HTTP line
Content-Type: text/html

<html>
<head>
<title>This is Result of my simple glob CGI Script </title>
</head>
<body bgcolor="white" >
<h1>This Script globs pattern $pattern on a great $today</h1>
<font color=red size=7 > 
EOF
#
@files = glob $pattern; # glob call
#
print <<EOF; # Generate End of HTML Page
@files
</font>
</body>
</html>
EOF
exit; # End Program
#
