Emptying array inside loop while using push in PERL -
I am writing a subtitle that prints an array of non-redundant elements from another array.
This code is inside my suburban area. Then I call my work in a loop inside my main program, it is fine to run first and in my new table there is an event of my old table but its The latter keeps I tried to clear But then my What is the problem with this and how can I fix it? Due to incorrect scrolling, you saw It can be simplified to see my% You can also use You are using @new_table elements from previous iteration and the print result is false.
@new_table inside my suburban area like this
@new_table = (); Foreign currency (@old_table) {push (@ new_betable, $ _) unless that ($ $ {$ $} $ $ $ has been seen); } Print "@NewTable" "\ N";
@new_table becomes empty in all iterations except the first one.
@new_table and
% Make these loops before the past.
my @new_table; My% looked; Foreign currency (@old_table) {push (@ new_betable, $ _) unless that ($ $ {$ $} $ $ $ has been seen); } Print "@ new_table" "\ N";
; My @new_table = grep {! $ Saw {$ _} ++} @old_table; Print "@New_Betables \ n";
Usage list :: MoreUtils qw (uniq); My @new_table = uniq (@old_table); Print "@New_Betables \ n";
strict; use caution; , right? If not, you should be. always.
Comments
Post a Comment