[Bioperl-l] $@#!$! backwards compatibility

Aaron J Mackey ajm6q@virginia.edu
Wed, 28 Feb 2001 16:00:10 -0500 (EST)


try if(File::Spec->can('tempdir')) { ... }

-Aaron

On Wed, 28 Feb 2001, Jason Stajich wrote:

> in perl 5.6.0 'exists' can be used to test if a method exists.  ie
> exists(&File::Spec::tempdir)
> but not in 5.004.  Does anyone know how else we can test this.  I am not
> really keen on doing:
>
> eval {
> 	return File::Temp::tempdir(@args);
> };
> if( $@ ) {
> 	....
> }
>
> but I will if there is no other way.
>
> Jason Stajich
> jason@chg.mc.duke.edu
> Center for Human Genetics
> Duke University Medical Center
> http://www.chg.duke.edu/
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

-- 
 o ~   ~   ~   ~   ~   ~  o
/ Aaron J Mackey           \
\  Dr. Pearson Laboratory  /
 \ University of Virginia  \
 /  (804) 924-2821          \
 \  amackey@virginia.edu    /
  o ~   ~   ~   ~   ~   ~  o