in reply to What's the Right Way to declare constants in packages?
But we can in fact place sub output in strings:
sub pi { 'apple 3.1415936535897532'; } my $str = "I like breadnbutter. I like toasted ham. I like @{[pi]}"; print $str, $/;
I like bread and butter. I like toast and jam. I like pi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: You can do string interpolation on sub output
by Adam (Vicar) on Oct 27, 2000 at 22:34 UTC | |
|
RE: You can do string interpolation on sub output
by Fastolfe (Vicar) on Oct 27, 2000 at 22:34 UTC | |
|
RE: You can do string interpolation on sub output
by myocom (Deacon) on Oct 27, 2000 at 22:29 UTC | |
by Adam (Vicar) on Oct 28, 2000 at 00:03 UTC |