[Israel.pm] take out from array

Levenglick Dov-RM07994 dov at freescale.com
Tue Oct 16 09:17:05 PDT 2007


@arr = grep {<COND>) @arr;

 
Best Regards,
Dov Levenglick
SmartDSP OS Development Leader,
DevTech, Technology and System Organization
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[ ] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[x] Personal Memorandum

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Ernst, Yehuda
Sent: Tuesday, October 16, 2007 18:06
To: Perl in Israel
Subject: Re: [Israel.pm] take out from array

does perl have a function for indexing array.

i do not need the item i am taking out.

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il]On
Behalf Of Gaal Yahas
Sent: Tuesday, October 16, 2007 6:02 PM
To: Perl in Israel
Subject: Re: [Israel.pm] take out from array


Oh: if the bad element may be repeated, and you don't mind making a
copy of the list:

@filtered = grep { $bad_value != $_ } @old;

(Or 'ne', if your values aren't necessarily numbers).

If you know there's only one, or if you don't want to make copies,
find its index with an iteration and then splice.

On 10/16/07, Ernst, Yehuda <yernst at nds.com> wrote:
> i do not know the place of the item
>
>
> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il]On
> Behalf Of Levenglick Dov-RM07994
> Sent: Tuesday, October 16, 2007 5:51 PM
> To: Perl in Israel
> Subject: Re: [Israel.pm] take out from array
>
>
> splice
>
>
> Best Regards,
> Dov Levenglick
> SmartDSP OS Development Leader,
> DevTech, Technology and System Organization
> Freescale Semiconductor Israel
> Tel. +972-9-952-2804
> The information contained in this email is classified as:
> [ ] Freescale General Business Information
> [ ] Freescale Internal Use Only
> [ ] Freescale Confidential Proprietary
> [x] Personal Memorandum
> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Ernst, Yehuda
> Sent: Tuesday, October 16, 2007 17:50
> To: Perl in Israel
> Subject: [Israel.pm] take out from array
>
> Hello!
>
> I know that push puts item into array
>
> i want to take item from array during  runtime of the program
>
> if i have
> @a = (1,2,3,4);
>
> i want to take put the 3 so i will have
> @a=(1,2,4);
>
> how do i do it?
>
> Thanks
>
> Yehuda Ernst                        יהודה ארנסט
> NDS Technologies Israel Ltd. mailto:yernst at nds.com>
> Jerusalem          Tel:  +972 (2) 589-4427
> PO Box 23012    Fax: +972 (2) 589-4825
> Israel.    91235    Cell  +972 54 5664427
>
> *********************************************************************************************************
> This e-mail is confidential, the property of NDS Ltd and intended for the addressee only.  Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited.  If you have received this message in error, please immediately notify the postmaster at nds.com and destroy the original message.  Messages sent to and from NDS may be monitored.  NDS cannot guarantee any message delivery method is secure or error-free.  Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.  We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission.  You should carry out your own virus checks before opening any attachment.  Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS.
>
> NDS Limited Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom. A company registered in England and Wales  Registered no. 3080780   VAT no. GB 603 8808 40-00
>
> To protect the environment please do not print this e-mail unless necessary.
> **********************************************************************************************************
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> *********************************************************************************************************
> This e-mail is confidential, the property of NDS Ltd and intended for the addressee only.  Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited.  If you have received this message in error, please immediately notify the postmaster at nds.com and destroy the original message.  Messages sent to and from NDS may be monitored.  NDS cannot guarantee any message delivery method is secure or error-free.  Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.  We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission.  You should carry out your own virus checks before opening any attachment.  Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS.
>
> NDS Limited Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom. A company registered in England and Wales  Registered no. 3080780   VAT no. GB 603 8808 40-00
>
> To protect the environment please do not print this e-mail unless necessary.
> **********************************************************************************************************
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>


-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl
*********************************************************************************************************
This e-mail is confidential, the property of NDS Ltd and intended for the addressee only.  Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited.  If you have received this message in error, please immediately notify the postmaster at nds.com and destroy the original message.  Messages sent to and from NDS may be monitored.  NDS cannot guarantee any message delivery method is secure or error-free.  Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.  We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission.  You should carry out your own virus checks before opening any attachment.  Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS.

NDS Limited Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom. A company registered in England and Wales  Registered no. 3080780   VAT no. GB 603 8808 40-00

To protect the environment please do not print this e-mail unless necessary.
**********************************************************************************************************

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl



More information about the Perl mailing list