perl - How to understand the output of Data::Dumper? -


#!/usr/bin/perl use data::dumper; use tk; use strict; use warnings; $name='test'; $s_ref=\$name; bless $s_ref, 'tk'; print dumper \$s_ref; 

the output info is:

$var1 = \bless( do{\(my $o = 'test')}, 'tk' ); 

how understand info? output?

data::dumper needs reference string without creating new variable in current scope, presumably how it. working middle outwards have my $o = 'test' declares $o, sets it's value 'test' , returns $o. do{} block in case provides scope my binding exist in, when block exits $o ceases exist value references continues to, \ @ start of block takes reference it's returned value. reference string 'test' blessed 'tk'.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -