A bug in get_iplayer-3.01?

RS richard22j at zoho.com
Sat Jun 17 11:19:42 PDT 2017


>From: Ralph Corderoy
>Sent: Saturday, June 17, 2017 16:56

>Try

  >  my $subdir;
  >  if ($opt->{subdirformat} != '') {
  >      $subdir = $prog->substitute($opt->{subdirformat}, 1);
   > } else {
    >    $subdir = $prog->substitute ('<longname>', 0);
    >}

Thanks for that, Ralph.  After I posted my attempt it did occur to me to 
move the my Ssubdir; declaration outside the if statement, but I didn't spot 
that I had written }; else instead of ;} else.  Now all I need to do is to 
find out why --subdir-format has stopped working.  It works in 3.01, so it 
must be something I've done.

I was frantically reading about the scope of variables.  My background is 
Algol 60 and PLI where a block is a compound statement with local 
declarations.  I gather in Perl it's the other way round.

Anyway I have now found why --subdirformat is not working.  != is a numeric 
comparison operator.  I should have used the string comparison operator ne. 
The revised version becomes replace line 4043 with

           my $subdir;
            if ($opt->{subdirformat} ne "") {$subdir = $prog->substitute( 
$opt->{subdirformat}, 1);}
            else {$subdir = $prog->substitute ('<longname>', 0)};

I hear what you say about C++, but I find it easier than Python.






More information about the get_iplayer mailing list