Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Evaluate variable while using

by jo37 (Deacon)
on Oct 21, 2022 at 18:23 UTC ( [id://11147583]=note: print w/replies, xml ) Need Help??


in reply to Evaluate variable while using

Not a serious proposal, but another example of TIMTOWTDI:
You may create an array that holds an alias to $a as the second element and interpolate it into a string.

#!/usr/bin/perl use v5.16; use warnings; my $a = ''; local our @str; sub {*str = \@_}->('Hello', $a); $a = 'Kevin'; say "@str";

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147583]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-16 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found