Per Jessen wrote:
> I have a bit of SA code where I strip leading and trailing whitespace -
>
> foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
>
> Whenever I run this I get the warning "\1 better written as $1" which I
> understand to be perl telling me that the right side of s/// should use
> $digi
Mark Martinec wrote:
> 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
Yeah I know, but I'm quietly ignoring that possibility. I haven't seen
one the last four-five
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
Karsten Bräckelmann wrote:
> On Thu, 2010-06-10 at 12:08 +0200, Per Jessen wrote:
>> > > I have a bit of SA code where I strip leading and trailing
>> > > whitespace
>> > >
>> > > foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
>> > >
>> > > Whenever I run this I get the warning "\1 better writte
On Thu, 2010-06-10 at 12:08 +0200, Per Jessen wrote:
> > > I have a bit of SA code where I strip leading and trailing whitespace
> > >
> > > foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
> > >
> > > Whenever I run this I get the warning "\1 better written as $1" which
> > > I understand to be pe
Mark Martinec wrote:
> Per,
>
>> I have a bit of SA code where I strip leading and trailing whitespace
>> -
>> foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
>> Whenever I run this I get the warning "\1 better written as $1" which
>> I understand to be perl telling me that the right side of s///
Per,
> I have a bit of SA code where I strip leading and trailing whitespace -
> foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
> Whenever I run this I get the warning "\1 better written as $1" which I
> understand to be perl telling me that the right side of s/// should use
> $digit, not \digit.
On 06/10/2010 08:36 AM, Per Jessen wrote:
I have a bit of SA code where I strip leading and trailing whitespace -
foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
Whenever I run this I get the warning "\1 better written as $1" which I
understand to be perl telling me that the right side of s/// sho
I have a bit of SA code where I strip leading and trailing whitespace -
foreach (@addrs) { s/^\s*([^\s]+)\s*$/\1/; }
Whenever I run this I get the warning "\1 better written as $1" which I
understand to be perl telling me that the right side of s/// should use
$digit, not \digit. I tried changi