I don't understand this. I have a text file I am trying to do a substitution for that is not working:
#!/usr/bin/perl
my $out_file = "/etc/default/ovpa";
open (OUT, "$out_file") or die ("Error opening ovpa file $1");
while(<OUT>) {
chomp;
s/MWA_PROTOCOL/IT WORKED/g;
}
Here is the file...
Hello all,
I have a program that basically does an FTP get of a file from a server, deletes some stuff from the file and then does an FTP put to another server.
My script is working correctly but I would like to be able to print the FTP debug output to a logfile. Here is one of the FTP...
Hello all,
I have a script that uses the Net::FTP module to do some gets and puts. The gets are working fine but the puts are hanging. Here is the debug output:
FTP Debug output:
Net::FTP=GLOB(0x403fdb54)<<< 220 Microsoft FTP Service
Net::FTP=GLOB(0x403fdb54)>>> user massmutual\weblog...
Your right ishnid. I had it right the first time. The way I read it:
next unless EWSRDBUD contains EW; #correct
next unless EW contains EWSRDBUD; # does not work
Thanks for all the help all! The trailing spaces were the problem:
use strict;
open (PREFIX...
BTW, here is the relevant portion of the PREFIX file:
DSP
E00
E81
EAD
EBI
EBU
ECA
ECB
ECE
ECL
ECR
ECS
ED
EF
EIS
ELC
ELS
EPA
ET
ETA
ETB
ETC
ETD
ETE
ETJ
ETO
ETS
ETW
EW
FCA
If at first you don't...
Hello all,
Below is a snippet of code I am working on.
use strict;
open (PREFIX, "/home/mt71124/scripts/tws_prefix.txt") or die ("Error opening prefix file: $?");
my ($cpu, $sched_name, $job_name ) = @ARGV;
my $count = scalar(@ARGV);
chomp ($cpu,$sched_name,$job_name);
my $prefix;
print...
Hello all,
I am trying to get a script to work that I did not write. It looks like it should be working:
#________________________________________________________________________
# Program: CPU3_check
#
# This script checks the CPU utilization of a system against
# a predetermined threshold...
Your right Kevin. Interesting I haven't done any perl in a year or so and I look at some of the scripts I wrote when I was doing some serious programming and I wonder how the hell I wrote those complicated 1000 line scripts and I relaize I didn't write them, you experts did one sub routine at a...
Thanks ishnid that did it. Final code below:
use strict;
use warnings;
my $prefix = shift @ARGV;
my $cpu = shift @ARGV;
my $sched_name = shift @ARGV;
my $job_name = shift @ARGV;
chomp ($prefix,$cpu,$sched_name,$job_name);
open (CFG, "/home/mt71124/scripts/maestro_inst.txt") or die ("Error...
Thanks ishnid. Your reply got me a little farther. After mucking with the code for a while I have it to the point where it reads the first line at least. Here is the new code:
use strict;
use warnings;
my $prefix = shift @ARGV;
my $cpu = shift @ARGV;
my $sched_name = shift @ARGV;
my...
Thanks for the reply spookie but after changing the line to your code it prints nothing, not even the "These"
If at first you don't succeed, don't try skydiving.
Hello all,
I have a script I am working on that looks to me like it should be working but it does not. It takes 4 variables from the command line, opens up a config file and compares the command line args against the config file:
use strict;
use warnings;
my $prefix = shift @ARGV;
my $cpu...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.