Introspection: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
</ul> |
</ul> |
||
==[[Perl]]== |
|||
[[Category:Perl]] |
|||
'''Interpreter:''' [[Perl]] 5.x |
|||
require v5.6.1; # run time version check |
|||
require 5.6.1; # ditto |
|||
require 5.006_001; # ditto; preferred for backwards compatibility |
|||
Revision as of 14:17, 15 March 2007
![Task](http://static.miraheze.org/rosettacodewiki/thumb/b/ba/Rcode-button-task-crushed.png/64px-Rcode-button-task-crushed.png)
You are encouraged to solve this task according to the task description, using any language you may know.
This task asks to
- verify the version/revision of your currently running (compiler/interpreter/byte-compiler/runtime environment/whatever your language uses) and exit if it is too old.
- check whether the variable "bloop" exists and whether the math-function "abs()" is available and if yes compute abs(bloop).
Perl
Interpreter: Perl 5.x
require v5.6.1; # run time version check require 5.6.1; # ditto require 5.006_001; # ditto; preferred for backwards compatibility
Tcl
package require Tcl 8.2 ; # throws an error if older if {[info exists bloop] && [llength [info functions abs]]} { puts [expr abs($bloop)] }