Re: confidence under BEGIN{}

2018-07-27 Thread Andy Bach
Lauren wrote: >there is another member on this list pointed me a more graceful way, use lib '/path/..'; That's a good one, too - note, you do want to use an absolute path in there (and elsewhere) if you're writing this in a script. Something folks often misunderstand is that the script is run re

Re: confidence under BEGIN{}

2018-07-26 Thread Kent Fredric
On 27 July 2018 at 05:21, Andy Bach wrote: > > or, as Perl treats the "::" as a path denoter: > $ perl -e 'use test::mytest; mytest::hello()' > hello > > or: > $ perl -mtest::mytest -e 'mytest::hello()' > hello > > find ./test/mytest.pm via @INC's "." Note: neither of those examples work on Perl

Re: confidence under BEGIN{}

2018-07-26 Thread Lauren C.
Thanks Andy. there is another member on this list pointed me a more graceful way, use lib '/path/..'; Thus I don't need to remember special variables like @INC etc. Thanks anyway for kind helps. On 2018/7/27 ζ˜ŸζœŸδΊ” AM 1:21, Andy Bach wrote: $ ls test/ mytest.pm > I try to

Re: confidence under BEGIN{}

2018-07-26 Thread Andy Bach
$ ls test/ mytest.pm > I try to include it but got failed. $ perl -le 'use mytest' Can't locate mytest.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .)