starfire4444 has asked for the wisdom of the Perl Monks concerning the following question:
actually works.. and appends output of get_value2 sub to the but$hash = { key => ' value1 '.get_value2()}
prints$hash = {key => ' value1 '.\&get_value2()}
key value1 SCALAR(0x604de8)
in first case, when exactly perl runs subroutine? does it runs get_vlaue2() every time we try to access $hash->{key}?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: subroutine / dot operator / hash vlaue
by kcott (Archbishop) on Dec 10, 2015 at 07:19 UTC | |
|
Re: subroutine / dot operator / hash vlaue
by tangent (Parson) on Dec 10, 2015 at 02:44 UTC | |
by Anonymous Monk on Dec 10, 2015 at 03:21 UTC | |
|
Re: subroutine / dot operator / hash vlaue ( backslash amperstand operator \& )
by Anonymous Monk on Dec 10, 2015 at 01:42 UTC | |
|
Re: subroutine / dot operator / hash vlaue
by dsheroh (Monsignor) on Dec 10, 2015 at 07:57 UTC | |
|
Re: subroutine / dot operator / hash vlaue
by stevieb (Canon) on Dec 10, 2015 at 01:55 UTC | |
by kcott (Archbishop) on Dec 10, 2015 at 08:25 UTC |