in reply to Re: Selective Printing of Lines
in thread Selective Printing of Lines

THank you all for excellent replies. All of them are working fine and now I am trying to 'decode' each of them :D. Hi onelesd, Can you please explain the if (! defined $min{$col2}) part of your code. Ever since you posted this code, I have been banging my head to understand the usage of defined and the unary operator !. Thanks in advance.

Replies are listed 'Best First'.
Re^3: Selective Printing of Lines
by onelesd (Pilgrim) on Sep 16, 2011 at 04:28 UTC

    See: perldoc -f defined

    defined EXPR defined Returns a Boolean value telling whether EXPR has a valu +e other than the undefined value "undef".

    ! negates the condition, so in natural language the condition is: "if $min{$col2} is not defined".