<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>srkzhr</author_name>
  <author_url>https://blog.hatena.ne.jp/srkzhr/</author_url>
  <blog_title>半径5メートル</blog_title>
  <blog_url>https://srkzhr.hatenadiary.org/</blog_url>
  <categories>
    <anon>Perl</anon>
  </categories>
  <description>無名サブルーチンをレキシカル変数$refに入れると&amp;$refで呼び出す感じになるわけですが、なんだか不恰好。やたらめったら使うべきではないんだろうけど、型グロブでエイリアスをつくってやれば、普通のサブルーチン呼び出しのようにして使えますね。 my $target = 'abcbac&lt;ok&gt;dddse'; my $regexp = '&lt;(.+?)&gt;'; *regexp_p = sub { $_[0] =~ m/$_[1]/; defined $1 and print $1; }; regexp_p($target, $regexp);一度使った型グロブの名前は未定義にしてやればまた使えます。 u…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsrkzhr.hatenadiary.org%2Fentry%2F20080317%2F1205750776&quot; title=&quot;型グロブでサブルーチンのエイリアス - 半径5メートル&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>2008-03-17 19:46:16</published>
  <title>型グロブでサブルーチンのエイリアス</title>
  <type>rich</type>
  <url>https://srkzhr.hatenadiary.org/entry/20080317/1205750776</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
