in reply to Using Subroutine Returns
So, you're trying to interpolate the return value of a subroutine into a string? That would be:
print "@{[config('username')]} is my username";
(i.e., you fill an anonymous array with one value, and then dereference it with @{} — which works because arrays are interpolated)
Similarly, you could also do (using a scalar ref)
print "${\config('username')} is my username";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Subroutine Returns
by ELISHEVA (Prior) on Apr 23, 2009 at 03:47 UTC | |
by ig (Vicar) on Apr 23, 2009 at 05:10 UTC | |
|
Re^2: Using Subroutine Returns
by perrin (Chancellor) on Apr 23, 2009 at 03:35 UTC | |
by almut (Canon) on Apr 23, 2009 at 09:53 UTC | |
by doug (Pilgrim) on Apr 23, 2009 at 17:30 UTC | |
|
Re^2: Using Subroutine Returns
by rlang (Novice) on Apr 23, 2009 at 00:23 UTC |