GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PPIX::EDITORTOOLS::RETURNOBJECT (3)

.ds Aq ’

NAME

PPIx::EditorTools::ReturnObject - Simple object to return values from PPIx::EditorTools

CONTENTS

SYNOPSIS



  my $brace = PPIx::EditorTools::FindUnmatchedBrace->new->find(
        code => "package TestPackage;\nsub x { 1;\n"
      );
  my $location = $brace->element->location;
  my $ppi      = $brace->element->ppi;



DESCRIPTION

Retuning a simple PPI::Element from many of the PPIx::EditorTools methods often results in the loss of the overall context for that element. PPIx::EditorTools::ReturnObject provides an object that can be passed around which retains the overall context.

For example, in PPIx::EditorTools::FindUnmatchedBrace if the unmatched brace were returned by its PPI::Structure::Block the containing PPI::Document is likely to go out of scope, thus the location method no longer returns a valid location (rather it returns undef). Using the ReturnObject preserves the PPI::Document and the containing context.

METHODS

new() Constructor which should be used by PPIx::EditorTools. Accepts the following named parameters:
ppi A PPI::Document representing the (possibly modified) code.
code A string representing the (possibly modified) code.
element A PPI::Element or a subclass thereof representing the interesting element.
ppi Accessor to retrieve the PPI::Document. May create the PPI::Document from the $code string (lazily) if needed.
code Accessor to retrieve the string representation of the code. May be retrieved from the PPI::Document via the serialize method (lazily) if needed.

SEE ALSO

PPIx::EditorTools, App::EditorTools, Padre, and PPI.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PPIX::EDITORTOOLS::RETURNOBJECT (3) 2014-09-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.