Per,

> >> There are no spaces in the string, it's an email address.

An email address can legitimately contain a space, see RFC 2822,
e.g.
  "some x user"@example.com
 
> >> I did try using $1 on the right side of the s///, but it didn't work.

Most weird. Which version of perl?

Try this:

$ perl -le '@a...@argv; s/^\s*(.*?)\s*$/$1/ for @a; print "/$_/" for @a' \
"x " " y" " z z "

should produce:
/x/
/y/
/z z/


> Well, as the \1 variation worked apart from the warning, I didn't bother
> with going any further.  I have a feeling the $1 might be getting
> substituted first?  so maybe I should escape it?  Anyway, thanks for
> your suggestion, it's much better.

No escaping, the $1 should work as show.

  Mark

Reply via email to