Easy way to print Perl array? (with a little formatting)

后端 未结 11 722
猫巷女王i
猫巷女王i 2021-01-30 10:13

Is there an easy way to print out a Perl array with commas in between each element?

Writing a for loop to do it is pretty easy but not quite elegant....

11条回答
  •  长发绾君心
    2021-01-30 10:29

    Also, you may want to try Data::Dumper. Example:

    use Data::Dumper;
    
    # simple procedural interface
    print Dumper($foo, $bar);
    

提交回复
热议问题