Basic HTML version of Foils prepared Sept 20 97

Foil 54 ref and scalar functions

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


ref EXPR returns FALSE unless EXPR is a reference (pointer)
If it is a reference, then ref returns
  • Package Name if EXPR blessed
  • REF if a reference
  • CODE if a subroutine
  • GLOB if a FileHandle
  • SCALAR ARRAY HASH if one of three basic types
scalar EXPR forces EXPR to be evaluated in scalar (as opposed to list) context and returns scalar result
We do not need a "list" command as [ ] constructs anonymous arrays and ( ... ) generates a list trivially



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 5 1998