|
Assignment
Your assignment, should you choose to accept it, is to complete a Perl script that
reads through the following output, finds the CM2 gas-phase dipole moment (.616), and
print it out. You can copy and paste the following output into a text file:
Details
Your script should be robust enough that it will work with any similar output.
Your script might look something like:
Tips
- @ARGV is the list of arguments passed to the script.
- while (<FILE>) will process FILE one line at a time until the end of file.
- $_ is the special variable that holds the current topic (current line in this case).
- The special variables $1, $2, $3 hold the matching sub-pattern from the most
recent pattern match.
- In a regular expression, \s will match whitespace and \S will match non-whitespace.
Placing a '+' after an item will match 1 or more of that item.
A solution
|