The program begins

#!/usr/bin/perl

use Tie::File;
use File::Copy 'copy';
use File::Spec;

my $copy="000000-copy.htm";
my $recapfile="000000recap.txt";
my $htmfile="000000.htm";
my $ct;

tie my @bfile, 'Tie::File', $recapfile or die "cannot tie recapfile and
bfile $!";
tie my @hfile, 'Tie::File', $copy or die "cannot tie copy and hfile $!";

## hfile is the array of the lines of htmfile
#
    print "$copy \n";
    print "hfile: --$hfile-- \n";
    print "bfile: --$bfile-- \n";
    for ($ct = 0; $ct < $#hfile; $ct++)    {
       print "$hfile[$ct] \n";
   }

The output looks like this

000000-copy.htm
hfile: ----
bfile: ----

I thought that $recapfile would be "tied" to @bfile and $copy to @hfile.
That is, that each line of $recapfile would become an element of the
bfile array, etc.

What have I done wrong?

Thanks,
The Perpetual Beginner

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to