#!/usr/bin/perl -w

use strict;

while (<>) # lines from stdout or files listed on command line
{               # are read one at a time and put into $_

      /\|/ and print            # print lines with '|' in them

    or                       # only executed if previous expression
false

      /^\s*$/             # ignore blank lines

    or                       # only executed if previous expression
false

      s/\W//g,          # ensure valid filename

      open STDOUT,                                 # point subsequent
prints
        ">$_.txt" or die "can't open: $!";    # to file with name from
input
}



Reply via email to