Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom error handling 1

Status
Not open for further replies.

arcnon

Programmer
Aug 12, 2003
242
US
what I am tring to accomplish, is create a sub that I can pass my custom error data.

I am looking for a better way of pulling it off.

Code:
error('error:',"Incorrect interface call should be 'RST'").die;

sub error{
	print join("\n", @_)."\n";
}

Is there a flag that I can use to pass the line number instead of die?
 
Code:
$line=__LINE__;
and pass $line to your sub

HTH
--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top