01-06-2011
calling perl subroutine from perl expect module
All,
Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program.
Thanks,
Arun V
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Problem: I have a shell script that will be called by a Perl module that will connect to a db and delete rows. The Perl module will be called by CRON. I am using a Perl module to call a shell script because I need to get the db connection from Perl.
Here is the Perl pseudocode:
... (4 Replies)
Discussion started by: mh53j_fe
4 Replies
2. Shell Programming and Scripting
I want to replace a Perl module name in all my Perl Scripts in the cgi-bin directory. How is it possible?
I have the following statement in my scripts
use myUtil;
I want to change it to
use myUtil777;
Regards,
Rahul (2 Replies)
Discussion started by: rahulrathod
2 Replies
3. Shell Programming and Scripting
I call a EXPECT script from my perl script with machine IP and a FIle. The script logins to the machine and exports the value. The values to be exported or stored in a file.
I have close to 10 machines and I have created 10 files and pass the corresponding files in command line, Now I could like... (4 Replies)
Discussion started by: ramkriz
4 Replies
4. Shell Programming and Scripting
Hi,
I can't get this script ot work and I wa wondering if anyone could help?
I need to open a file and use a subroutine to search each line for a regular expression. If it matches then I need to return a match from the subroutine and print the result?
Any help would be greatly... (11 Replies)
Discussion started by: jmd2004
11 Replies
5. Shell Programming and Scripting
Hi All,
I have a doubt whether expect module in perl will work in SQL prompt or its applicable only for shell prompt ?
Thanks,
Arun V (2 Replies)
Discussion started by: arun_maffy
2 Replies
6. Shell Programming and Scripting
The following subroutine prints 1 instead of the content of the Equipment variable. Can someone tell me why?
#!c:/perl/bin/perl.exe
#
use strict 'vars';
my $Equipments = "data/equips.txt";
unless (open(EQUIP_FH, "$Equipments")) {
print "errors: $Equipments\n"; # This line prints... (1 Reply)
Discussion started by: tqlam
1 Replies
7. Shell Programming and Scripting
Hi,
ive a perl script, where it has a subroutine clear() in it, and i've one shell script which runs in background, from that shell script i wanted to call subroutine which is in perl script, that's perl script is not module, just simple script.
Eg:
perl script <test>
#!... (4 Replies)
Discussion started by: asarunkumar
4 Replies
8. Programming
Hi everyone,
I have given up finally trying to find a way to do this.
I have a subroutine called LoginFirst where I am starting a new SSH session.
I have bunch of subroutines, each one of them uses a (or I have to create
a new SSH constructor everytime) ssh connection to get some value so ... (2 Replies)
Discussion started by: dummy_code
2 Replies
9. Shell Programming and Scripting
Hello All,
I am in the process of learning perl.I have a perl script and based on the arguments passed it would the appropriate subroutine that is defined in the script.
Now, I need to check a value that is defined in the Environment variables and should call the subroutine only if the... (1 Reply)
Discussion started by: filter
1 Replies
10. Shell Programming and Scripting
Hi,
I am an occasional PERL user. I am trying to call a sub routine (passing parameters) in perl module from a driver .pl file. I have been "tinkering" for a while now and have confused myself.
Could someone please look at the code below and spot where I am going wrong.
testPerl.pl
... (0 Replies)
Discussion started by: chris01010
0 Replies
LEARN ABOUT DEBIAN
jifty::manual::logging
Jifty::Manual::Logging(3pm) User Contributed Perl Documentation Jifty::Manual::Logging(3pm)
NAME
Jifty::Manual::Logging - Using and controlling Jifty's logging system
Intro
Jifty uses the Log4perl module for logging messages, so you can define your own log4perl config for logging.
You can define different behaviour for different log levels. For example, you can send mail to administrator when error occurred, or add
color to warning messages that are logged to the terminal.
Config from config.yml
Various log level config can be set from etc/config.yml or etc/site_config.yml.
Example
# vim:filetype=conf:et:
log4perl.rootLogger = INFO , Screen
log4perl.logger.MyApp.MailNotifier = WARN, Mailer
log4perl.appender.LOG1 = Log::Log4perl::Appender::File
log4perl.appender.LOG1.filename = apache_fastcgi/logs/
log4perl.appender.LOG1.mode = append
log4perl.appender.LOG1.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.LOG1.layout.ConversionPattern = %d %p %m %n
log4perl.appender.Mailer = Log::Dispatch::Email::MailSend
log4perl.appender.Mailer.to = admin@blah.com
log4perl.appender.Mailer.subject = !!ERROR!!
log4perl.appender.Mailer.layout = SimpleLayout
log4perl.filter.Filter1 = sub { /Plugin/ }
log4perl.filter.FilterRule = Log::Log4perl::Filter::Boolean
log4perl.filter.FilterRule.logic = Filter1
log4perl.appender.LOG1.Filter = FilterRule
log4perl.appender.ScreenColor = Log::Log4perl::Appender::ScreenColoredLevels
log4perl.appender.ScreenColor.layout = SimpleLayout
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.layout = SimpleLayout
perl v5.14.2 2010-12-08 Jifty::Manual::Logging(3pm)