diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-03-01 18:23:57 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-03-01 18:23:57 +0100 |
commit | ae4bb8da9e1dd41abf5d564b471c68de7b2acdb8 (patch) | |
tree | d0b8d3550aa32731467ac1cc87679db495da5c85 | |
parent | ec40b5aaa8fe19ecfeacb1936de4a035801797ac (diff) |
conditional module import
-rwxr-xr-x | videoadd.pl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/videoadd.pl b/videoadd.pl index fadc7f1..bf1a224 100755 --- a/videoadd.pl +++ b/videoadd.pl @@ -90,7 +90,7 @@ of the database. If matching entries are found, then the user is prompted to choose for an entry to update, or to ignore these entries. In the former case, the -above file hierachy remains unchanged and the database is merely updated +above file hierarchy remains unchanged and the database is merely updated with the new retrieved data. In the later case, B<videoadd.pl> acts as below. @@ -121,12 +121,14 @@ in the database) =item B<--ignore-db> Do not connect to the database, hence do not update it with the new -movie. Note that it may break the sanity of your collection. +movie, but only move it to the right place in the file hierarchy. Note +that it may break the sanity of your collection. =item B<--dont-move> Do not put the new movie in I<DIRECTORS/director/movie>, with a -symlink I<MOVIES/movie> -> I<../DIRECTORS/director/movie>. +symlink I<MOVIES/movie> -> I<../DIRECTORS/director/movie>, but only +update the database. Note that it may break the sanity of your collection. =item B<--force> @@ -248,7 +250,8 @@ pod2usage(2) if $#ARGV != 0; my $dbh; unless ( defined $ignoredb_flag ) { - use DBI; + require DBI; + import DBI; # Connect to database my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname}"; @@ -274,7 +277,8 @@ my %new = ( owner_id => $config{userid} if ( defined ($imdb{crit}) and &runIMDb() ) { # Look up the title/ID on IMDb - use IMDB::Film; + require IMDB::Film; + import IMDB::Film; my $single; my $movie; @@ -523,7 +527,7 @@ unless ( defined $ignoredb_flag ) { ################################################################################ -# Move the file in the collection +# Move the file to the right place in the hierarchy if ( defined ($file) and defined ($move_flag) ) { if (defined $new{director}) { |