in reply to Getopt::Declare's demo_csv

I downloaded Getopt::Declare and ran the script. Here is what I get:
c:> perl demo_csv UNIVERSAL->import is deprecated and will be removed in a future perl a +t C:/Perl5-12-2/site/lib/Getopt/Declare.pm line 5 Unknown entry format: [absmith,1234567,20] Unknown entry format: ["aesmith, the other one",7635656,DNS] Unknown entry format: [cat,dog,22.2] Unknown entry format: [7637843,dejones,66.7] Unknown entry format: [rmwilliams,288721,88] Unknown entry format: [help me,I'm trapped,in the marks system] Unknown entry format: [vtthan,872829,94] c:> perl -v This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x +86-multi-thread
It is not clear to me what the script should do, but that output looks bad. I recommend that you reduce the code to the minimal amount and explain what you think it should do. I have no experience with the module, and the POD is quite long. Update: see also the module review.

Replies are listed 'Best First'.
Re^2: Getopt::Declare's demo_csv
by sg (Pilgrim) on Feb 05, 2011 at 18:15 UTC

    1) In demo.csv, modify the assignment to $data (by adding spaces around certain ',') to end up with:

    $data = q{ absmith , 1234567 , 20 "aesmith, the other one" ,7635656 , DNS cat , dog , 22.2 7637843 , dejones , 66.7 rmwilliams , 288721 , 88 help me,I'm trapped,in the marks system vtthan , 872829 , 94 };

    One then gets the output intended by the author of demo.csv (I am not he)

    Unknown entry format: [cat , dog , 22.2] Unknown entry format: [help me,I'm trapped,in the marks system] 1234567 (absmith): 20 7637843 (dejones): 66.7 288721 (rmwilliams): 88 872829 (vtthan): 94 7635656 ("aesmith, the other one"): ABSENT

    But according to the documentation of Getopt::Declare, the lack of spaces around the ',' shouldn't matter and original demo.csv should also give the above output.

      If you are convinced the module does behave as specified, you can file a bug report.

      Make sure you are using the latest version: Getopt-Declare-1.13

      If you're feeling ambitious, look at the source code to see if you can find where the problem is. You will increase the chances of the module being fixed if you can provide a patch.