Inexistence has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
Is there a shorter method of doing the below? ($arrayKey is just a name list)
if(!$myarray[$arrayKey[$i]]) { $myarray[$arrayKey[$i]]=() }Thank-you kindly, *bow*
Update:
1st reply asked what I think this does... *blush*
2nd reply leads me to believe that its redundant usage in Perl, so i'll just start running code and see if it fails without it
Overall, the above method is redundant. I'm use to defining everything before hand, but perl obviously allows me to freely create my arrays
Thank-you very much for the information and the support :) *bow*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: If Not Replace
by ikegami (Patriarch) on Sep 10, 2011 at 15:00 UTC | |
|
Re: If Not Replace
by derby (Abbot) on Sep 10, 2011 at 14:18 UTC | |
by tchrist (Pilgrim) on Sep 10, 2011 at 14:31 UTC | |
by derby (Abbot) on Sep 12, 2011 at 11:46 UTC | |
by tchrist (Pilgrim) on Sep 12, 2011 at 15:13 UTC | |
|
Re: If Not Replace
by Anonymous Monk on Sep 10, 2011 at 14:31 UTC | |
by Inexistence (Acolyte) on Sep 10, 2011 at 14:51 UTC | |
by davido (Cardinal) on Sep 10, 2011 at 16:43 UTC | |
by Inexistence (Acolyte) on Sep 10, 2011 at 18:05 UTC | |
by chromatic (Archbishop) on Sep 10, 2011 at 19:18 UTC | |
| |
by davido (Cardinal) on Sep 10, 2011 at 19:59 UTC | |
|
Re: If Not Replace
by Anonymous Monk on Sep 10, 2011 at 14:07 UTC |