Submit Search
Upload
コードの動的生成のお話
•
0 likes
•
698 views
鉄次 尾形
Follow
2017/1/19に行われた Gaiaxグループ社内勉強会 で発表したトークのスライドです。
Read less
Read more
Technology
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 25
Download now
Download to read offline
Recommended
Perl5i
Perl5i
Marcos Rebelo
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
Kaz Watanabe
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
Yusuke Wada
Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5
Yusuke Wada
PHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
PHP Basics and Demo HackU
PHP Basics and Demo HackU
Anshu Prateek
Undercover Pods / WP Functions
Undercover Pods / WP Functions
podsframework
Blog Hacks 2011
Blog Hacks 2011
Yusuke Wada
Recommended
Perl5i
Perl5i
Marcos Rebelo
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
Kaz Watanabe
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
エロサイト管理者の憂鬱3 - Hokkaiodo.pm#4 -
Yusuke Wada
Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5
Yusuke Wada
PHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
PHP Basics and Demo HackU
PHP Basics and Demo HackU
Anshu Prateek
Undercover Pods / WP Functions
Undercover Pods / WP Functions
podsframework
Blog Hacks 2011
Blog Hacks 2011
Yusuke Wada
YAPC::Asia 2010 Twitter解析サービス
YAPC::Asia 2010 Twitter解析サービス
Yusuke Wada
Introduction to the Pods JSON API
Introduction to the Pods JSON API
podsframework
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
Razvan Raducanu, PhD
Tax management-system
Tax management-system
Fahim Faysal Kabir
Modern php
Modern php
Charles Anderson
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
Kris Wallsmith
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
Kris Wallsmith
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たち
Ryo Miyake
PerlでWeb API入門
PerlでWeb API入門
Yusuke Wada
Ruby 2.0
Ruby 2.0
Uģis Ozols
Cpsh sh
Cpsh sh
Ben Pope
PHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Workhorse Computing
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Arc & Codementor
Feeds drupal cafe
Feeds drupal cafe
Andrii Podanenko
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Puppet
Manifests of Future Past
Manifests of Future Past
Puppet
Jqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
Path::Tiny
Path::Tiny
waniji
News of the Symfony2 World
News of the Symfony2 World
Fabien Potencier
最近のメールまわりのお仕事のお話
最近のメールまわりのお仕事のお話
鉄次 尾形
再帰、漸化式、差分方程式とアルゴリズム Gx#20
再帰、漸化式、差分方程式とアルゴリズム Gx#20
鉄次 尾形
More Related Content
What's hot
YAPC::Asia 2010 Twitter解析サービス
YAPC::Asia 2010 Twitter解析サービス
Yusuke Wada
Introduction to the Pods JSON API
Introduction to the Pods JSON API
podsframework
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
Razvan Raducanu, PhD
Tax management-system
Tax management-system
Fahim Faysal Kabir
Modern php
Modern php
Charles Anderson
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
Kris Wallsmith
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
Kris Wallsmith
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たち
Ryo Miyake
PerlでWeb API入門
PerlでWeb API入門
Yusuke Wada
Ruby 2.0
Ruby 2.0
Uģis Ozols
Cpsh sh
Cpsh sh
Ben Pope
PHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Workhorse Computing
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Arc & Codementor
Feeds drupal cafe
Feeds drupal cafe
Andrii Podanenko
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Puppet
Manifests of Future Past
Manifests of Future Past
Puppet
Jqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
Path::Tiny
Path::Tiny
waniji
News of the Symfony2 World
News of the Symfony2 World
Fabien Potencier
What's hot
(20)
YAPC::Asia 2010 Twitter解析サービス
YAPC::Asia 2010 Twitter解析サービス
Introduction to the Pods JSON API
Introduction to the Pods JSON API
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
Tax management-system
Tax management-system
Modern php
Modern php
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たち
PerlでWeb API入門
PerlでWeb API入門
Ruby 2.0
Ruby 2.0
Cpsh sh
Cpsh sh
PHP and Rich Internet Applications
PHP and Rich Internet Applications
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Feeds drupal cafe
Feeds drupal cafe
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Manifests of Future Past
Manifests of Future Past
Jqeury ajax plugins
Jqeury ajax plugins
Path::Tiny
Path::Tiny
News of the Symfony2 World
News of the Symfony2 World
Viewers also liked
最近のメールまわりのお仕事のお話
最近のメールまわりのお仕事のお話
鉄次 尾形
再帰、漸化式、差分方程式とアルゴリズム Gx#20
再帰、漸化式、差分方程式とアルゴリズム Gx#20
鉄次 尾形
4月16日だからFoursquare 位置情報とライフログ
4月16日だからFoursquare 位置情報とライフログ
鉄次 尾形
穏やかにファイルを削除する続き
穏やかにファイルを削除する続き
鉄次 尾形
超小規模環境のMySQL #mysqlcasual
超小規模環境のMySQL #mysqlcasual
鉄次 尾形
三角関数の加法定理はなぜ難しいのか
三角関数の加法定理はなぜ難しいのか
鉄次 尾形
日本全国ぶらりPerl旅
日本全国ぶらりPerl旅
鉄次 尾形
Perlで生きる10年
Perlで生きる10年
鉄次 尾形
穏やかにファイルを削除する
穏やかにファイルを削除する
鉄次 尾形
Perl ウェブ開発の中世〜CGI と Plack の間〜
Perl ウェブ開発の中世〜CGI と Plack の間〜
鉄次 尾形
Viewers also liked
(10)
最近のメールまわりのお仕事のお話
最近のメールまわりのお仕事のお話
再帰、漸化式、差分方程式とアルゴリズム Gx#20
再帰、漸化式、差分方程式とアルゴリズム Gx#20
4月16日だからFoursquare 位置情報とライフログ
4月16日だからFoursquare 位置情報とライフログ
穏やかにファイルを削除する続き
穏やかにファイルを削除する続き
超小規模環境のMySQL #mysqlcasual
超小規模環境のMySQL #mysqlcasual
三角関数の加法定理はなぜ難しいのか
三角関数の加法定理はなぜ難しいのか
日本全国ぶらりPerl旅
日本全国ぶらりPerl旅
Perlで生きる10年
Perlで生きる10年
穏やかにファイルを削除する
穏やかにファイルを削除する
Perl ウェブ開発の中世〜CGI と Plack の間〜
Perl ウェブ開発の中世〜CGI と Plack の間〜
Similar to コードの動的生成のお話
PHP 5.3 Overview
PHP 5.3 Overview
jsmith92
Advanced symfony Techniques
Advanced symfony Techniques
Kris Wallsmith
Perl basics for Pentesters
Perl basics for Pentesters
Sanjeev Kumar Jaiswal
Practical PHP 5.3
Practical PHP 5.3
Nate Abele
DPC 2012 : PHP in the Dark Workshop
DPC 2012 : PHP in the Dark Workshop
Jeroen Keppens
Mojolicious
Mojolicious
Marcos Rebelo
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
Introduction To Moco
Introduction To Moco
Naoya Ito
Writing Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniter
CodeIgniter Conference
ISUCONアプリを Pythonで書いてみた
ISUCONアプリを Pythonで書いてみた
memememomo
Bioinformatics p5-bioperlv2014
Bioinformatics p5-bioperlv2014
Prof. Wim Van Criekinge
Building a horizontally scalable API in php
Building a horizontally scalable API in php
Wade Womersley
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
Prof. Wim Van Criekinge
Assetic (Zendcon)
Assetic (Zendcon)
Kris Wallsmith
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
Jeremy Coates
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngine
MichaelRog
Perl web frameworks
Perl web frameworks
diego_k
Curscatalyst
Curscatalyst
Kar Juan
Power Theming
Power Theming
drkdn
Zendcon 2007 Api Design
Zendcon 2007 Api Design
unodelostrece
Similar to コードの動的生成のお話
(20)
PHP 5.3 Overview
PHP 5.3 Overview
Advanced symfony Techniques
Advanced symfony Techniques
Perl basics for Pentesters
Perl basics for Pentesters
Practical PHP 5.3
Practical PHP 5.3
DPC 2012 : PHP in the Dark Workshop
DPC 2012 : PHP in the Dark Workshop
Mojolicious
Mojolicious
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Introduction To Moco
Introduction To Moco
Writing Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniter
ISUCONアプリを Pythonで書いてみた
ISUCONアプリを Pythonで書いてみた
Bioinformatics p5-bioperlv2014
Bioinformatics p5-bioperlv2014
Building a horizontally scalable API in php
Building a horizontally scalable API in php
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
Assetic (Zendcon)
Assetic (Zendcon)
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngine
Perl web frameworks
Perl web frameworks
Curscatalyst
Curscatalyst
Power Theming
Power Theming
Zendcon 2007 Api Design
Zendcon 2007 Api Design
More from 鉄次 尾形
Perl入学式 2018年度の報告
Perl入学式 2018年度の報告
鉄次 尾形
【公開版】AWS基礎 for 新卒エンジニア
【公開版】AWS基礎 for 新卒エンジニア
鉄次 尾形
俺のこだわりデスクのその後
俺のこだわりデスクのその後
鉄次 尾形
Hokkaido.pmと7年
Hokkaido.pmと7年
鉄次 尾形
WordPress 運用を支える Perl
WordPress 運用を支える Perl
鉄次 尾形
障害対応とその防止策
障害対応とその防止策
鉄次 尾形
働きやすい社内を目指す!二酸化炭素計測ツール
働きやすい社内を目指す!二酸化炭素計測ツール
鉄次 尾形
mod_perlプログラマーがYAPCで語るレガシー開発論
mod_perlプログラマーがYAPCで語るレガシー開発論
鉄次 尾形
東京近郊のPerlコミュニティのご紹介 #lcs2015
東京近郊のPerlコミュニティのご紹介 #lcs2015
鉄次 尾形
設定ファイルに使われそうなデータ形式
設定ファイルに使われそうなデータ形式
鉄次 尾形
ライフログ、時系列メモ
ライフログ、時系列メモ
鉄次 尾形
今に伝えるメールの技術 #yapcasia #yapcasiareject
今に伝えるメールの技術 #yapcasia #yapcasiareject
鉄次 尾形
マルチタスクって奥が深い #mishimapm
マルチタスクって奥が深い #mishimapm
鉄次 尾形
2014年には役に立たないセッションの昔話 #hachiojipm
2014年には役に立たないセッションの昔話 #hachiojipm
鉄次 尾形
そのsleep、ちょっと待った! #perlbeginners
そのsleep、ちょっと待った! #perlbeginners
鉄次 尾形
環境が変わって最近知ったもの #hachiojipm
環境が変わって最近知ったもの #hachiojipm
鉄次 尾形
これからPerlを使っていくみなさんへ #Perl入学式
これからPerlを使っていくみなさんへ #Perl入学式
鉄次 尾形
エディタ遍歴2014 #hachiojipm
エディタ遍歴2014 #hachiojipm
鉄次 尾形
今年作ったもの2013 #hokkaidopm
今年作ったもの2013 #hokkaidopm
鉄次 尾形
プロセスの永続化でコスト削減 #perlbeginners
プロセスの永続化でコスト削減 #perlbeginners
鉄次 尾形
More from 鉄次 尾形
(20)
Perl入学式 2018年度の報告
Perl入学式 2018年度の報告
【公開版】AWS基礎 for 新卒エンジニア
【公開版】AWS基礎 for 新卒エンジニア
俺のこだわりデスクのその後
俺のこだわりデスクのその後
Hokkaido.pmと7年
Hokkaido.pmと7年
WordPress 運用を支える Perl
WordPress 運用を支える Perl
障害対応とその防止策
障害対応とその防止策
働きやすい社内を目指す!二酸化炭素計測ツール
働きやすい社内を目指す!二酸化炭素計測ツール
mod_perlプログラマーがYAPCで語るレガシー開発論
mod_perlプログラマーがYAPCで語るレガシー開発論
東京近郊のPerlコミュニティのご紹介 #lcs2015
東京近郊のPerlコミュニティのご紹介 #lcs2015
設定ファイルに使われそうなデータ形式
設定ファイルに使われそうなデータ形式
ライフログ、時系列メモ
ライフログ、時系列メモ
今に伝えるメールの技術 #yapcasia #yapcasiareject
今に伝えるメールの技術 #yapcasia #yapcasiareject
マルチタスクって奥が深い #mishimapm
マルチタスクって奥が深い #mishimapm
2014年には役に立たないセッションの昔話 #hachiojipm
2014年には役に立たないセッションの昔話 #hachiojipm
そのsleep、ちょっと待った! #perlbeginners
そのsleep、ちょっと待った! #perlbeginners
環境が変わって最近知ったもの #hachiojipm
環境が変わって最近知ったもの #hachiojipm
これからPerlを使っていくみなさんへ #Perl入学式
これからPerlを使っていくみなさんへ #Perl入学式
エディタ遍歴2014 #hachiojipm
エディタ遍歴2014 #hachiojipm
今年作ったもの2013 #hokkaidopm
今年作ったもの2013 #hokkaidopm
プロセスの永続化でコスト削減 #perlbeginners
プロセスの永続化でコスト削減 #perlbeginners
Recently uploaded
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
UK Journal
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Katpro Technologies
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Pixlogix Infotech
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Recently uploaded
(20)
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
コードの動的生成のお話
1.
OGATA Tetsuji (@xtetsuji) 2017/01/19
Gaiax https://flic.kr/p/77EHJk
2.
• OGATA Tetsuji
a.k.a. @xtetsuji • http://post.tetsuji.jp/ • RND INFR • Perl 🐫/ Debian 🌀 / Postfix MTA 📩 / Mathematics 🔢 / Classical Music 🎵 / Cafe ☕ / Route Bus 🚌
3.
• • • • •
4.
https://flic.kr/p/77EHJk
5.
• • • eval
6.
- Perl
7.
sub AUTOLOAD { my
( $self, $args ) = @_; our $AUTOLOAD; my $class = ref $self; # PROJECT::Model::FUNC my $method = $AUTOLOAD; # PROJECT::Model::FUNC::hoge $method =~ s/$class:://; $class =~ s/^PROJECT::Model:://; return $self->mysql->{ $class }->$method( $args ); }
8.
• Perl AUTOLOAD • $AUTOLOAD •
9.
AUTOLOAD • • • •
10.
AUTOLOAD • AUTOLOAD • CGI •
CGI.pm
11.
### From CGI
package version 2.99 sub AUTOLOAD { print STDERR "CGI::AUTOLOAD for $AUTOLOADn" if $CGI::AUTOLOAD_DEBUG; my $func = &_compile; goto &$func; }
12.
• _compile • LL •
eval
13.
sub _compile { my($func)
= $AUTOLOAD; my($pack,$func_name); { local($1,$2); # this fixes an obscure variable suicide problem. $func=~/(.+)::([^:]+)$/; ($pack,$func_name) = ($1,$2); $pack=~s/::SUPER$//; # fix another obscure problem $pack = ${"$pack::AutoloadClass"} || $CGI::DefaultClass unless defined(${"$pack::AUTOLOADED_ROUTINES"}); my($sub) = %{"$pack::SUBS"}; unless (%$sub) { my($auto) = ${"$pack::AUTOLOADED_ROUTINES"}; eval "package $pack; $$auto"; croak("$AUTOLOAD: $@") if $@; $$auto = ''; # Free the unneeded storage (but don't undef it!!!) } my($code) = $sub->{$func_name}; $code = "sub $AUTOLOAD { }" if (!$code and $func_name eq 'DESTROY'); if (!$code) { (my $base = $func_name) =~ s/^(start_|end_)//i; if ($EXPORT{':any'} || $EXPORT{'-any'} || $EXPORT{$base} || (%EXPORT_OK || grep(++$EXPORT_OK{$_},&expand_tags(':html'))) && $EXPORT_OK{$base}) { $code = $CGI::DefaultClass->_make_tag_func($func_name); } } croak("Undefined subroutine $AUTOLOADn") unless $code; eval "package $pack; $code"; if ($@) { $@ =~ s/ at .*n//; croak("$AUTOLOAD: $@"); } } CORE::delete($sub->{$func_name}); #free storage return "$pack::$func_name"; }
14.
• AUTOLOAD $AUTLOAD $code •
$code eval • AUTOLOAD
15.
• 2004 CGI.pm
2.99 • • CGI.pm 4.35 AUTOLOAD • fork CPU CGI
16.
• Q:
17.
• A:
18.
Apache::LogFormat::Compiler
19.
20.
• new Apache •
"custom", "combine" %* • log_line PSGI • log_line
21.
sub new { my
$class = shift; my $fmt = shift || "combined"; $fmt = $formats{$fmt} if exists $formats{$fmt}; my %opts = @_; my ($code_ref, $code) = compile($fmt, $opts{block_handlers} || {}, $opts{char_handlers} || {}); bless [$code_ref, $code], $class; } sub log_line { my $self = shift; $self->[0]->(@_) . "n"; }
22.
sub compile { my
$fmt = shift; my $extra_block_handlers = shift; my $extra_char_handlers = shift; $fmt =~ s/!/!/g; $fmt =~ s! (?: %{(.+?)}([a-zA-Z]) | %(?:[<>])?([a-zA-Z%]) ) ! $1 ? $block_handler->($1, $2, $extra_block_handlers) : $char_handler->($3, $extra_char_handlers) !egx; my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); my $c = {}; $fmt = q~sub { $_[TIME] = time() if ! defined $_[TIME]; my @lt = localtime($_[TIME]); if ( ! exists $c->{tz_cache} || ! exists $c->{isdst_cache} || $lt[8] != $c->{isdst_cache} ) { $c->{tz_cache} = POSIX::strftime::Compiler::strftime('%z',@lt); $c->{isdst_cache} = $lt[8]; } my $t = sprintf '%02d/%s/%04d:%02d:%02d:%02d %s', $lt[3], $abbr[$lt[4]], $lt[5]+1900, $lt[2], $lt[1], $lt[0], $c->{tz_cache}; q!~ . $fmt . q~! }~; my $code_ref = eval $fmt; ## no critic die $@ . "n===n" . $fmt if $@; wantarray ? ($code_ref, $fmt) : $code_ref; }
23.
• • log_line eval • •
24.
• • Perl eval •
eval try
Download now