in reply to Subtracting two arrays

G'day HaveANiceDay,

Welcome to the Monastery.

It's good that you've used strict and warnings; however, from the code you've posted, I suspect you've missed an important, underlying issue. You probably got a message like:

Global symbol "@Molecule_01" requires explicit package name (did you f +orget to declare "my @Molecule_01"?)

which you fixed (or, at least, thought you'd fixed) by adding

my @Molecule_01 = ();

The fact that you didn't get an equivalent message about "@Molecule_02", should have been a hint to the underlying problem, which is related to how you've used qw. The starting delimiter you used was an open (left-hand) parenthesis; this means that everything up to a right-hand parenthesis are the qw operands. In other words, you've actually created a list like this:

@Molecule_01 = ( '[C', '0.2565522', ... ';', '@Molecule_02', '=', 'qw(', ... 'my', +'@Delta', '=', '(' );

See "perlop: Quote and Quote-like Operators" for general information about this quoting mechanism, and "perlop: Quote-Like Operators" for more specific information about qw.

You then have an additional problem in that you should have been creating individual lists for each arrayref:

my @Molecule_01 = ( [qw{C 0.2565522 -1.5308230 0.0000000}], [qw{C -0.8038556 -0.7047550 0.0000000}], ... ); my @Molecule_02 = ( [qw{C 0.3916152 -1.5774692 0.0000000}], ... );
"I am able to print to screen ..."

As first posts go, this is pretty good; however, the code you posted would not have produced the output you claim. Do not do this! Show us the real output you got and ask questions about what you don't understand or don't know how to fix. Just from inspection, I can see two instances that would have aborted compilation and another that would have generated a warning. All this, and more, is explained in "How do I post a question effectively?".

"... trying to read as much as I can ... experience with perl ... absolutely zero ..."

Bookmark the online perl manpage: read perlintro in the Overview section; refer to the Tutorials section as needed - this also contains a series of FAQs; familiarise yourself with what's available in the Reference section; the other sections are typically too advanced for, or tangential to the needs of, the Perl beginner.

Here's some additional information on the code you posted:

use diagnostics;
The diagnostics pragma is a developer tool. Remove it from production code. You can always look up the same information in the perldiag manpage.
open(FILE, "$inputname_01") ...
Use lexical filehandles and the 3-argument form of open.
... or die "Could not open file  '$inputname_01' $!" ...
Hand-crafting these messages is tedious and error-prone. Consider using the autodie pragma instead.
... #directs the user to enter the file name to be used
That's not what's happening here. Ensure comments are accurate. Update them every time you change the code to which they refer.
close;
Without an argument, closes the currently selected filehandle. By default, this is STDOUT; as you haven't selected a different filehandle, it's still STDOUT. Closing STDOUT is rarely what you want: it certainly isn't here. See close and select.

— Ken