Sorry, I wasn't thinking that changing the loop would cure the issue. Just noting that I intended to review that bit of code anyway.

However...there doesn't seem to be a problem! I set up this test code to observe the problem highlighted and to be sure I have cured it.

#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use cPanelUserConfig; use Bod::Stripe; use Data::Dumper; use strict; print "Content-type: text/plain\n\n"; my $stripe = Bod::Stripe->new( 'api-secret' => 'sk_test_5xxxxxxxnChHzDo', 'api-public' => 'pk_test_5xxxxxxxxmbegPN', ); if ($stripe->success) { my $res = $stripe->add_product( 'id' => '4E', 'name' => 'Dog food', 'description' => 'Boomer\'s favourite variety', 'qty' => 4, 'price' => 69, ); $stripe->add_product( 'id' => 2, 'name' => 'Dog treats', 'qty' => 2, 'price' => 150, ); $stripe->add_product( 'id' => 8, 'name' => 'Bod treats', 'qty' => 10, 'price' => 650, ); list('A'); $stripe->delete_product('2'); list('B'); $stripe->delete_product('4E'); list('C'); } else { print "FAILED: " . $stripe->error; } sub list { print "-- $_[0] --\n"; foreach ($stripe->list_products) { print "-> $_\n"; } print "\n"; }
and it behaves exactly as I would expect giving this output:
-- A -- -> 4E -> 2 -> 8 -- B -- -> 4E -> 8 -- C -- -> 8
So deleting more than one product doesn't appear to be a problem.


In reply to Re^4: [RFC] Module code and POD for CPAN by Bod
in thread [RFC] Module code and POD for CPAN by Bod

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.