#!/usr/bin/perl -l my $word = shift; open my $in, '<', shift or die $!; open my $out, '<', shift or die $!; while (<$in>) { print $out $_ if $_ eq $word; } close $in; close $out;
Howdy, Uncle Bob! Nice error checking!
In reply to Re^2: Search for a string in a file
by bv
in thread Search for a string in a file
by Millan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |