Skip to content

Instantly share code, notes, and snippets.

@pavelsr
Last active October 28, 2020 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavelsr/99caccfb9a9cb3a981c2c8a611f3e22e to your computer and use it in GitHub Desktop.
Save pavelsr/99caccfb9a9cb3a981c2c8a611f3e22e to your computer and use it in GitHub Desktop.
Quick CLI tool to view perl call graph, wrapper under
#!/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
@pavelsr
Copy link
Author

pavelsr commented Dec 14, 2018

Installation:

sudo curl -L http://bit.ly/2A5F2IY -o /usr/local/bin/pcg && sudo chmod +x /usr/local/bin/pcg

@pavelsr
Copy link
Author

pavelsr commented Jan 30, 2019

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