<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chaichanPaPa</author_name>
  <author_url>https://blog.hatena.ne.jp/chaichanPaPa/</author_url>
  <blog_title>旧燈明日記</blog_title>
  <blog_url>https://chaipa.hateblo.jp/</blog_url>
  <categories>
    <anon>Perlノート</anon>
  </categories>
  <description>昨日言っていた『インナーサブルーチンを使って親のレキシカル変数をリターン値にすると、初回の値を保持するようなのです』の性質を利用するとstatic変数だけでなく、クロージャも出来ますね！ ◆サンプル（closure.pl） use strict; use warnings; sub closure { my $value = shift; sub { $value++ }; } my $c = closure(100); print $c-&gt;(), &quot;\n&quot;; print $c-&gt;(), &quot;\n&quot;; print $c-&gt;(), &quot;\n&quot;; print $c-&gt;(), &quot;\n&quot;; ◆実行結果 C…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaipa.hateblo.jp%2Fentry%2F20090520%2F1242823737&quot; title=&quot; 無名サブルーチンとクロージャ - 旧燈明日記&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-05-20 21:48:57</published>
  <title> 無名サブルーチンとクロージャ</title>
  <type>rich</type>
  <url>https://chaipa.hateblo.jp/entry/20090520/1242823737</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
