dellwood
July 12th, 2009, 03:53 AM
Hi,
I have two Perl questions I just can't seem to find an answer for:
1) How can I check if the directories in the @INC ('path') array contain certain [EDIT] items/directories? For instance, if the directory 'perl' is located in any of the paths from @INC
2) Is there an easy way to turn on/off the 'die' function? I know this may sound a bit confusing, so lets say in the following example:
sub routine
{
my( $arg1, $arg2, $arg3, $die_switch ) = @_;
if( $die_switch = 1 )
{
#keep all die statements in place
}
elsif( $die_switch = 0 )
{
#ignore all die statements
}
else
{
...
}
...
}
How could this toggling of the 'die' command be achieved?
All help is welcome and appreciated :).
-Josh
I have two Perl questions I just can't seem to find an answer for:
1) How can I check if the directories in the @INC ('path') array contain certain [EDIT] items/directories? For instance, if the directory 'perl' is located in any of the paths from @INC
2) Is there an easy way to turn on/off the 'die' function? I know this may sound a bit confusing, so lets say in the following example:
sub routine
{
my( $arg1, $arg2, $arg3, $die_switch ) = @_;
if( $die_switch = 1 )
{
#keep all die statements in place
}
elsif( $die_switch = 0 )
{
#ignore all die statements
}
else
{
...
}
...
}
How could this toggling of the 'die' command be achieved?
All help is welcome and appreciated :).
-Josh