Padre::Task::PPI::IntroduceTemporaryVariable - Introduces a temporary variable using PPI
my $tempvarmaker = Padre::Task::PPI::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();
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.
start_position
$editor->GetSelectionStart()
end_position
$editor->GetSelectionEnd() - 1
This class inherits from Padre::Task::PPI.
Padre::Task::PPI
Steffen Mueller smueller@cpan.org
smueller@cpan.org
Copyright 2008-2009 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
To install Padre, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Padre
CPAN shell
perl -MCPAN -e shell install Padre
For more information on module installation, please visit the detailed CPAN module installation guide.