Getting close now.
But I'm sorry to be a pain.
This print line ( "$record->[0]" is a text string to be printed as it was read in, hence the " " ) >>>>
print "$record->[0]" . ($record->[1]*$convfact) ($record->[2]*$convfact) ($record->[3]*$convfact) . "\n";
still doesn't do the sums, I...
That looks much better. Thanks once again for your help.
I still need to do the multiplication ( on $record->[i], i= 1,2,3) )
so I tried this
print "$record->[0] ($record->[1])*($convfact) ($record->[2])*($convfact) ($record->[3])*($convfact)\n";
and got this, i.e. perl is not doing the...
>Share all your code and we can help you with it.
Thanks.
> Please enclose your code in tags.
Not sure what that means. The entire script is very short (37 lines) so I just reproduce it here. Following that, a truncated input file.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Code...
Thanx for prompt response.
I tried this
print ($column[0]),($column[1]),($column[2]),($column[3]);
and got these error messages:
$ perl convau2ang.pl
print (...) interpreted as function at convau2ang.pl line 29.
print (...) interpreted as function at convau2ang.pl line 32.
Global symbol...
Thanks guys.
Good advice.
To be honest, I am not sure why I am splitting on the commas, because there are no commas in the input file ! But if I don't do that split (", "), the output is spewed out with the four items on each line concatenated into a single string (I'm aware that I can remedy...
Hi folks
I am a noob at Perl, but I want to write a script that will convert x,y,z cartesian coordinates from atomic units to angstroms, the conversion factor is %convfact in the script (see below). First, here is one line of the array holding the coordinates. I want to return the line as it is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.