<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sugyan</author_name>
  <author_url>https://blog.hatena.ne.jp/sugyan/</author_url>
  <blog_title>すぎゃーんメモ</blog_title>
  <blog_url>https://memo.sugyan.com/</blog_url>
  <categories>
    <anon>Perl</anon>
    <anon>OneLiner</anon>
  </categories>
  <description>Perlのsort関数は sort BLOCK LIST というようにBLOCKを指定すると、そのBLOCK内部で$aと$bという変数同士の比較方法を指定することができる。 なので、そこにprint文を埋め込んでしまえば、sort関数の中で「対象となるLISTのどの要素とどの要素が比較されているのか」が把握できる。 例えば簡単なものだと $ perl -le 'print sort { print &quot;$a, $b&quot;; $a &lt;=&gt; $b } 0..9' 0, 1 2, 3 4, 5 6, 7 8, 9 0, 2 2, 1 0, 4 4, 1 4, 2 4, 3 6, 8 8, 7 0, 6 6…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmemo.sugyan.com%2Fentry%2F20090425%2F1240589884&quot; title=&quot;sort関数の比較操作をワンライナーで可視化してみた - すぎゃーんメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-04-25 01:18:04</published>
  <title>sort関数の比較操作をワンライナーで可視化してみた</title>
  <type>rich</type>
  <url>https://memo.sugyan.com/entry/20090425/1240589884</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
