Skip to main content.
home | support | download

Back to List Archive

Re: Home-made FileFilter problem

From: Alan Ivey <ai4891(at)>
Date: Tue Aug 10 2004 - 14:08:03 GMT
> Can you run it like:
>    ./ 1996-032.txt

I altered it so that it would just now and it works on
the command line. It generates the output that I need.
Here's the script (I know it's ridiculous but it does
exactly what I need it to do)...

#!/usr/bin/perl -w
open INPUT,$ARGV[0];

while($Author eq "") {
  $line = <INPUT>;
  if($line=~m/[A-Z,a-z]/) {
    chomp $Author;

while($Title eq "") {
  $line = <INPUT>;
  if($line=~m/[A-Z,a-z]/) {
    if($line=~/^RELEASE: / || $line=~/^EDITORS NOTE:
/) {
      while($Title eq "") {
        $line = <INPUT>;
        if($line=~m/[A-Z,a-z]/) {
          $Title = $line;
          chomp $Title;
          $line = <INPUT>;
          if($line=~m/[A-Z,a-z]/) {
            $Title .= $line;
            chomp $Title;

while($i<=@tempBody) {
  $Body .= $tempBody[$i];

close INPUT;

# Print the results in HTML
print <<EOF;

<META NAME="Author" CONTENT="$Author">


When I run...
$ perl 98-054.txt
I get the HTML that I want. When I plug it in SWISH-E.
I get...
Use of uninitialized value in pattern match (m//) at
/home/alan/ftpdownload/ line 38,
<INPUT> line 39.
.. which means that my script isn't getting anything
from INPUT. I've changed $ARGV[0] to $1 and $2 as
stated in the docs
but I get the same kind of error.

I don't think would work because it uses
the SWISH::Filter, and this is only for 2 specified
folders containing txt files, not every txt file.

As always, thanks!

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
Received on Tue Aug 10 07:08:34 2004