10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
push @MACARRAY, "$+{catalog} $+{machine}\n" if ($info =~ /(?<catalog>catalog).+?(?<machine>\*+)/ms);
I am (still) trying to solve problem. Looking around on the server I found this piece of code. Specifically what does "$+{catalog} $+{machine}\n"
do ?
Thanks in advance (1 Reply)
Discussion started by: popeye
1 Replies
2. Shell Programming and Scripting
can someone help me how to interpret this line?
my ($class, $hashref) = @_;
my $portfolio = {};
if ($hashref->{portfolio_id}) {
($portfolio) = GEmySQL->get ("select * from portfolio where portfolio.id=$hashref->{portfolio_id}");
}
===============
Question: how do... (2 Replies)
Discussion started by: onlinelearner02
2 Replies
3. Shell Programming and Scripting
I'm just having a bit of trouble running this code. It tells me that there's a syntax error on line 29. Any help appreciated.
#!/usr/bin/perl
#
# Phone Book Application
#
%phonebook = (
"Wayne", '34687368',
"Home", '378643287',
"Work", '017374637',
"School",... (2 Replies)
Discussion started by: cabaiste
2 Replies
4. Shell Programming and Scripting
#!/usr/bin/perl
$output1 = "/home/log.txt"
$output2 = "/home/grep.txt"
#Statement1 creates an output file called log.txt.
#Statement2 greps a line from log.txt and store the result in grep.txt
I want to create a condition where if the file grep.txt is empty repeat process.
Thanks. (1 Reply)
Discussion started by: sureshcisco
1 Replies
5. Shell Programming and Scripting
Hello all,
I'm trying to automate an if statement in my Perl script. The script opens an input file for reading, checks each line in the file for a particular substring, and if it finds the substring, writes it to an output file.
There are approximately 200 different input files. Each has... (3 Replies)
Discussion started by: Galt
3 Replies
6. Shell Programming and Scripting
Sorry for the newbie question
I need to create a perl script to check the modifed time of a file I already have that part created but need help in creating a if statement that basicly will check to see if the modifed time is at least 2hrs older then the current time if the stament is true to... (2 Replies)
Discussion started by: nettech207
2 Replies
7. Shell Programming and Scripting
Hello and thank you in advance.
I have a perl script that will basically copy files out of a directory , creat a new current date stamped dir and move them that current time stamped dir and append the file names with current time stamp.
I need to add line(s) that this is only run if FileX... (1 Reply)
Discussion started by: Dadwith2boys
1 Replies
8. Shell Programming and Scripting
Hello:
I have the following perl script which is giving me trouble inside the second elsif statement. The purpose of the script is to go through a file and print out only those lines which contain pertinent information. The tricky part came when I realized that certain items actually spanned... (5 Replies)
Discussion started by: erichpowell
5 Replies
9. Shell Programming and Scripting
if (($fields eq $hwp) && ($fields eq 'Y'))
{
$fields = "INTEGRAL";
}
elsif ($fields eq $hwp)
{
$fields = "INTEGRAL";
}
elsif ($fields ne $hwp)
{
$fields = "SEPARATE";
}
print "$fields $fields $fields\n";
Output:
The problem here is that the first... (2 Replies)
Discussion started by: kamitsin
2 Replies
10. Shell Programming and Scripting
Hello guys,
I was wondering why my code doesn't read a variable when using if statement as follows:
$userlist='users.txt';
$user='b999';
open (ACTULOG, ">>$userlist");
print ACTULOG "$user\n";
close (ACTULOG)
this will work and prints... (3 Replies)
Discussion started by: Bashar
3 Replies