Phoenix.pm: Code problem

Giffin Ron-P08295 Ron.Giffin at motorola.com
Tue Oct 12 19:59:04 CDT 1999


Hi,

I am going to respond to my own post as a method of summarizing
the replays that I got.

1.  Field 1 vs. field 2.  Didn't fix the problem.  Sun, HP and
    Linux can vary the fields slightly.  (So much for standard UNIX)

2.  Autoflush didn't work.  Don't know enough about it to comment.

3.  $size = 0 + `wc -w $output_file`  Same problem, $size still 0.

4.  Using pipes within grave quotes.  Have code that does that well.

Bottom line is when wc is run, filesize appears to really be 0.  I've
tried this in ksh, csh and sh, (Perl's exec shell), but within Perl,
nope!  I am going to give up on the idea of looking at each row in UNIX
and simply use Perl.  Thanx for all the replays and I liked the comment
about not getting this much attention as a kid!

  -- Ron



Ok...  My fear of being a dummy is overpowered by my need to
finish this script.  $in_file contains 44 word columns separated
by tabs.

    open ( IN_FILE, $in_file ) || die ........
    open ( OUT_FILE, "> $out_file" ) || die .......
    while ( <IN_FILE> )
        {
        print OUT_FILE $_ ;
        $size = `wc -w $out_file | tr -s " " | cut -f1 -d " "` ;
        print "Unix word count = $size\n" ;
        }
    close ....
    close ....

$size is always 0 ---- What's wrong with this ( bet I going to be
embarrassed )


  -- Ron




More information about the Phoenix-pm mailing list