use bigint; is lexically scoped. You can limit what it effects by putting curlies around it.

no bigint; cancels bigint's effects. It is also lexically scoped.

Another way of limiting bigint's effect — turning numerical constants into Math::BigInt objects — is to avoid using bigint completely and create Math::BigInt objects for the appropriate constants manually.

For example, say you're starting with the following:

>perl -MO=Concise,-exec -Mbigint -e"my $big = 1234; for (1..4) { foo($ +big) }" ... 7 <0> pushmark s 8 <$> const[RV \HASH] s <-- for loop indexes are needlessly 9 <$> const[RV \HASH] s <-- BigInt objects. a <#> gv[*_] s b <{> enteriter(next->h last->k redo->c) lKS/8 ...

Let's selectively make $big a BigInt to avoid making the loop indexes objects:

>perl -MO=Concise,-exec -MMath::BigInt -e"my $big = Math::BigInt->new( +'1234'); for (1..4) { foo($big) }" ... b <0> pushmark s c <$> const[IV 1] s <-- Much better d <$> const[IV 4] s <-- e <#> gv[*_] s f <{> enteriter(next->l last->o redo->g) lKS/8 ...

In reply to Re: using a module for a portion of the code only by ikegami
in thread using a module for a portion of the code only by perlrocks

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.