Yes. If you have installed the PerlScript engine, then you can run SecureCRT scripts written in Perl. You can download and find information regarding Perlscript from:
www.activestate.com
When using Perlscript, there are a couple of issues you should be
aware of that will make debugging your scripts easier:
By default, runtime errors in your Perlscript won't be reported
unless you enable warnings about these errors. Be sure you include
these lines in your script if you want to be informed of errors:
# Perl doesn't warn about errors by default.
Enable errors.
use Win32::OLE;
Win32::OLE->Option(Warn => 3);
Another problem you may find with Perlscript is that runtime errors
that occur within the "main" routine invoked by SecureCRT aren't reported
back to SecureCRT in an informative manner. This is believed to be a bug
that was present in the latest implementation of Perlscript (build
518). The following simple script demonstrates the problem:
# $language = "PerlScript"
# $interface = "1.0"
# Perl doesn't warn about errors by default.
Enable errors.
use Win32::OLE;
Win32::OLE->Option(Warn => 3);
# display the version
$crt->Dialog->MessageBox($crt->{'Version'});
# 1. generate an error: invalid property $crt->Dialog->MessageBox($crt->{'XYZZY'});
sub main {
# display the version
$crt->Dialog->MessageBox($crt->{'Version'});
# 2. generate an error: invalid property
$crt->Dialog->MessageBox($crt->{'XYZZY'});
}
This script gets a runtime error when it tries to fetch an invalid
property both at the global level and within the "main" routine.
The first runtime error should display some verbose information
indicating the line and the nature of the problem, however the second
runtime error will simply be reported as "main failed..." with no
indication why. SecureCRT will invoke your main subroutine if it exists,
but you are not required to have one. In order to work around this
problem, you may want to develop your Perlscript code outside of
a main subroutine.