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

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

Thread Previous | Thread Next
Aristotle Pagaltzis
August 26, 2008 12:10
Re: [PATCH] Add open "|-" and open "-|" to perlopentut
Message ID:
* Tom Christiansen <> [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

> /./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:.)`.

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About