I thought I would share a bash script since Barton mentioned mucking with the environment. Thought in the context of this discussion it might not be appreciated.
To use the script just log into Koha on any computer, and use this script on the server to get into perl's debugging mode. If the script is named Koha_cli.bash, then call it on the server like `bash Koha_cli.bash SESSION_ID_FROM_COOKIE perl -d SCRIPT_TO_DEBUG`
Anyway, here's the script:
#!/bin/bash
# Environment variables to set before running Koha scripts or pages
# from the command line
export KOHA_CONF=/usr/local/koha3.2/etc/koha-conf.xml
export PERL5LIB=/usr/local/koha3.2/lib
# those two, of course, and
export HTTP_COOKIE="CGISESSID=$1"
export REMOTE_ADDR=205.126.61.239
#export REMOTE_ADDR=127.0.0.1
# These make it look like I'm coming from my laptop
# after I've logged into Koha from my laptop
# Just have to check the CGISESSID cookie on my laptop, and pass it to this
# Next, run the script
shift # Drop session id
exec $*