wstarrs has asked for the wisdom of the Perl Monks concerning the following question:
The issue arises in the command calls at the end, after cmd1[0] is run the error appears (a few times actually) and then the program completes the commands in the loop. Thanks, Billsub 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 $archive\\$sec_homepage\\data\\$key"; $cmd[1] = "del /Q $workarea\\$sec_homepage +\\data\\$key"; $cmd[2] = "$cmd_path\\iwsubmit -w -u $vpat +h/$submit/data/$key \"Content Expired.\""; $cmd[3] = "$cmd_path\\iwsubmit -w -u $vpath_ar +c/$submit/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, arc +hive 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\\presentation\\home.tpl -iw_pt-dcr $t_path\\home\\home\\data\\$home +_sort[0] -ofile $outfile"; $cmd1[1] = "$cmd_path\\iwsubmit -w -u $outfile \"ASP Created.\ +""; for ($j=0; $j<2; $j++) { print "$cmd1[$j]\n"; $rs2 = `$cmd1[$j]`; print "$rs\n"; } # End for loop to run commands } # End if } #end sub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debugging "Use of Unitialized Value" message
by dragonchild (Archbishop) on Aug 27, 2001 at 20:57 UTC | |
|
Re: Debugging "Use of Unitialized Value" message
by guillaume (Pilgrim) on Aug 27, 2001 at 21:00 UTC | |
|
Re: Debugging "Use of Unitialized Value" message
by Jazz (Curate) on Aug 27, 2001 at 21:50 UTC | |
|
Re: Debugging "Use of Unitialized Value" message
by jryan (Vicar) on Aug 27, 2001 at 21:50 UTC | |
by dragonchild (Archbishop) on Aug 27, 2001 at 21:54 UTC |