@@ -202,7 +202,7 @@ sub __TOKENIZER__on_char {
202
202
}
203
203
204
204
# Suck in the HEREDOC
205
- $token -> {_heredoc } = [] ;
205
+ $token -> {_heredoc } = \ my @heredoc ;
206
206
my $terminator = $token -> {_terminator } . " \n " ;
207
207
while ( defined ( my $line = $t -> _get_line ) ) {
208
208
if ( $line eq $terminator ) {
@@ -215,7 +215,7 @@ sub __TOKENIZER__on_char {
215
215
}
216
216
217
217
# Add the line
218
- push @{ $token -> { _heredoc }} , $line ;
218
+ push @heredoc , $line ;
219
219
}
220
220
221
221
# End of file.
@@ -226,19 +226,19 @@ sub __TOKENIZER__on_char {
226
226
# compile but is easy to detect) or if the here-doc block was just not
227
227
# terminated at all (which Perl would fail to compile as well).
228
228
$token -> {_terminator_line } = undef ;
229
- if ( @{ $token -> { _heredoc }} and defined $token -> { _heredoc } [-1] ) {
229
+ if ( @heredoc and defined $heredoc [-1] ) {
230
230
# See PPI::Tokenizer, the algorithm there adds a space at the end of the
231
231
# document that we need to make sure we remove.
232
232
if ( $t -> {source_eof_chop } ) {
233
- chop $token -> { _heredoc } [-1];
233
+ chop $heredoc [-1];
234
234
$t -> {source_eof_chop } = ' ' ;
235
235
}
236
236
237
237
# Check if the last line of the file matches the terminator without
238
238
# newline at the end. If so, remove it from the content and set it as
239
239
# the terminator line.
240
- $token -> {_terminator_line } = pop @{ $token -> { _heredoc }}
241
- if $token -> { _heredoc } [-1] eq $token -> {_terminator };
240
+ $token -> {_terminator_line } = pop @heredoc
241
+ if $heredoc [-1] eq $token -> {_terminator };
242
242
}
243
243
244
244
# Set a hint for PPI::Document->serialize so it can
0 commit comments