my $string = $q->param( 'string' ); unless ( $string ) { error( $q, "Please enter some text." ) }; unless ( $string =~ /^[\w .!?-]+$/ ) { error( $q, "Invalid character entered." ); } local *PIPE; # This code is more secure, but still dangerous... # Do NOT use this code on a live web server!! open PIPE, "/usr/local/bin/figlet '$string' |" or die "Cannot open figlet: $!"; print $q->header( "text/plain" ); print while ; close PIPE; #### my $pid = open PIPE, "-|"; die "Cannot fork $!" unless defined $pid; unless ( $pid ) { exec FIGLET, $string or die "Cannot open pipe to figlet: $!"; }