surag has asked for the wisdom of the Perl Monks concerning the following question:
I have a variable $param = '196', 'berg',NULL,NULL;
I want to split this and also remove the single qoutes around the number and also make the NULL value undef. So I wrote this split and map functions together
I am getting a value of 1 in @list_of_params. Can any of the monks help me out.my @list_of_params = map { s/^\'(.*?)\'$/$1/m } map { $_ eq 'NULL' ? undef : $_ } split(/\s*\,\s*/,$params);
Thanks
Code tags and general htmlification- dvergin 2003-09-10
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: map not returning
by BrowserUk (Patriarch) on Sep 11, 2003 at 02:02 UTC | |
by ctilmes (Vicar) on Sep 11, 2003 at 11:18 UTC | |
|
Re: map not returning
by davido (Cardinal) on Sep 11, 2003 at 00:29 UTC | |
by BrowserUk (Patriarch) on Sep 11, 2003 at 02:03 UTC | |
|
Re: map not returning
by Anonymous Monk on Sep 11, 2003 at 00:34 UTC | |
by davido (Cardinal) on Sep 11, 2003 at 00:42 UTC | |
by surag (Novice) on Sep 11, 2003 at 01:37 UTC |