• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/CPANInternal-140/Template-Toolkit/lib/Template/Stash/

Lines Matching refs:item

231         # if $ident is a list reference, then we evaluate each item in the 
312 # Returns a "reference" to a particular item. This is represented as a
313 # closure which will return the actual stash item when called.
319 my ($root, $item, $result);
326 ($item, $args) = @$ident[$i, $i + 1];
329 ($root = $self->_dotop($root, $item, $args));
333 $item = $ident;
338 $self->_dotop($root, $item, \@args);
375 # _dotop($root, $item, \@args, $lvalue, $nextItem)
391 # Returns the result of evaluating the item against the root, having
398 my ($self, $root, $item, $args, $lvalue, $nextItem) = @_;
408 # print STDERR "_dotop(root=$root, item=$item, args=[@$args])\n"
414 unless defined($root) and defined($item) and $item !~ /^[\._]/;
417 (($value = $LIST_OPS->{ $item }) || $item =~ /^-?\d+$/) ) {
432 if (defined($value = $root->{ $item })) {
439 return $root->{ $item } = { }; ## RETURN
441 elsif ($value = $HASH_OPS->{ $item }) {
444 elsif (ref $item eq 'ARRAY') {
446 return [@$root{@$item}]; ## RETURN
448 elsif ($value = $SCALAR_OPS->{ $item }) {
463 if (($value = $LIST_OPS->{ $item }) && ! $lvalue) {
466 elsif (($value = $SCALAR_OPS->{ $item }) && ! $lvalue) {
474 elsif ($item =~ /^-?\d+$/) {
475 $value = $root->[$item];
480 elsif (ref $item eq 'ARRAY' ) {
482 return [@$root[@$item]]; ## RETURN
493 # UNIVERSAL object base class) then we call the item as a method.
496 return ref $root->can($item) if ( $returnRef ); ## RETURN
498 @result = $scalarContext ? scalar $root->$item(@$args)
499 : $root->$item(@$args); ## @result
505 && defined($value = $root->{ $item })) {
511 && ($value = $LIST_OPS->{ $item })) {
519 elsif (($value = $SCALAR_OPS->{ $item }) && ! $lvalue) {
528 die "don't know how to access [ $root ].$item\n"; ## DIE
534 # fold multiple return items into a list unless first item is undef
551 die "$item is undefined\n"; ## DIE
584 # _assign($root, $item, \@args, $value, $default)
588 # root item, the item and arguments, as per _dotop(), followed by the
595 my ($self, $root, $item, $args, $value, $default) = @_;
601 # print(STDERR "_assign(root=$root, item=$item, args=[@$args], \n",
608 unless $root and defined $item and $item !~ /^[\._]/;
612 return ($root->{ $item } = $value) ## RETURN
613 unless $default && $root->{ $item };
615 elsif ($rootref eq 'ARRAY' && $item =~ /^-?\d+$/) {
616 # or set a list item by index number
617 return ($root->[$item] = $value) ## RETURN
618 unless $default && $root->{ $item };
621 # try to call the item as a method of an object
622 return $root->$item(@$args, $value); ## RETURN
625 die "don't know how to assign to [$root].[$item]\n"; ## DIE