in reply to using unless($code == 200)....

LINE: while (<IN>) { my $url = $_; my $response = 0; next LINE if $response == 500; unless ($response == 200) { # Do stuff here. } }
Of course, the check for equality to 500 will never work because you set response to 0 and never change it. This means that your unless-clause will always enter the block.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.