in reply to Problems with Data::Dumper

How about

perl -MData::Dumper -e " $a = 1; print Data::Dumper->Dump( [$a], [qw(* +a)] ) " $a = 1;

instead of

perl -MData::Dumper -e " $a = 1; print Data::Dumper->Dump( [$a], [*a] +) " $VAR1 = 1;

Replies are listed 'Best First'.
Re: Re: Problems with Data::Dumper
by Anonymous Monk on Sep 28, 2003 at 03:28 UTC
    Thanks...

    So, the "qw(" and ")" makes a difference? Why would it work on most systems without the ()s but not on that one system?

Re: Re: Problems with Data::Dumper
by Anonymous Monk on Sep 29, 2003 at 22:24 UTC
    Thank you very much!

    I just modified my Data::Dumper line and it worked with the qw(*hash_name) inside the square brackets.

    I'm still curious, however... why does it work on some systems without the qw( ) and not on others. What exactly does the use of parens do at that point in the code?

    Thanks again!

    Peter

      Perl was "fixed" between 5.005_03 and 5.6.1, such that it better understands references.

      If you run this program under 5.005_03, it (wrongly) understands *a as a string. Under 5.6.1 or later, you have to say "*a" to get a string.

        Dear Flávio, Thank you! You were extremely helpful. Obrigado, Peter