Why these two variables `${ “_<$filename” }` and `${ “::_<$filename” }` not equal?

后端 未结 1 1183
星月不相逢
星月不相逢 2021-01-24 11:18

This question is related to this one.

You say that these two are same:

${ \"::_<$filename\" }                       # Not allowed under strict.
${ \"_         


        
1条回答
  •  有刺的猬
    2021-01-24 12:03

    Thanks to @HåkonHægland. I missed that :: mean main package.

    I was messed up by:

    the following are equivalent:

    ${ "::_<$filename" }                       # Not allowed under strict.
    ${ "_<$filename" }     # In main package   # Not allowed under strict.
    

    Now I understand that means

    ${ "::_<$filename" }   # This refers to a var in main package
    ${ "_<$filename" }     # This refers to a var in CURRENT! package
    

    0 讨论(0)
提交回复
热议问题