Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] Test a $1 value that came from a regex; true, false?

Expand Messages
  • daymobrew@yahoo.com
    ... the $1 entirely, also, trimmed at 9 instead of 0 with substr(). ... Minor picky point: For clarity I suggest you add a comment to explain what 9 and 44
    Message 1 of 25 , Jul 19, 2004
      --- In perl-beginner@yahoogroups.com, Alan <acelists@c...> wrote:
      > That's been working, even with that one weird header. I got rid of
      the $1 entirely, also, trimmed at 9 instead of 0 with substr().
      >
      > --
      > Alan.

      > $subj = substr($subj, 9, 44);

      Minor picky point:
      For clarity I suggest you add a comment to explain what 9 and 44 mean.
      9 I presumet is length( 'Subject: ' ).
      You could change the line to:
      $subj = substr($subj, length( 'Subject: ' ), 44);
      and this would mean that the comment for 9 would be unnecessary.
      I don't know what 44 is for and when you revisit the script in a few
      weeks/months/years you or the future maintainer may not remember.

      Damien.
    Your message has been successfully submitted and would be delivered to recipients shortly.