Last active
October 28, 2020 12:46
-
-
Save pavelsr/99caccfb9a9cb3a981c2c8a611f3e22e to your computer and use it in GitHub Desktop.
Quick CLI tool to view perl call graph, wrapper under
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Quick CLI tool to view perl call graph | |
if ! [ -x "$(command -v dot)" ]; then | |
echo 'Error: graphviz is not installed. Try sudo apt-get install graphviz' >&2 | |
exit 1 | |
fi | |
if ! [ -x "$(command -v perl_call_graph)" ]; then | |
echo 'Error: please put perl_call_graph.pl to /usr/local/bin or make bash alias' >&2 | |
exit 1 | |
fi | |
FILENAME=pcg | |
perl_call_graph --output ${FILENAME}.dot $1 | |
dot -Tpng ${FILENAME}.dot > ${FILENAME}.png | |
eog ${FILENAME}.png |
Installation of perl_call_graph.pl
:
https://github.com/cobber/perl_call_graph
sudo curl -L https://raw.githubusercontent.com/cobber/perl_call_graph/master/bin/perl_call_graph -o /usr/local/bin/perl_call_graph && sudo chmod +x /usr/local/bin/perl_call_graph
sudo apt-get install graphviz eog
sudo cpm install -gv GraphViz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation:
sudo curl -L http://bit.ly/2A5F2IY -o /usr/local/bin/pcg && sudo chmod +x /usr/local/bin/pcg