Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Filehandle/array naming

by bliako (Monsignor)
on Nov 20, 2020 at 12:57 UTC ( [id://11123895]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Filehandle/array naming
in thread Filehandle/array naming

A clarification is needed: if $x is a "simple scalar variable", then what is ${fh.$FILE}?

Replies are listed 'Best First'.
Re^4: Filehandle/array naming
by choroba (Cardinal) on Nov 20, 2020 at 13:48 UTC
    A symbolic reference?

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      I was under the impression that in this case brackets around a variable name are just to clarify things and $x was a synonym to ${x}. Is ${x.$y} a special case? https://perldoc.perl.org/perlref#Not-so-symbolic-references calls that a not-so-symbolic reference! Tomorrow I will post a question as I am still confused on the boundaries.

      thanks

        JSAWS seems to be running without strictures (and warnings?) enabled, so the OPed code seems to be using honest-to-goodness symbolic references.

        Win8 Strawberry 5.8.9.5 (32) Fri 11/20/2020 12:19:01 C:\@Work\Perl\monks >perl # strictures and warnings not enabled $n = 99; ${ foo . $n } = 'zot'; print $foo99; ^Z zot
        This is the general case in these circumstances (and one of the motivations for the creation of strict).

        Update: The { } brackets in ${ foo . $n } are required for disambiguation. The statement
            $foo . $n = 'zot';
        produces a very different result.


        Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found