Michael W Thelen wrote:
For example, applying a substituion "a" -> "ab" would lead to an
infinite substitution if the string contained "a".
Hmm, never mind me, I guess I didn't read the rules very carefully...
this is precluded by the restriction that the string will never grow
larger than 255 cha
Rick Klement wrote:
$^H does not have the special properties that $^C does, but $^H does
have an initial value of 256.
Hmm. Does anyone know how to explain the following?
$ perl -le 'print$^H'
0
$ perl -le 'print$^H++'
256
One could guess now $^H is set to 256 just when a modification is
attempte
Ton Hospel wrote:
For a good average:
$X[0] = $a;
Well, this gives $X[0] == '', at least on 5.8 here... (And I'm pretty
sure it does too on 5.6.x.. :o)
$X[1] = //;
$X[2] = $^F++;
$X[3] = $^F++;
So, why not just
$X[0] = $a++;
$X[1] = $a++;
$X[2] = $a++;
$X[3] = $a++;
Duh. :o)
lg,
daniel
Jasper wrote:
I wonder if we'll set a record for the number of entries for tri.pl
At least, I've added my simple 38.
Looking good so far.
I just love those easy holes. :o)
lg,
daniel, can't stop thinking of 37 now.
Yanick Champoux wrote:
> [EMAIL PROTECTED] said:
>> Perhaps OT but having finished the PBP not too long ago and finding
>> hardly any I couldn't live w/ (the bare 'else' aligned w/ the
>> previous close curly - though I see his point),
Hmm, so how does one write it correctly(tm)? Of course the bes
Jasper wrote:
> Can someone send me a link? Terje's old link has expired, and there
> doesn't seem to be an equivalent on his currently
> extant-but-hibernating minigolf site.
http://terje2.frox25.no-ip.org/~golf-info/Book.html
It's linked on http://perlgolf.sourceforge.net/ and google finds it
Ton Hospel wrote:
> -p0 s/\G(.*)(.* )(?=\1.\2|$)//g
>
> This should be about as efficient as a simple regex approach gets.
> It's also the shortest yet :-) It outputs starting from the first
> line that can't be extended. No output means all lines work.
If you're free to output whatever you want
Tuomo Salo wrote:
This one has no performance issues and is even a little bit shorter.
Yay!
AND it does print lines in wrong order! :o)
Doesn't it? It does for me.
lg,
daniel
Zhu Shanshan wrote:
As you said, when I substituted "s/\r\n$//" with "chomp", it did
work. After looking up the explanation of "chomp" in perldoc, I found
"chomp", which I always used to remove the newline previous, removes
any trailing string that corresponds to the current value of "$/".
Hej,
Phil Carmody wrote:
> I needed to remove blank-line-separated chunks of code from a text
> file if those chunks contained any lines which were 'too long'.
[...]
> If you think how little it does, it's got to be one-linerable, no?
Duh, wrong e-mail address, sorry if solutions show up twice now aft
Eirik Berg Hanssen wrote:
>> I'm probably overlooking something silly, but
>>
>> perl -O0 -pe's/.{65535,}//'
>
> Newlines.
Besides that I'm getting "Can't do {n,m} with n > m in regex" for values
greater than 2^15 - 1 here.
br,
daniel
Phil Carmody wrote:
> I needed to remove blank-line-separated chunks of code from a text
> file if those chunks contained any lines which were 'too long'.
[...]
> If you think how little it does, it's got to be one-linerable, no?
Here's one that does split on lines with whitespace too, but is muc
Phil Carmody wrote:
> I needed to remove blank-line-separated chunks of code from a text
> file if those chunks contained any lines which were 'too long'.
[...]
> If you think how little it does, it's got to be one-linerable, no?
Should do the trick:
perl -00 -ne'/.{65535}/||print'
lg,
daniel
13 matches
Mail list logo