karthikasasanka has asked for the wisdom of the Perl Monks concerning the following question:
While I was working with delete function. I got a doubt that, how delete function is able to identify the difference between normal scalar and array scalar.
eg.
delete $arr[0]; #it works delete $scalar; #it throws error delete $hash{$key}; #it works
I want to know whether we can write subroutines which can detect the scalar and array element and how? if any one has an idea on this, please let me know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: argument to delete function
by moritz (Cardinal) on Jun 15, 2010 at 13:30 UTC | |
by ssandv (Hermit) on Jun 15, 2010 at 18:32 UTC | |
|
Re: argument to delete function
by ikegami (Patriarch) on Jun 15, 2010 at 16:26 UTC | |
|
Re: argument to delete function
by almut (Canon) on Jun 15, 2010 at 13:38 UTC | |
|
Re: argument to delete function
by jwkrahn (Abbot) on Jun 15, 2010 at 18:53 UTC | |
|
Re: argument to delete function
by Anonymous Monk on Jun 15, 2010 at 13:39 UTC |