in reply to Variable scope issue

You didn't verify that either open succeeded. You didn't chomp the value you are using as a file name so it probably failed!

my $score = 100_000; open my $IN, '<', $arq or die "Cannot open '$arq' because: $!"; while ( <$IN> ) { chomp; open my $IN1, '<', $_ or die "Cannot open '$_' because: $!"; while ( <$IN1> ) { my @temp = split /\t/; if ( $temp[ 1 ] < $score ) {

Replies are listed 'Best First'.
Re^2: Variable scope issue
by haukex (Archbishop) on Jun 30, 2019 at 10:26 UTC
    You didn't verify that either open succeeded. You didn't chomp the value you are using as a file name...

    Very good points!

    ... so it probably failed!

    Sorry, no - open: "The filename passed to the one- and two-argument forms of open will have leading and trailing whitespace deleted and normal redirection characters honored."

    Even if the if the second open failed, it doesn't explain the warning, as the inner while loop would not execute - the same comment applies to LanX's post.