SlideShare a Scribd company logo
Perl::Lint - Yet Another 
Perl Source Code Linter 
http://bit.ly/1p5HdSA 
@moznion
VOTE ME!
SEE ALSO 
Perlの静的解析入門と 
Perlリファクタリングツール 
App::PRTのご紹介 
@hitode909 
! 
Day 2, 多目的教室3, 16:00
@moznion
@moznion 
@hitode909
Perl::Lint 
! https://github.com/moznion/Perl-Lint 
  
https://metacpan.org/release/MOZNION/Perl- 
Lint-0.01_01 (<= UNDERDEVELOPMENT!!!)
Perl::Lint 
! https://github.com/moznion/Perl-Lint 
  
https://metacpan.org/release/MOZNION/Perl- 
Lint-0.01_02 (<= UNDERDEVELOPMENT!!!)
What is 
Perl::Lint?
A. Source Code Linter 
for Perl
Yes, It’s like… 
Perl:: 
http://bit.ly/1l5HrYX
Are you using 
Perl::Critic? http://bit.ly/1pfMxCW
What is 
Perl::Critic?
A. Source Code Linter 
for Perl
Wait!!
What is 
Source Code 
Linter???
A. Analyzes the 
source code and 
detects the causes 
of bugs
Search 
and 
Destroy 
http://bit.ly/1AT3Bl3
Concretely…
There are five bad things
There are five bad things
There are five bad things
There are five bad things
There are five bad things
There are five bad things
It was fun?
Is this what I think it is?
It’s just CODE REVIEW?
But do you think human 
should do the such code 
review?
Human should work 
more creative
It seems possible to 
check by computer
There are five bad things
And probably 
human overlooks
Hard to Understand Code
Hard to Understand Code 
Destroy!
Hard to Understand Code 
Easy to review
Do you like clean code, 
and why?
Readable code 
! 
! 
Reviewable code
Readable code 
≒ 
! 
! 
Reviewable code
=> Maintainable!!
Maintainable code 
will be growing up 
along maintainable
Humans can focus on 
creative work
Okay, 
Make maintainable code 
by computer!
And then source code 
linter was appeared 
(1979 for C)
Now; 
js-lint, find-bugs, 
rubocop, etc…
And language 
processors: 
Go, Scala and etc.
Does Perl have?
Perl::Lint - Yet Another Perl Source Code Linter
Perl::Critic is awesome!
Perl::Critic checks 
the code conform 
to PBP style or not
Benefit to analyze 
code by computer
He don’t grumble
He is 
inexhaustible
He don’t take a mistake
He is fast 
(in many cases)
And can automation
Cost of human: HIGH 
! 
Cost of computer: LOW
Cost of human: HIGH 
! 
Cost of computer: LOW 
Good!!
Got it.
But… 
If there is Perl::Critic, 
Is Perl::Lint don’t need?
Perl::Critic is awesome 
but a little slow
In large project, 
It takes 3 minutes 
to run only Perl::Critic
How do you spend in 
meantime?
Coffee? 
How do you spend in 
meantime?
Coffee? 
Chat? 
How do you spend in 
meantime?
Coffee? 
Nap? Chat? 
How do you spend in 
meantime?
Coffee? 
Swing Copters? 
Nap? Chat? 
How do you spend in 
meantime?
Life is too short, 
so let’s accelerate!!
Rate [num/sec] 
100 
75 
50 
25 
0 
97 
18 
Perl::Critic Perl::Lint
Rate [num/sec] 
100 
75 
About 50 
400% increase 
25 
0 
97 
18 
Perl::Critic Perl::Lint
Yeah!!!! 
I'll show you all my tricks
A little break
Background that led to 
the development
This project receive 
TPF grant
Do you know 
TPF grant?
Nozaki-san and 
Maki-san (@lestrrat-san) 
are people in a high 
position of TPF grant
Maki-san「日本人がトップになっ 
たのに日本から1つもProposal出な 
いのちょっとアレじゃない?」▼ 
me「そうですなあ」▼ 
Maki-san「moznion出してよ」▼ 
me「!!!!!」▼
Time flies everything 
goes…
Perl::Lint - Yet Another Perl Source Code Linter
Perl::Lint!!!!
Let’s apply!!!
Return to our subject…
How do we do 
static analyzing for Perl?
Perl::Lint - Yet Another Perl Source Code Linter
Enough!
Joke :p
Two major methods 
- Evaluate Token 
- Evaluate AST
Two major methods 
- Evaluate Token 
- Evaluate AST
Tools - PPI - Compiler::Lexer
Tools - PPI - Compiler::Lexer
What is Compiler::Lexer?
*Very Fast* tokenizer 
made of C++
Compiler::Lexer is fast 
⇛ Perl::Lint is fast!
And others: 
Compiler::Parser, 
C::CodeGenerator::LLVM, 
etc… 
@goccy54++
Example of tokens 
that is generated by 
Compiler::Lexer
my $foo;
my $foo;
Points
Use these tokens 
to analyze
Perl::Lint - Yet Another Perl Source Code Linter
Enough!
Architecture of Perl::Lint
Top Level 
+args 
+site_policies 
+lint 
+lint_string 
Policies 
+evaluate 
1 
Filters 
+filter 
1 
1 .. * 
1 .. *
Simple and Easy!
Policies
Each policies are 
isolated
Easy to make 
your own policy
Samples
*** CAUTION *** 
A lot of bad 
code are here. 
Close your eyes.
@P::L::P::Miscellanea::ProhibitTies
@P::L::P::Miscellanea::ProhibitTies 
Check type
@P::L::P::Miscellanea::ProhibitTies 
Check data
Perl::Lint - Yet Another Perl Source Code Linter
アッ
Feature of 
Implementation 
and Bad Know-hows
Use C-Style for()
Use C-Style for() 
But PBP prohibit it!!
Use List::Util::any 
instead of grep
Don’t use regex, 
compare by eq in series
Or use hash 
…
Function calling 
is almost gone.
Use simple parts 
e.g. raw-bless, POPO
Filtering mechanism
Perl::Critic’s 
default rule system 
is a bit difficult…
Yes, I know, 
perlcriticrc can 
adjust them. 
But too much hustle
Perl::Lint checks 
the all of policies 
as default
And you can filter 
any policies as you like
Filter by `ignore`
Filter by `filter`
Yes, of course 
you can deny 
the all of policies :)
You can define 
your own filter
e.g.
And Perl::Lint provides 
default policies
Perl::Lint - Yet Another Perl Source Code Linter
Perl::Lint - Yet Another Perl Source Code Linter
For Perl::Critic users ;)
These are features 
of Perl::Lint
But installation is such a 
hassle!
Perl::Lint 
Playground 
http://perl-lint.moznion.net
You can try!
Meaning to publish 
Playground
It makes easy to get 
feedback
Motivation ➚
Publish the Playground 
is looking good!
Future works
Implement the all of 
policies…
## no lint
Module for testing 
(Like a Test::Perl::Critic)
Cooperate with GitHub 
(Like a Coveralls)
Inject the result 
into code as TODO 
comment 
(inspired by rubocop)
As you see, 
Perl::Lint is 
under development
SEGV, ABRT, etc…
I’m looking for 
contributors!
DEMO
Any Questions?

More Related Content

What's hot (20)

PDF
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
PDF
떠먹는 '오브젝트' Ch05 책임 할당하기
Covenant Ko
 
KEY
Perl 5.16 and Beyond - YAPC::Asia 2011
Jesse Vincent
 
PPTX
Introduction about Python by JanBask Training
JanBask Training
 
PDF
F# for Scala developers
Alfonso Garcia-Caro
 
PDF
Python for All
Pragya Goyal
 
PDF
From Python to Kotlin - TalkingKT 2019
Horgix
 
PPTX
An Introduction to ANTLR
Morteza Zakeri
 
PPTX
Python Internals Optimization Choices Made - Codementors Office Hours with St...
Arc & Codementor
 
PDF
Implementation of TypeGraphQL with Apollo Server
Fabien Pasquet
 
PPTX
Why Python?
Adam Pah
 
PDF
Python for Swift
LINE Corporation
 
PPTX
Modern Programming Languages - An overview
Ayman Mahfouz
 
PDF
Ruby monsters
1337807
 
PDF
Generators, Coroutines and Other Brain Unrolling Sweetness. Adi Shavit ➠ Cor...
corehard_by
 
PPTX
Python Tutorial for Beginner
rajkamaltibacademy
 
PDF
An Introduction to Python Programming
Morteza Zakeri
 
PDF
Parrot -- "one bytecode to rule them all"
Nuno Carvalho
 
PPTX
Antlr part2 getting_started_in_java
Morteza Zakeri
 
PDF
Native hook mechanism in Android Bionic linker
Kevin Mai-Hsuan Chia
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
떠먹는 '오브젝트' Ch05 책임 할당하기
Covenant Ko
 
Perl 5.16 and Beyond - YAPC::Asia 2011
Jesse Vincent
 
Introduction about Python by JanBask Training
JanBask Training
 
F# for Scala developers
Alfonso Garcia-Caro
 
Python for All
Pragya Goyal
 
From Python to Kotlin - TalkingKT 2019
Horgix
 
An Introduction to ANTLR
Morteza Zakeri
 
Python Internals Optimization Choices Made - Codementors Office Hours with St...
Arc & Codementor
 
Implementation of TypeGraphQL with Apollo Server
Fabien Pasquet
 
Why Python?
Adam Pah
 
Python for Swift
LINE Corporation
 
Modern Programming Languages - An overview
Ayman Mahfouz
 
Ruby monsters
1337807
 
Generators, Coroutines and Other Brain Unrolling Sweetness. Adi Shavit ➠ Cor...
corehard_by
 
Python Tutorial for Beginner
rajkamaltibacademy
 
An Introduction to Python Programming
Morteza Zakeri
 
Parrot -- "one bytecode to rule them all"
Nuno Carvalho
 
Antlr part2 getting_started_in_java
Morteza Zakeri
 
Native hook mechanism in Android Bionic linker
Kevin Mai-Hsuan Chia
 

Similar to Perl::Lint - Yet Another Perl Source Code Linter (20)

ODP
Extending Perl Critic
joshua.mcadams
 
ODP
YAPC::NA 2007 - An Introduction To Perl Critic
joshua.mcadams
 
PDF
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Alex Balhatchet
 
ODP
An Introduction To Perl Critic
joshua.mcadams
 
PDF
Perl Critic In Depth
Jeffrey Ryan Thalhammer
 
PDF
What's new in Perl 5.12?
acme
 
PDF
What's new In Perl?
acme
 
PPTX
Webinar: Learn Perl - The Jewel of Scripting Languages
Edureka!
 
PDF
Introduction to writing readable and maintainable Perl
Alex Balhatchet
 
PDF
Perl-Critic
Jonas Brømsø
 
PDF
Perl tutorial
HarikaReddy115
 
KEY
Yapc2012
John Napiorkowski
 
PDF
Perl Chapter 1
Mukesh Tekwani
 
PDF
Perl 5.10
acme
 
PDF
Mastering Regex in Perl
Edureka!
 
PDF
Mastering Perl Second Edition Brian D Foy
suichmulchv3
 
PDF
Perl 101
Alex Balhatchet
 
PDF
Enterprise Perl
Dave Cross
 
PDF
System Programming and Administration
Krasimir Berov (Красимир Беров)
 
PDF
PL/Perl - New Features in PostgreSQL 9.0 201012
Tim Bunce
 
Extending Perl Critic
joshua.mcadams
 
YAPC::NA 2007 - An Introduction To Perl Critic
joshua.mcadams
 
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Alex Balhatchet
 
An Introduction To Perl Critic
joshua.mcadams
 
Perl Critic In Depth
Jeffrey Ryan Thalhammer
 
What's new in Perl 5.12?
acme
 
What's new In Perl?
acme
 
Webinar: Learn Perl - The Jewel of Scripting Languages
Edureka!
 
Introduction to writing readable and maintainable Perl
Alex Balhatchet
 
Perl-Critic
Jonas Brømsø
 
Perl tutorial
HarikaReddy115
 
Perl Chapter 1
Mukesh Tekwani
 
Perl 5.10
acme
 
Mastering Regex in Perl
Edureka!
 
Mastering Perl Second Edition Brian D Foy
suichmulchv3
 
Perl 101
Alex Balhatchet
 
Enterprise Perl
Dave Cross
 
System Programming and Administration
Krasimir Berov (Красимир Беров)
 
PL/Perl - New Features in PostgreSQL 9.0 201012
Tim Bunce
 
Ad

More from moznion (20)

PDF
Yet Another Perl Cooking
moznion
 
PDF
Jesque robust-worker-pool
moznion
 
PDF
Hachioji persec
moznion
 
PDF
Inner world of Perl::Lint
moznion
 
PDF
命名の話
moznion
 
PDF
Hachiojipm 44
moznion
 
PDF
Perl::Lint is over, for the present
moznion
 
PDF
Hachioji pm 41
moznion
 
PDF
Hachioji.pm 40
moznion
 
PDF
Hachioji.pm #39
moznion
 
PDF
Talking About Japanese Area Code of Phone
moznion
 
PDF
Hachioji.pm 38
moznion
 
PDF
Hokkaido.pm #11
moznion
 
PDF
Hachiojipm 36
moznion
 
PDF
Plack::Request with Encoding
moznion
 
PDF
YAPC::Asia 2013 - CPAN Testers Reports の情報を上手に使う
moznion
 
PDF
Net stalking with-lastfm
moznion
 
PDF
Takao.mt 2013
moznion
 
PDF
Perl beginners #08
moznion
 
PDF
Hachiojipm 28
moznion
 
Yet Another Perl Cooking
moznion
 
Jesque robust-worker-pool
moznion
 
Hachioji persec
moznion
 
Inner world of Perl::Lint
moznion
 
命名の話
moznion
 
Hachiojipm 44
moznion
 
Perl::Lint is over, for the present
moznion
 
Hachioji pm 41
moznion
 
Hachioji.pm 40
moznion
 
Hachioji.pm #39
moznion
 
Talking About Japanese Area Code of Phone
moznion
 
Hachioji.pm 38
moznion
 
Hokkaido.pm #11
moznion
 
Hachiojipm 36
moznion
 
Plack::Request with Encoding
moznion
 
YAPC::Asia 2013 - CPAN Testers Reports の情報を上手に使う
moznion
 
Net stalking with-lastfm
moznion
 
Takao.mt 2013
moznion
 
Perl beginners #08
moznion
 
Hachiojipm 28
moznion
 
Ad

Recently uploaded (20)

PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Digital Circuits, important subject in CS
contactparinay1
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 

Perl::Lint - Yet Another Perl Source Code Linter