A module that is very useful to debug

xiaoxiao2021-03-06  27

A module that is very useful to debug, it improves the functionality of Dumper.

Take a look at the code below.

Use Data :: Dumper;

MY $ S = "scalar";

My @a = ("red", ["green", {Yellow => "Blue"}]);

MY% h = (name => "wti", lovecolor => "blue");

Print stderr Dumper ($ S, /% H, / @ a);

Print stderr Dumper ($ S,% h, @A);

# ------------------------------------------------- -----

# The Output Are:

#

# $ Var1 = 'scalar';

# $ Var2 = {

# 'name' => 'wti',

# 'LoveColor' => 'Blue'

#}

# $ Var3 = [

# 'red',

# [

# 'Green',

# {

# 'YELLOW' => 'Blue'

#}

#]

#];

# $ Var1 = 'scalar';

# $ Var2 = 'name';

# $ Var3 = 'wti';

# $ Var4 = 'lovecolor';

# $ Var5 = 'blue';

# $ Var6 = 'red';

# $ Var7 = [

# 'Green',

# {

# 'YELLOW' => 'Blue'

#}

#];

# ------------------------------------------------- -----

Use Data :: Dumper :: Simple;

Print stderr Dumper ($ S, /% H, / @ a);

# ------------------------------------------------- -----

# The Output Are:

#

# $ s = 'scalar';

# $ h = {

# 'name' => 'wti',

# 'LoveColor' => 'Blue'

#}

# $ a = [

# 'red',

# [

# 'Green',

# {

# 'YELLOW' => 'Blue'

#}

#]

#];

# ------------------------------------------------- ----- Print stderr Dumper ($ S,% h, @A);

# ------------------------------------------------- -----

# Outputs Are Same As Dumper ($ S, /% H, / @ a)

# ------------------------------------------------- -----

转载请注明原文地址:https://www.9cbs.com/read-65405.html

New Post(0)