Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kainhofer
pae2xml
Commits
06f184c1
Commit
06f184c1
authored
Jul 14, 2010
by
Reinhold Kainhofer
Browse files
Implement reading from stdin
parent
6916ec71
Changes
1
Hide whitespace changes
Inline
Side-by-side
pae2xml.pl
View file @
06f184c1
...
...
@@ -553,12 +553,15 @@ Error: $msg\n";
sub read_file {
my ($fn) = @_;
if (!(open FH, $fn))
{
my $res = "";
if ($fn eq "-") {
while (<STDIN>) { $res .= $_; } # read all lines
} else {
if (!(open FH, $fn)) {
return "";
}
my
$res =
"";
whil
e (
<
FH
>) { $res .= $_; } # read all lines
close (FH);
while (<FH>) {
$res
.
=
$_; } # read all lines
clos
e (FH
);
}
return $res;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment