Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Variable scope issue

by jwkrahn (Abbot)
on Jun 26, 2019 at 19:12 UTC ( [id://11101985]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11101985]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found