I was reading the adding multiple value to a hash thread and I checked out the perldoc and I was wondering if this code is ok:
my @ticTblCnts = ();
my $tableIndex = 0;
foreach my $loc (@out_locations) {
foreach my $crit(@out_priorities) {
foreach my $ty (@out_types) {
my $combin =...
I've been playing with some code to assign a zero to a variable if undefined but it is not working. This is excerts from a larger program.
my ($changes,$telco,$application,$server,$other) = 0;
foreach $res_anal_code (@res_code) {
if ($res_anal_code =~ /customer/i){$changes++;}
elsif...
Hello all,
How can I tell for sure if the variable I am operating on is a string or an integer?
Can't 01 also be a string "01"??
Thanks
I got a Biz Degree! How the h*ll did I get here?
A while ago I posted a question about a loop in a loop. Here is the basic structure:
foreach (@problem) {
my ($company, $logical_name, $numberprgn, $assignment, $uis_elapsed_start_time, $close_time, $res_anal_code,$user_priority, $severity_code ) = split (/,/)...
Hello all,
I am in the process of writing some code that generates a chart. I can probably figure this out, but I though someone might have some ideas on an easy way to do this and want to poke at some code on a Sunday. The chart needs to look like this:
troubleNumber chart:
devType...
I have been a loyal user of EditPlus for years now, but I was introduced to an even better editor I now swear by called Jedit:
http://www.jedit.org/index.php?page=download
Heres why I like it:
All the features of EditPlus but free
Runs on java so it can be installed on any OS
Has many...
I have the following subroutine I am building:
sub TicketTable
{ # Start of Ticket Table generation subroutine
##########################################################################################
#
# Read passed array references, de-reference them and scope subroutine variables
#...
Hello all,
I have two lists from DB queries with one common variable for comparison for a match. What I want to do is loop through each entry in the first list @problem and check for a match in the second list @device and if a match is not found, assign default values to the @device variables...
Can anyone see aproblem with my basic logic in this code?
foreach $prob (@problem) { # Start Problem Table loop
chomp $prob;
my ($company, $logical_name, $numberprgn, $assignment, $uis_elapsed_start_time, $close_time, $res_anal_code,
$user_priority, $severity_code ) = split (/,/, $prob)...
Hello all,
can someone tell me what is wrong with this push?
push (@data,$assignment, $res_anal_code, $user_priority, $severity_code, $type, $uis_support_level, $uis_tier, $uis_fstatus, $uis_managed_date, $uis_deactivated_date);
I know the scalars have values, but nothing is pushed...
Hello all,
This thread relates to a thread I started a week or so ago about outputing to a file that KevinADC helped me with. The thread seems to have been deleted, so I will give the details. I have the results of two DB queries in arrays. What I want to do is loop through them, combine...
Hello all,
I have the following code:
foreach $key(@keys) { #Start main loop
while (<COMP>) {
chomp;
next unless (/$key/);
($junk_key, $company, $exceptions) = split (/,\s*/);
print "key is:$key\tcompany is:$company\texception are:$exceptions\n";
@exceptions = split /\s+/...
Morning all,
I have a question about using the %ENV hash. I have a script I wrote that runs as a cron job. While the script runs fine from the command line, it does not as a cron because it does not have all the correct shell ENV variables, in this case $ORACLE_HOME and $ORACLE_SID. What I...
This question piggy backs on my "getting a hash key based on value" thread.
Now that I have my proper month numbers and text in arrays (Thanks PaulTEG [medal]), I want to somehow concatinate the array slices to a variable name so I can increment it (count instances of it) later in my program...
Hello all,
I need some code to find the difference between two arrays and put the diff in another array. I did a search on this forum and found some code from raklet and modified it. Here is my code. The output shows that @clockonly exists, but there seems to be nothing in it:
my %seen =...
Hello all,
I have a program I wrote that performs multiple database queries for a list of about 30 companies I get from opening a file. My problem is that the program takes over an hour to run for each company due to a slow database. In addition, the database is only accesible between 1:00 PM...
Hello again all,
I have this code snippet that does not work:
foreach $rpt_month (@month) {
if ($close_month == $rpt_month) {
$close_cnt++;
continue;
}else{
next;
}
if ($open_month == $rpt_month) {
$open_cnt++;
continue;
}else{
next;
}
what I am trying to do is...
Hello all,
I have a question regrading the best practices for scoping variables in a sub routine. The way I see it there are two ways I can pass variables to and from a sub routine, either by making them global as in:
my ($var1, @arr1, $var2);
# Start main
while (<FILE>) {
NewSub()...
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.