フィルターのクリア

How to update Perl in matlab

10 ビュー (過去 30 日間)
Qingping
Qingping 2013 年 1 月 6 日
コメント済み: Walter Roberson 2015 年 11 月 20 日
I am using Perl in matlab.
Perl code:
my $dbh = DBI->connect("dbi:$dbdriver:dbname=$dbname;host=$dbhost;port=$dbport", $dbuser, $dbpasswd);
Matlab give me a error message as below:
Error using perl (line 80)
System error:
---------------------------------------------------------------------------
install_driver(PgPP) failed: Can't locate DBD/PgPP.pm in @INC (@INC contains:
D:/GreenSoft/Matlab7X/sys/perl/win32/site/lib D:/GreenSoft/Matlab7X/sys/perl/win32/lib .) at (eval 6) line 3.
Perhaps the DBD::PgPP perl module hasn't been fully installed,
or perhaps the capitalisation of 'PgPP' isn't right.
Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Proxy, SQLite, Sponge.
at .\teqcdb.pl line 11

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 1 月 6 日
Perl modules can be found at http://www.cpan.org/
The obvious links on that page about how to install perl modules do not appear to be working at the moment, so see http://www.cpan.org/misc/cpan-faq.html#How_install_Perl_modules
  2 件のコメント
Qingping
Qingping 2013 年 1 月 7 日
Tks your answer. There are many infomation about update the perl modules in windows or unix, but I can't find a help with update the perl in matlab.
If i install perl and some modules in windows, for use perl with command like this, dos(['perl perlfile.pl']), not run command perl('perlfile.pl')
Walter Roberson
Walter Roberson 2013 年 1 月 7 日
To find your MS Windows perl binary from the MATLAB command line, command
fullfile(matlabroot, 'sys\perl\win32\bin\perl')
Once you have that location, you can head over to any handy command window and use perl from the command line to install perl modules as described in the link I gave above.
There is no special mechanism to update perl within MATLAB, unless you want to fight with MATLAB about it. In particular, the MATLAB perl() command will not allow you to give a flag such as "-e" or "-M" as your first argument so to work entirely inside MATLAB for the update you would have to a perl script that started with "use CPAN;" and had the appropriate "install" command.

サインインしてコメントする。


Fred
Fred 2014 年 3 月 11 日
How can I find the OS X perl binary from the Matlab command line?
When I look in the matlabroot\sys\ folder, there is no perl directory.
  2 件のコメント
Micke Malmström
Micke Malmström 2015 年 11 月 20 日
Macos X should have pearl installed by default. I dont know where it is though.
Walter Roberson
Walter Roberson 2015 年 11 月 20 日
At least as of R2014a, for MS Windows perl is found as
fullfile(matlabroot, 'sys\perl\win32\bin\')
and for OS-X and Linux, perl is found as
unix('which perl')
That is, the system perl is used. On my OS-X Yosemite system that is /usr/bin/perl

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by