ASIC/FPGA Design and Verification Out Source Services
Simple perl script to filter input from STDIN
- A simple script in perl to filter some characters. This is usually required in WEB based CGI scripts.
- The script is executed by:echo "try--- my filter" | perl /home/pini/bin/filter_inp.pl
- The script is simple and is shown below:
#!/bin/perl
$ok_chars = 'a-zA-Z0-9_';
while (<STDIN>) {
$_ =~ s/[^$ok_chars ]//go;
print "$_\n";
}#while
Contact me now at: |