Subject: | Unexpected change of current directory |
Script's current directory is changed in the $R->startR() function.
I think this behavior is not good, as a module. It is better to save a original current directory and get it back internally.
I faced this problem on Linux + perl 5.8.1.
---
use Statistics::R;
print `pwd`;
my $R = Statistics::R->new() ;
$R->startR();
$R->stopR();
print `pwd`; # show different directory
---
---
use Statistics::R;
use Cwd;
print `pwd`;
my $cwd = getcwd();
my $R = Statistics::R->new() ;
$R->startR();
$R->stopR();
chdir($cwd);
print `pwd`; # no problem
---