On Thu, Apr 25, 2002 at 05:02:10AM -0700, John W. Krahn wrote:
> Michael Lamertz wrote:
> >
> > A.
> > perl -p0i -e 's/sub html_base.*//s' *.cgi
> >
> > reads the whole file in one
>
> > (-0 means $/ = \000),
>
> \000 is a reference to a numeric literal, "\000" is the null character
> which doesn't "reads the whole file in one"
Yepp, that wasn't intended to be a proper perl expression but more kind
of symbolic. I used the C notation where \nnn puts raw characters into
strings %-)
Sorry, that was unclear.
> > -0 only works with text files, since binaries might contain 0-bytes.
> > use -00777 to be absolutely safe, since there's no character 256.
>
> Octal 0777 is not equal to 256.
>
> $ perl -le'print 0777'
> 511
Again you're right. That'll teach me to not only type but also think
when I post next time @-)
> > Due to the '/s' you can't match on beginning or end of line anymore.
>
> If you use the /m modifier then ^ will match the beginning of a line and
> $ will match the end of a line.
Yepp, but this isn't what he needed. He wanted to match up to EOF. I
only mentioned it so he was aware of the, hmmm, "side effect".
--
If we fail, we will lose the war.
Michael Lamertz | +49 221 445420 / +49 171 6900 310
Nordstr. 49 | [EMAIL PROTECTED]
50733 Cologne | http://www.lamertz.net
Germany | http://www.perl-ronin.de
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]