First off, I'm sorta guessing, but l5, sounds like an abbreviation for /usr/lib/perl(5)/(site|local)/.... Since in a normal install of Win7 you are your own 'site'. In regards to SBperl not putting thing under neat your own User dir, where would you put your 'local site' modules dir that were added by the user that were in a personal version of SBperl? If you were compiling for a company, you might already know how to build your own perl, but for an individual?

Have you looked at %Config to see what has the path under your home dir? (i.e. is it the SITE paths?) -- sounds like not or it should have found them at run time.

I just dumped my config with:

alias tperl='perl -I/home/myuserid/bin/lib -we'\''use strict; use P;' tperl use Config; use Data::Dumper; my $dmp = Data::Dumper->new([\%Config], [ "Config" ]); $dmp->Indent(1)->Deepcopy(0)->Sortkeys(1)->Deparse(1)->Purity(1)->Quot +ekeys(0); printf "%s\n", $dmp->Dump;'
Might also want to look at your CPAN config for clues: more ~/.cpan/CPAN/MyConfig.pm

The other thing to do would be to create a 'lib' dir under your executable and add the relative path at runtime:

use FindBin qw($Bin); $FindBin::Bin =~ s{/bin/lib/?$}{/bin}; use lib ($FindBin::Bin . "/lib", $ENV{HOME} . "/bin/lib");
For conditional compilation, I used something like:
#!/usr/bin/perl use warnings; use strict; use P; use parent 'Switches'; ## example of a PERL compile-time constant ## based on a command line argument "-NODEBUG" ## using 'Switches' & BEGIN ## to run, place "-DNODEBUG" on the command line. (law) BEGIN { Switches->process_options({DNODEBUG => { act => [ sub { eval '# line '.__LINE__.' "'.__FILE__.'" use constant "_NODEBUG_"=>1;'; $@ && P::Pe("eval: %s\n", $@); } ], } }, \@ARGV); eval 'use constant _NODEBUG_ => undef;' unless *main::_NODEBUG_{CODE +}; } sub declared ($) { use constant 1.01; # note: needed for "declared", belo +w my ($name, $pkg) = (shift, caller); # prepend module name (must be a full-name) $name = q(main) . $name if '::' eq substr $name,0,2; # use caller pkg if needed my $full_name = 0 <= index($name,'::') ? $name : $pkg.'::'.$name; $constant::declared{$full_name}; } P "_NODEBUG_ is a %s %s", declared(q(_NODEBUG_)) ? "constant" : "sub" +, P "and is %s", _NODEBUG_ ? "TRUE (devel checks disabled)." : "FALSE (devel checks enabled)."
Switches will check if "-DNODEBUG" is on the command line, if so, it will call the first eval, otherwise the end.

The constant created (_NODEBUG_) becomes a compile time constant that will be either '1' or 'undef'.

When working locally, create an alias or batch file to run your program with the -DNODEBUG switch. You can still take it out later, but this way if you upload your code w/o removing your custom code, it won't get activated.

Since _NODEBUG_ is a compile time constant, perl should either not include or include your debug code at runtime.

Those were just a few things I thought of off the top of my head. Hope it helps!


In reply to Re: Strawberry, CPAN and PERL5 by perl-diddler
in thread Strawberry, CPAN and PERL5 by cristofayre

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.