package Statistics::R::Legacy; use strict; use warnings; use base qw( Statistics::R ); use vars qw{@ISA @EXPORT}; BEGIN { @ISA = 'Exporter'; @EXPORT = qw{ startR stopR restartR Rbin start_sharedR start_shared read receive is_blocked is_locked receive lock unlock send error clean_up }; } =head1 NAME Statistics::R::Legacy - Legacy methods for Statistics::R =head1 DESCRIPTION This module contains legacy methods for I. They are provided solely so that code that uses older versions of I does not crash with recent version. Do not use these methods in new code! Some of these legacy methods simply had their name changed, but some others were changed to do nothing and return only single value because it did not make sense to keep these methods as originally intended anymore. =head1 METHODS =over 4 =item startR() This is the same thing as start(). =item stopR() This is the same thing as stop(). =item restartR() This is the same thing as restart(). =item Rbin() This is the same thing as bin(). =item start_sharedR() / start_shared() Use the shared option of new() instead. =item send / read() / receive() Use run() instead. =item lock() Does nothing anymore. =item unlock() Does nothing anymore. =item is_blocked() / is_locked() Return 0. =item Return the empty string. =item clean_up() Does nothing anymore. =back =head1 SEE ALSO =over 4 =item * L =back =head1 AUTHORS Florent Angly Eflorent.angly@gmail.comE (2011 rewrite) Graciliano M. P. Egm@virtuasites.com.brE (original code) =head1 MAINTAINER Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT & LICENSE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 BUGS All complex software has bugs lurking in it, and this program is no exception. If you find a bug, please report it on the CPAN Tracker of Statistics::R: L Bug reports, suggestions and patches are welcome. The Statistics::R code is developed on Github (L) and is under Git revision control. To get the latest revision, run: git clone git@github.com:bricas/statistics-r.git =cut { # Prevent "Name XXX used only once" warnings in this block no warnings 'once'; *startR = \&Statistics::R::start; *stopR = \&Statistics::R::stop; *restartR = \&Statistics::R::restart; *Rbin = \&Statistics::R::bin; *receive = \&Statistics::R::result; *start_sharedR = \&start_shared; *read = \&receive; *is_blocked = \&is_locked; } sub start_shared { my $self = shift; $self->start( shared => 1 ); } sub lock { return 1; } sub unlock { return 1; } sub is_locked { return 0; } sub send { # Send a command to R. Do not return the output. my ($self, $cmd) = @_; $self->run($cmd); return 1; } sub error { return ''; } sub clean_up { return 1; } 1;