in reply to Re^2: I can crash perl
in thread I can crash perl
Please read Program Repair Shop and Red Flags, especially the Use compound data structures part.
A group of (numbered) variables is always the wrong solution. You should use an array of arrays or array of hashes instead.
Instead of the several arrays, you should have one array of hashes and instead of
something likefor($i = 0; $i <= $last_dir; $i++) { ( $deleted_file[$i] , $void , $the_dir[$i] , $first_pointer[$i] , $last_pointer[$i] , $has_subdir[$i] , $has_iden[$i] ) = split (/\"\|/, $tmp_2[$i], 7); #printf ("sort_dirs_debug2: %5d fp: %5d, lp: %5d %s\n", $i +, $first_pointer[$i], $last_pointer[$i], $the_dir[$i]); }
orfor($i = 0; $i <= $last_dir; $i++) { @{$data[i]}(qw(deleted_file void the_dir first_pointer las +t_pointer has_subdir has_iden)) = split (/\"\|/, $tmp_2[$i], 7); #printf ("sort_dirs_debug2: %5d fp: %5d, lp: %5d %s\n", $i +, $first_pointer[$i], $last_pointer[$i], $the_dir[$i]); }
for($i = 0; $i <= $last_dir; $i++) { ($data[i]{deleted_file}, $void, $data[i]{the_dir}, $data[i]{first_po +inter}, $data[i]{last_pointer}, $data[i]{has_subdir}, $data[i]{has_iden}) = split (/\"\|/, $tmp_2[$i], 7); #printf ("sort_dirs_debug2: %5d fp: %5d, lp: %5d %s\n", $i +, $first_pointer[$i], $last_pointer[$i], $the_dir[$i]); }
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
---|