Gossamer Forum
Home : General : Perl Programming :

push new element to array

Quote Reply
push new element to array
HI. Senior

@myNames = ('Moe', 'Shemp', 'skie','blah');
$newdefined = $new;


my question is
if $new is not included in array @myNames, then push (@myNames, $newdefined);
if $new is included in array @myNames then print" $newdefined was registered \n";

i have been considered for ........ next...
while eventually i found $newdefined has been
pushed mutiple times while i only want to adds elements $newdefined to the array one time only
('Moe', 'Shemp', 'skie','blah' , '$new');


any one could light me a bit?

Thanks in advance
Subject Author Views Date
Thread push new element to array courierb 10319 Sep 28, 2007, 12:21 PM
Thread Re: [courierb] push new element to array
tandat 10012 Sep 29, 2007, 12:35 AM
Thread Re: [tandat] push new element to array
Wychwood 10032 Sep 29, 2007, 2:11 AM
Post Re: [Wychwood] push new element to array
courierb 9907 Sep 30, 2007, 6:41 AM
Post Re: [Wychwood] push new element to array
courierb 9933 Sep 30, 2007, 6:51 AM
Post Re: [tandat] push new element to array
courierb 9927 Sep 30, 2007, 6:53 AM
Thread Re: [tandat] push new element to array
courierb 9884 Oct 1, 2007, 1:02 AM
Thread Re: [courierb] push new element to array
tandat 9865 Oct 1, 2007, 5:36 AM
Post Re: [tandat] push new element to array
courierb 9807 Oct 1, 2007, 1:58 PM
Thread Re: [tandat] push new element to array
courierb 9802 Oct 1, 2007, 3:34 PM
Thread Re: [courierb] push new element to array
tandat 9788 Oct 1, 2007, 6:59 PM
Thread Re: [tandat] push new element to array
courierb 9775 Oct 2, 2007, 4:35 AM
Post Re: [courierb] push new element to array
courierb 9708 Oct 3, 2007, 12:09 AM