my $fh = *STDOUT;
foreach my $pkg ( keys %is_user_function ) {
- print $fh "\nnon-constant subs in package $pkg\n";
+ $fh->print("\nnon-constant subs in package $pkg\n");
foreach my $sub ( keys %{ $is_user_function{$pkg} } ) {
my $msg = "";
if ( $is_block_function{$pkg}{$sub} ) {
$msg = 'block';
}
- print $fh "$sub $msg\n";
+ $fh->print("$sub $msg\n");
}
}
foreach my $pkg ( keys %is_constant ) {
- print $fh "\nconstants and constant subs in package $pkg\n";
+ $fh->print("\nconstants and constant subs in package $pkg\n");
foreach my $sub ( keys %{ $is_constant{$pkg} } ) {
- print $fh "$sub\n";
+ $fh->print("$sub\n");
}
}
return;
# FIXME: this should work but will not catch errors
# because we also have to be sure that previous token is
# a type character ($,@,%).
- if ( $last_nonblank_token eq '{'
- && ( $next_tok !~ /^\d/ )
+ if ( $last_nonblank_token eq '{'
+ && ( $next_tok !~ /^\d/ )
&& ( $next_tok =~ /^\w/ ) )
{
# but if the modifier starts a new line we can skip
# this because either the here doc will be fully
# contained in the replacement text (so we can
- # ignore it) or Perl will not find it.
+ # ignore it) or Perl will not find it.
# See test 'here2.in'.
if ( $saw_modifier_e && $i_tok >= 0 ) {
# /^(\}|\{|BEGIN|END|CHECK|INIT|AUTOLOAD|DESTROY|UNITCHECK|continue|;|if|elsif|else|unless|while|until|for|foreach)$/
elsif (
$is_zero_continuation_block_type{
- $routput_block_type->[$i]
- } )
+ $routput_block_type->[$i] } )
{
$in_statement_continuation = 0;
}
# /^(sort|grep|map|do|eval)$/ )
elsif (
$is_not_zero_continuation_block_type{
- $routput_block_type->[$i]
- } )
+ $routput_block_type->[$i] } )
{
}
}
elsif ( $tok =~ /^\w/ ) { # alphanumeric ..
$saw_alpha = 1;
- $id_scan_state = ':'; # now need ::
+ $id_scan_state = ':'; # now need ::
$identifier .= $tok;
}
elsif ( $tok eq "'" && $allow_tick ) { # alphanumeric ..
}
elsif ( $id_scan_state eq '&' ) { # starting sub call?
- if ( $tok =~ /^[\$\w]/ ) { # alphanumeric ..
- $id_scan_state = ':'; # now need ::
+ if ( $tok =~ /^[\$\w]/ ) { # alphanumeric ..
+ $id_scan_state = ':'; # now need ::
$saw_alpha = 1;
$identifier .= $tok;
}
$saw_alpha = 1;
$identifier .= $tok;
}
- elsif ( $tok =~ /^\s*$/ ) { # allow space
+ elsif ( $tok =~ /^\s*$/ ) { # allow space
}
- elsif ( $tok eq '::' ) { # leading ::
- $id_scan_state = 'A'; # accept alpha next
+ elsif ( $tok eq '::' ) { # leading ::
+ $id_scan_state = 'A'; # accept alpha next
$identifier .= $tok;
}
elsif ( $tok eq '{' ) {
}
elsif ( $id_scan_state eq 'A' ) { # looking for alpha (after ::)
- if ( $tok =~ /^\w/ ) { # found it
+ if ( $tok =~ /^\w/ ) { # found it
$identifier .= $tok;
$id_scan_state = ':'; # now need ::
$saw_alpha = 1;
$identifier .= $tok;
$id_scan_state = 'A'; # now require alpha
}
- elsif ( $tok =~ /^\w/ ) { # more alphanumeric is ok here
+ elsif ( $tok =~ /^\w/ ) { # more alphanumeric is ok here
$identifier .= $tok;
- $id_scan_state = ':'; # now need ::
+ $id_scan_state = ':'; # now need ::
$saw_alpha = 1;
}
elsif ( $tok eq "'" && $allow_tick ) { # tick
# This should be the latest list of token types in use
# adding NEW_TOKENS: add a comment here
- print $fh <<'END_OF_LIST';
+ $fh->print(<<'END_OF_LIST');
Here is a list of the token types currently used for lines of type 'CODE'.
For the following tokens, the "type" of a token is just the token itself.