in reply to QUERY ABOUT A SECTION OF A CODE

The first statement creates a hash variable and assigns a group of keys and values to it. The second statement assigns a value to the scalar variable $pixel. The third statement assigns a value to the scalar variable $url_file, concatenating two string values and the value of $pixel. The fourth statement assigns a value to the scalar variable $file, again concatenating two bits of text with the value of $pixel.

The fifth statement is the most complicated one. It says, "if the file named in $file exists, unlink (delete) the file or exit the program and tell me the most recent error." Using or in this way is an idiomatic way in Perl to say, "do this, and if it fails, do that." So if the unlink succeeds, the or is satisfied and the die is not executed. To rewrite it longhand to make the order of things clearer:

if( -e $file ){ unless( unlink $file ){ die $!; } }

Aaron B.
Available for small or large Perl jobs; see my home node.