scalar context

1 topic · 1 source

Technology› Programming

Perl

The situation in which an "expression" is expected by its surroundings (the code calling it) to return a single "value" rather than a "list" of values. See also "context" and "list context". A scalar context sometimes imposes additional constraints on the return value--see "string context" and "numeric context". Sometimes we talk about a "Boolean context" inside conditionals, but this imposes no additional constraints, since any scalar value, whether numeric or "string", is already true or false.

Cite this definition

APA
MLA
Chicago