Padre::Task::IntroduceTemporaryVariable - Introduces a temporary variable using L


Padre documentation  | view source Contained in the Padre distribution.

Index


NAME

Top

Padre::Task::IntroduceTemporaryVariable - Introduces a temporary variable using PPI

SYNOPSIS

Top

  my $tempvarmaker = Padre::Task::IntroduceTemporaryVariable->new(
          document       => $document_obj,
          start_location => [$line, $column], # or just character position
          end_location   => [$line, $column], # or ppi-style location
          varname        => '$foo',
  );

  $tempvarmaker->schedule;

DESCRIPTION

Top

Given a region of code within a statement, replaces that code with a temporary variable. Declares and initializes the temporary variable right above the statement that included the selected expression.

Usually, you simply set start_position to what $editor->GetSelectionStart() returns and end_position to $editor->GetSelectionEnd() - 1.

SEE ALSO

Top

This class inherits from Padre::Task::PPI.

AUTHOR

Top

Steffen Mueller smueller@cpan.org

COPYRIGHT AND LICENSE

Top


Padre documentation  | view source Contained in the Padre distribution.