joec_ has asked for the wisdom of the Perl Monks concerning the following question:
foreach $mol (@molecules) {
if ($mol eq "\n"){
splice (@molecules, scalar($mol),1);
}
}
So, i would like to delete any elements in @molecules (array created via split) that contain elements with just new lines in. When i run it, i get Argument "\n" isn't numeric in splice
Any help or advice appreciated
Thanks -- Joe.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting specific array elements
by salva (Canon) on Nov 26, 2008 at 09:47 UTC | |
by Crian (Curate) on Nov 26, 2008 at 10:00 UTC | |
by salva (Canon) on Nov 26, 2008 at 10:47 UTC | |
by JavaFan (Canon) on Nov 26, 2008 at 10:47 UTC | |
by matrixmadhan (Beadle) on Nov 26, 2008 at 15:50 UTC | |
by JavaFan (Canon) on Nov 26, 2008 at 17:05 UTC | |
| |
|
Re: Deleting specific array elements
by moritz (Cardinal) on Nov 26, 2008 at 09:48 UTC | |
|
Re: Deleting specific array elements
by hexcoder (Curate) on Nov 26, 2008 at 10:09 UTC |