Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^6: Some Insights from a Traveler Between Languages

by ihb (Deacon)
on Apr 26, 2005 at 23:20 UTC ( [id://451799] : note . print w/replies, xml ) Need Help??


in reply to Re^5: Some Insights from a Traveler Between Languages
in thread Some Insights from a Traveler Between Languages

It creates list context for the x operator

Nope. The operand of any operator can't set which context the operator itself is in. It does set context for it's operand though. That's what's interesting. Illustration for those that don't know what Roy and I are talking about:

sub context { print defined wantarray ? wantarray ? 'list' : 'scalar' +: 'void' } @foo = context() x 1; # "scalar" @foo = (context()) x 1; # "list"

ihb

See perltoc if you don't know which perldoc to read!