On Jul 28, 2014, at 3:59 PM, ESChamp <esch...@gmail.com> wrote:

> Suddenly, without warning or error messages, the script below is
> producing null for values of $hfile and $bfile!

What are $hfile and $bfile? You don’t show them in your script. You show two 
arrays: @hfile and @bfile, but those are not the same as the scalar variables 
$hfile and $bfile.

When asking other people for help, it is best to reduce your program down to 
the shortest version that illustrates your problem. People can help you fix 
that, and you can then apply the fix to your actual program.

In this case, it is impossible to help you with the above stated problem, 
because the variable about which you are complaining do not exist in your 
program.

If you actually mean @hfile and @bfile, you say that $copy is correct. Are the 
contents of the file named by $copy also correct?

> The script begins:
> 
> #!/usr/bin/perl
> 
> use Tie::File;
> use File::Copy 'copy';
> use File::Spec;
> 
> 
> and further down, it has:
> 
> # Tie it to an array
> #
> (my $copy = $htmfile) =~ s/(\.htm)\z/-Copy$1/i;
> copy $htmfile, $copy;
> tie my @hfile, 'Tie::File', $copy;
> tie my @bfile, 'Tie::File', $recapfile;
> 
> ## hfile is the array of the lines of htmfile
> #
>    print "$copy \n";
>    print "hfile: 1--$hfile-- \n";
> 
> $copy's value is correct.
> 
> I'm on a Windows 7 machine. Should I have the Windows full pathname for
> perl.exe at the top????

No, because if you are getting any output at all from your Perl program, then 
the program has been found and executed by the operating system.

> Happy to send the entire script to anyone who would like to see it.

Produce a shorter version of the script that demonstrates the problem and post 
it here for all to see.


--
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