Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eg/calculator/lib/Runner.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sub run {
sub run_file {
my ($self) = @_;
my $file = shift(@{$self->args});
open IN, $file or die "Can't open '$file' for input";
open IN, "<", $file or die "Can't open '$file' for input";
while (<IN>) {
next if /^(?:#|$)/;
chomp;
Expand Down
6 changes: 3 additions & 3 deletions lib/Pegex/Grammar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sub make_text {
my ($self) = @_;
my $filename = $self->file
or return '';
open TEXT, $filename
open TEXT, "<", $filename
or die "Can't open '$filename' for input\n:$!";
return do {local $/; <TEXT>}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ sub import {
sub compile_into_module {
my ($package) = @_;
my $grammar_file = $package->file;
open GRAMMAR, $grammar_file
open GRAMMAR, "<", $grammar_file
or die "Can't open $grammar_file for input";
my $grammar_text = do {local $/; <GRAMMAR>};
close GRAMMAR;
Expand All @@ -94,7 +94,7 @@ sub compile_into_module {
require Pegex::Compiler;
$perl = Pegex::Compiler->new->compile($grammar_text, @rules)->to_perl;
}
open IN, $file or die $!;
open IN, "<", $file or die $!;
my $module_text = do {local $/; <IN>};
require Pegex;
my $msg = " # Generated/Inlined by Pegex::Grammar ($Pegex::VERSION)";
Expand Down
2 changes: 1 addition & 1 deletion lib/Pegex/Input.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sub open {
$self->{_buffer} = \ do { local $/; <$handle> };
}
elsif (my $path = $self->{file}) {
open my $handle, $path
open my $handle, "<", $path
or die "Pegex::Input can't open $path for input:\n$!";
$self->{_buffer} = \ do { local $/; <$handle> };
}
Expand Down