UNIVERSAL::source_location_for - Get source filename and line number of a subroutine
use UNIVERSAL::source_location_for; use File::Spec; my ($source_filename, $line) = File::Spec->source_location_for('canonpath');
This module supplys a universal function "source_location_for", a perl implementation of the method Method#source_location of Ruby.
It's useful for debug.
Module->source_location_for('method')
Reuturn source filename and line number of the subroutine.
Fuji, Goro (gfx) <gfuji(at)cpan.org>
Hiroki Honda <cside.story <at> gmail.com>
Copyright (c) 2012, Hiroki Honda.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install UNIVERSAL::source_location_for, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UNIVERSAL::source_location_for
CPAN shell
perl -MCPAN -e shell install UNIVERSAL::source_location_for
For more information on module installation, please visit the detailed CPAN module installation guide.