develooper Front page | perl.perl5.porters | Postings from August 2008

Re: [PATCH] Add open "|-" and open "-|" to perlopentut

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
August 26, 2008 12:10
Subject:
Re: [PATCH] Add open "|-" and open "-|" to perlopentut
Message ID:
20080826191034.GP32015@klangraum.plasmasturm.org
* Tom Christiansen <tchrist@perl.com> [2008-08-26 20:30]:
> I have myself no acquaintance with any culture where /^/ means
> /^/m.

Virtually every Unix utility processes input linewise, which
makes `/^/` vs `/^/m` a distinction without a difference. It is
debatable whether that makes `/^/` or `/^/m` the behaviour that
a shell programmer might more likely expect when strings can
contain embedded newlines; Damian argues that `/^/m` is more
likely to reflect the extant expectation is correct. I think
he is correct.

However, I do not follow his argument that this means a Perl
programmer should use `/m` on every pattern. Neither do I follow
your argument that the because C and shell programmers expect
`\t` to mean a literal tab regardless of how the string (or
character) literal is quoted, one should therefore always use
double quotes to meet that expectation. Perl is not C, neither
shell, nor sed, nor awk. Perl is Perl and should be treated as
Perl.

> /./s means /\p{Any}/ (which is what I more often use now,
> lamentably unHoffmaning the commonest thing from a wee 1 to a
> super 7, even 8 chars)

As an aside, 6 will do: `(?s:.)`.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About