Permalink
Browse files

follow perl recommendations:

* always 'use warnings'
* 'use parent' instead of base
* declare package variables with our, do not use vars
  • Loading branch information...
carandraug committed Mar 4, 2013
1 parent 004a8a0 commit 71b1065a81a64374577e3755669e2abbc9e23e61
Showing with 23 additions and 32 deletions.
  1. +2 −2 Bio/Biblio.pm
  2. +15 −19 Bio/DB/Biblio/biofetch.pm
  3. +6 −11 Bio/DB/Biblio/soap.pm
View
@@ -198,8 +198,8 @@ with an underscore _.
package Bio::Biblio;
use strict;
-
-use base qw(Bio::Root::Root Bio::DB::BiblioI);
+use warnings;
+use parent qw(Bio::Root::Root Bio::DB::BiblioI);
# -----------------------------------------------------------------------------
View
@@ -103,32 +103,28 @@ with an underscore _.
package Bio::DB::Biblio::biofetch;
-use vars qw(%HOSTS %FORMATMAP $DEFAULTFORMAT $DEFAULTRETRIEVAL_TYPE
- $DEFAULT_SERVICE $DEFAULT_NAMESPACE);
use strict;
+use warnings;
use Bio::Biblio::IO;
-use base qw(Bio::DB::DBFetch Bio::Biblio);
+use parent qw(Bio::DB::DBFetch Bio::Biblio);
-BEGIN {
-
- # you can add your own here theoretically.
- %HOSTS = (
- 'dbfetch' => {
- baseurl => 'http://%s/Tools/dbfetch/dbfetch?db=medline&style=raw',
- hosts => {
- 'ebi' => 'www.ebi.ac.uk'
- }
- }
+# you can add your own here theoretically.
+our %HOSTS = (
+ 'dbfetch' => {
+ baseurl => 'http://%s/Tools/dbfetch/dbfetch?db=medline&style=raw',
+ hosts => {
+ 'ebi' => 'www.ebi.ac.uk'
+ }
+ }
);
- %FORMATMAP = ( 'default' => 'medlinexml'
- );
- $DEFAULTFORMAT = 'medlinexml';
+our %FORMATMAP = ( 'default' => 'medlinexml' );
+our $DEFAULTFORMAT = 'medlinexml';
+
+our $DEFAULT_SERVICE = 'http://www.ebi.ac.uk/Tools/dbfetch/dbfetch';
+our $DEFAULTRETRIEVAL_TYPE = 'tempfile';
- $DEFAULT_SERVICE = 'http://www.ebi.ac.uk/Tools/dbfetch/dbfetch';
- $DEFAULTRETRIEVAL_TYPE = 'tempfile';
-}
sub new {
my ($class, @args ) = @_;
View
@@ -108,8 +108,9 @@ with an underscore _.
package Bio::DB::Biblio::soap;
-use vars qw($DEFAULT_SERVICE $DEFAULT_NAMESPACE);
use strict;
+use warnings;
+use parent qw(Bio::Biblio);
use SOAP::Lite
on_fault => sub {
@@ -122,17 +123,11 @@ use SOAP::Lite
}
;
-use base qw(Bio::Biblio);
+# where to go...
+our $DEFAULT_SERVICE = 'http://www.ebi.ac.uk/openbqs/services/MedlineSRS';
-BEGIN {
- # where to go...
- $DEFAULT_SERVICE = 'http://www.ebi.ac.uk/openbqs/services/MedlineSRS';
-
- # ...and what to find there
-
- ## TODO: This namespace is no longer valid (check for deprecation or update)
- $DEFAULT_NAMESPACE = 'http://industry.ebi.ac.uk/openBQS';
-}
+## TODO: This namespace is no longer valid (check for deprecation or update)
+our $DEFAULT_NAMESPACE = 'http://industry.ebi.ac.uk/openBQS';
# -----------------------------------------------------------------------------

0 comments on commit 71b1065

Please sign in to comment.