The second thing is to clean up your formatting! This sounds stupid, but how can you expect to have a clean-running program if your workspace (ie, your code) isn't neat and clean. I can barely read your code because there's random whitespace and logic isn't indented consistently. Indented consistently, your subroutine would look something like:
sub gen_asp { my(@cmd) = (); my(@cmd1) = (); my($rs) = (); my($rs2) = (); my($submit) = $sec_homepage; $i = 0; $submit =~ tr |\\|/|; my(@keys) = keys %temp_dcr_hash; foreach $key (@keys){ if ("$temp_dcr_hash{$key}{LaunchDate2}" eq $today) { $home{$key} = $temp_dcr_hash{$key}; } # End of if statement } # End of foreach loop if ("(keys %home)" ne "" ){ foreach $key (@keys){ if("$temp_dcr_hash{$key}{LaunchDate2}" lt $today) { if ($key ne ""){ $cmd[0] = "copy $workarea\\$sec_homepage\\data\\$k +ey $archiv +e\\$sec_homepage\\data\\$key"; $cmd[1] = "del /Q $workarea\\$sec_homepage\\data\\ +$k +ey"; $cmd[2] = "$cmd_path\\iwsubmit -w -u $vpath/$submi +t/ +data/$key \"Content Expired.\""; $cmd[3] = "$cmd_path\\iwsubmit -w -u $vpath_arc/$s +ubmit/ +data/$key \"Submitted to Staging.\""; } # End if statement for ($j=0; $j<4; $j++) { print "$cmd[$j]\n"; $rs = `$cmd[$j]`; print "$rs\n"; } # End for loop to run commands } # End if statement to check if the dcr is expired, archive any # that are and delete them from the site } # End foreach loop @home_sort = sort {$home{$b}{$modtime} <=> $home{$a}{$modtime} +} (keys %home); $outfile = "$workarea\\Index.asp"; $cmd1[0] = "$cmd_path\\iwpt_compile.ipl -pt $t_path\\home\\hom +e\\present +ation\\home.tpl -iw_pt-dcr $t_path\\home\\home\\data\\$home_sort[0] - +ofile $outf +ile"; $cmd1[1] = "$cmd_path\\iwsubmit -w -u $outfile \"ASP Created.\ +""; for my $j (0 .. 2) { print "$cmd1[$j]\n"; $rs2 = `$cmd1[$j]`; print "$rs\n"; } # End for loop to run commands } # End if } #end sub
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!
In reply to Re: Debugging "Use of Unitialized Value" message
by dragonchild
in thread Debugging "Use of Unitialized Value" message
by wstarrs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |