$var = "foo @{[ sub() ]} baz"; # Note: This calls the sub in list context, so may have a # different effect than if called in scalar context. Use # ${ \sub() } for scalar context.