Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. robpbyw

    Managing arrays

    Success !! Big thanx to MillerH and audiopro Did calcs before the print command & got the syntax right at last. robpbyw
  2. robpbyw

    Managing arrays

    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...
  3. robpbyw

    Managing arrays

    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...
  4. robpbyw

    Managing arrays

    >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...
  5. robpbyw

    Managing arrays

    OK. I've removed the comma, and now split as you advise above. But I get the same error messages as before.
  6. robpbyw

    Managing arrays

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

    Managing arrays

    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...
  8. robpbyw

    Managing arrays

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

Part and Inventory Search

Back
Top