Deb wrote:
> Rob,
>
>    Errr, I think I see this.  Seems more elegant than a strict
> search/replace.  But, I don't understand this:
>
> next unless $line =~ s/^units\s+=\s+//;
>
> Substituting the left side with nothing?  I must be reading this
> wrong.
>
> I do understand the split and join, though - I've used split
> a lot, but not join.  I appreciate you giving an example.

Sure. Look

  my $line = 'units =               [EMAIL PROTECTED] [EMAIL PROTECTED]:[EMAIL 
PROTECTED]';
  $line =~ s/^units\s+=\s+//;

  print "[$line]\n";

OUTPUT

  [EMAIL PROTECTED] [EMAIL PROTECTED]:[EMAIL PROTECTED]

(the square brackets are there only to show that there's no leading
or trailing whitespace).

This line

  next unless $line =~ s/^units\s+=\s+//;

says

  - Checking whether the line matches /^units\s+=\s+/
  - If so, then remove the matched text and continue
  - Otherwise go fetch the next line

HTH,

Rob






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to