View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Curtis "Ovid" Poe > Class-Sniff-0.08_05 > csniff


Annotate this POD


New  2
Open  0
View/Report Bugs
Source   Latest Release: Class-Sniff-0.10


csniff - Command line interface to Class::Sniff graphs.


 csniff [options] dir


Boolean options:

 -v,  --verbose     Print what classes are being loaded
 -p,  --png         Output as png (requires 'dot' executable)
 -g,  --gif         Output as gif (requires 'dot' executable)
 -t,  --text        Output as text (large graphs may not render well)

Options that take arguments:

 -n,  --namespace   Perl regex to match desired namespaces
 -i,  --ignore      Perl regex to exclude namespaces
 -I,                Use this path with "use lib".        


Given a directory, attempts to render a Class::Sniff graph for all modules found in it. This may be very slow. Be patient. Output is sent to STDOUT, so redirect it where you will.

If no namespace argument is passed, it will attempt to graph every namespace. Because some of the modules Class::Sniff must load are fairly heavyweight, you will get plenty of modules showing up in the graph which you didn't expect. And it will be slow. Did I mention that already?


Graph your DBIx::Class resultset objects

You have a bunch of DBIx::Class resultset objects, but you don't want to see the DBIx::Class hierarchy.

As text graph:

 csniff --namespace '^My::ResultSet' --ignore '^DBIx' \
    lib/My/ResultSet > rs.txt

As text graph with short options:

 csniff -n '^My::Resultset' -i '^DBIx' lib/My/ResultSet > rx.txt


 csniff -n '^My::Resultset' -i '^DBIx' --png lib/My/ResultSet > rx.png

As Gif:

 csniff -n '^My::Resultset' -i '^DBIx' --gif lib/My/ResultSet > rx.gif

Note that the --gif and --png options require that you have the dot executable installed and in your PATH. dot is part of the GraphViz package (


Curtis "Ovid" Poe, <ovid at>


Please report any bugs or feature requests to bug-class-sniff at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Class::Sniff

You can also look for information at:



Copyright 2009 Curtis "Ovid" Poe, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: