in reply to Re^2: Info based on total changes
in thread Info based on total changes

  1. I missed the significance of the $fac value. my bad!
  2. You told us you "start with" the $fac values. Now you show that's not the case. Your bad!
  3. Since you are calculating that, you have all the data points needed to solve your alignment problem.
  4. chop does NOT do what you appear to think it does. See the docs for chop and chomp, the latter of which more reliably removes a trailing newline (as opposed to discards the final entity on a line).
  5. The regex matches in your initial test, above, if ($_ =~/(.*)/) {...}? matches anything or nothing (ie, is useless or 'ALWAYS true-for-any-non-blank-line'): the dot means any character (alpha, digit, punct, or whitespace (except \n and the * quantifier means "none" or "any-quant-more-than-none" (see perlre).
  6. Var names such as $f, $s may be 'meaningful' to you, today... but they're apt to give grief, agitta and annoyance to some future you - or to the homicidal maniac who knows where you live and who may have to take over maintenance someday. Name vars with names or obvious and unambiguous abbreviations. They'll save you g,a and a.

So, bottom line, I'm not giving you the code to solve your alignment problem; you'll learn more by solving that yourself, with the info you now have in hand, than by getting an algorithm spelled out or by copying code. But before you tackle that one, read the cited regex doc, and probably the tuts here. (Yes, they're directly relevant to one approach.)

Replies are listed 'Best First'.
Re^4: Info based on total changes
by pqocpiha (Initiate) on Jun 21, 2012 at 17:23 UTC
    I'm very willing to read the tuts, but the link you provided matches nothing. Thanks just the same!
      The FIRST TWO links I provided in Re^3: Info based on total changes -- a link to perldoc.perl.org's chomp documentation and a link to the an introductory doc (also available on your own machine, assuming you have Perl installed by using, at the CLI: perldoc perlre) regarding regular expressions -- work just fine.
      The third was broken... so try this: go to Tutorials and select the subsection on Pattern-Matching-Regular-Expressions-and-Parsing.