O wise ones,

I have 2 questions, a specific question about Text::xSV and a more general question about testing.

I think I may have discovered a minor bug in xSV, as shown in the script below. My first question is, is this indeed a bug or did I misunderstand the documentation.

But more importantly, I want to add testing to my coding process. How could this type of "failure" of object creation, if that's what it is, be rewritten with testing... so that I could report it the right way... and eventually begin testing sexier things, like PUGS :)

A specific question I have about testing is, should I not use the strictures with testing, because that would cause the test script not to compile before failing?

use warnings; use strict; use Text::xSV; #documentation in http://search.cpan.org/~tilly/Text-xS +V-0.14/lib/Text/xSV.pm #filename set in new(). works. my $csv1 = Text::xSV->new( filename => "filename.txt", header => ["partner", "kampagne", "keywordCluster", "keyword", "clicks", "leads", "orders", "jaronVerguetung", "partnerVerguetung", "profit"], ); $csv1->set_sep(';'); #filename set in set_filename. Doesn't work. #error is "global symbol... requires explicit package name. Fails on +set_filename. But not on set_sep. Weird. my $csv2 = Text::xSV->new( header => ["partner", "kampagne", "keywordCluster", "keyword", "clicks", "leads", "orders", "jaronVerguetung", "partnerVerguetung", "profit"], ); $csv2->set_sep(';'); $cvs2->set_filename("popularixCombined.csv");
I am reading the documentation for Test::Simple, Test::More, and the testing tutorial included with the core install of perl. If there's anything else worth taking a look at, or thinking about, would appreciate insight from those with more experience than me.

UPDATE: Deleted filename => "filename.txt", from creation of second object; didn't mean to have this. Still get the error though. Thanks Corion.

UPDATE 2: Rewrote this using Test::Simple, see below.

UPDATEe 3: This was a variable name typo issue. Well, at least I got started learning the testing stuff... gulp..... /me slinks off.....


In reply to xSV question, and general testing question. by tphyahoo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.