in reply to Re: Golf: Length of longest line in a file
in thread Golf: Length of longest line in a file
Please correct me if I am wrong, but the following code ...
$s^=$_
expands to:
$s = $s ^ $_;
So, this takes advantage of the string xor operator's ability to increase the shorter string to match the length of the longer string. Then it returns a string whose length is that of the longer of the 2 strings. (Bitwise String Operators)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Golf: Length of longest line in a file (explanation)
by BrowserUk (Patriarch) on Jul 04, 2010 at 02:16 UTC |