* Andrew Savige [EMAIL PROTECTED] [2003-02-10 17:54]:
*whistle* *whistle* *red card* *disqualified*
multiplying by length (x+length) will not give the desired
result here; it must be boolean (0 or 1 only).
Doh! Of course. I'm an idiot. *grmbl*
--
Regards,
Aristotle
Andrew Savige schreef:
Aristotle golfed:
$_=$x;@lines=(/^.*/mg)x+length;
Against my better judgment, I will have a go at golfing this:
$_=$x;@l=(/^.*/mg)x/./s
This clobbers $_. Not nice for the rest of the program. Correct is:
{local$_=$x;@l=(/^.*/mg)x/./s}
or
* Eugene van der Pijll [EMAIL PROTECTED] [2003-02-10 18:35]:
Unfortunately, you had use strict in your first post,
and neither of these are use-strict safe.
Oh? What makes you say so?
--
Regards,
Aristotle
(-ugene sprak:
Andrew Savige schreef:
Aristotle golfed:
$_=$x;@lines=(/^.*/mg)x+length;
Against my better judgment, I will have a go at golfing this:
$_=$x;@l=(/^.*/mg)x/./s
This clobbers $_. Not nice for the rest of the program. Correct is:
On Mon, 10 Feb 2003 11:09:25 +1100 (EST), [EMAIL PROTECTED] wrote:
Yitzchak Scott-Thoennes wrote:
Sigh. I'd call that a bug if someone hadn't gone to the trouble to
test for it and document it. (Indeed, I see a bug report out there:
#6653, was 20010327.008.) So do something like:
my
Yitzchak Scott-Thoennes [EMAIL PROTECTED] wrote:
Only if you say $x eq means no lines instead of one empty
line missing its \n :)
Well, the subject line does say textfile-like, and a 0-byte
text file has no lines, not one empty line.
--
Keith C. Ivey [EMAIL PROTECTED]
Washington, DC
On Mon, 10 Feb 2003 23:44:14 -0500, [EMAIL PROTECTED] wrote:
Yitzchak Scott-Thoennes [EMAIL PROTECTED] wrote:
Only if you say $x eq means no lines instead of one empty
line missing its \n :)
Well, the subject line does say textfile-like, and a 0-byte
text file has no lines, not one empty