Wednesday, March 6, 2013

How could you check the success of opening a file in Perl?

open ( FILE, "$0" );

if ( tell ( FILE ) == -1 )
{
        print "Not Opened!";
}

close ( FILE );

No comments :