Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: nfaber
  • Content: Threads
  • Order by date
  1. nfaber

    Am I referencing de-referencing properly?

    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 =...
  2. nfaber

    Default to ")" if undefined

    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...
  3. nfaber

    When to use eq and ==

    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?
  4. nfaber

    Logic Problem

    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 (/,/)...
  5. nfaber

    Generating a chart

    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...
  6. nfaber

    Excellent free editor...Jedit

    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...
  7. nfaber

    tabs spaces and \n in an array

    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 #...
  8. nfaber

    Need to find One match then jump to outside loop

    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...
  9. nfaber

    Loop in loop problem

    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)...
  10. nfaber

    problem with push

    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...
  11. nfaber

    Counting variables while building a hash

    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...
  12. nfaber

    Best idea for output processing

    Hello All, I need to generate an output file with this basic format: ticket table: location, priority, devType, startBacklog, opened, closed, endBacklog, total, changes, imBacklog, power, telco Tier 1, critical, router, 0, 1, 1, 0, 1, 0, 0, 0, 1 Tier 2, critical, router, 0, 22, 21, 1...
  13. nfaber

    Loop variable problem

    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+/...
  14. nfaber

    Question about the %ENV hash

    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...
  15. nfaber

    concat array slice to variable name

    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...
  16. nfaber

    Getting a hash key based on the value

    Hello all, I know I can get a hash value based on the key as in: my $var = $hash{$key}; but haow can I get a key when I know the value? Thanks, Nick
  17. nfaber

    compare two arrays

    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 =...
  18. nfaber

    Ideas for splitting up a script

    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...
  19. nfaber

    perl &quot;continue&quot; statement?

    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...
  20. nfaber

    Scoping of vars in subroutines

    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()...

Part and Inventory Search

Back
Top