[Israel.pm] List of all contexts in Perl

Shmuel Fomberg semuelf at 012.net.il
Sun May 30 09:01:20 PDT 2010


Offer Kaye wrote:
> I understand list/scalar context. This is a way of looking at how a
> Perl statement is called and how it can return different values
> depending on the way it is called.
> 
> I'm not sure I understand what "boolean context" means, or any of the
> others you listed. Except for the ".." operator does any of Perl's
> built-in functions operate differently inside an "if" test for
> example, in terms of the value returned (assuming you assign it to
> something)?

isn't the match operator behaves differently in scalar, list and boolean 
context?
@matchs = $str =~ m/xxxx/g;
$match_count = $str =~ m/xxxx/g;
while ($str =~ m/xxxx/g) { ... }

- Shmuel


More information about the Perl mailing list