Menu

Bareword "documentid" not allowed while "strict subs" in use

2026-08-19
2026-08-19
  • Angel_Blue01

    Angel_Blue01 - 2026-08-19

    I am trying to run the following command on a directory with 1,600 files:

    exiftool -overwrite_original -P ''-documentid<${filename}' -if 'not documentid' -progress -r .

    When I try to run a certain command recursively it exist with exit code 2. The -v flag reveals the following underlying error for each file in the directory, where the last part of the error is the file:

    Condition: Bareword "documentid" not allowed while "strict subs" in use - ./DSCN1053.JPG

    Googling the error points to others having this problem with Perl scripts. There was one person who had this message in the old forum, but alas, it is no longer viewable.

    I am using exiftool 13.25 in Debian 13 using the bash shell.

     
  • Angel_Blue01

    Angel_Blue01 - 2026-08-19

    Running the command on a single file, without the -r flag works as expected.

     
  • StarGeek

    StarGeek - 2026-08-19

    Technically, it is only working "as expected" because the -if option is broken.

    From the docs on the -if option

    Specify a condition to be evaluated before processing each FILE. EXPR is a Perl-like logic expression containing tag names prefixed by $ symbols.

    In the expression, you are using the bare word "documentid" and not the tag name DocumentID.

    Also, a minor item is that you are making Common Mistake #5b, "Adding a leading "$" when copying a simple tag".

    Try this:
    exiftool -overwrite_original -P '-documentid<filename' -if 'not $documentid' -progress -r .

     

Log in to post a comment.