I have and object with a function called new. (seen below). What I want to do is instead of simply calling die I want to know who called "new" without the required params. (like a stacktrace) I've tried confess, longmess, and caller and they did not produce the caller of new.
#!/usr/bin/perl
use strict;
use warnings;
package SCBaseView;
sub new
{
# proto -> needed for Perl OOP. a ref to this blesses hashref
# common -> common functions and configurations needed for the
application
# name -> The name of the view. Used to find templates in the
directory tree.
# options -> Generic hashref used to extend the functionality of this
class
# while at the same time maintaining a consistent interface.
my ( $proto, $common, $name, $options ) = @_;
my $class = ref($proto) || $proto;
my $self = {};
# member variables
bless( $self, $class );
if (defined($common))
{
$self->{'common'} = $common;
}
else
{
die ("SCBaseView called without a referance to the common
lib/config\n");
}
if (defined($name))
{
$self->{'name'} = $name;
}
else
{
die ("SCBaseView called without a value for 'name'\n");
}
if (defined($options))
{
#$self->set_options($options); #not implemented in this code
example
}
return $self;
}
1;
--
Ronald Weidner
Software Engineer II
[http://content.netsuite.com/core/media/media.nl?id=3&c=1114795&h=5f2635f2821fd1d9992c]
[logo-idex]
Toptech Systems
1124 Florida Central Pkwy
Longwood, FL 32750
(407) 332-1774 x278
[email protected]
**********************************************************************
This e-mail is intended solely for the intended recipient or recipients. If
this e-mail is addressed to you in error or you otherwise receive this e-mail
in error, please advise the sender, do not read, print, forward or save this
e-mail, and promptly delete and destroy all copies of this e-mail.
This email may contain information that is confidential, proprietary or secret
and should be treated as confidential by all recipients. This e-mail may also
be a confidential attorney-client communication, contain attorney work product,
or otherwise be privileged and exempt from disclosure. If there is a
confidentiality or non-disclosure agreement or protective order covering any
information contained in this e-mail, such information shall be treated as
confidential and subject to restriction on disclosure and use in accordance
with such agreement or order, and this notice shall constitute identification,
labeling or marking of such information as confidential, proprietary or secret
in accordance with such agreement or order.
The term 'this e-mail' includes any and all attachments.
**********************************************************************
<<inline: image001.png>>
<<inline: image002.jpg>>
