summaryrefslogtreecommitdiffstats
path: root/Aufgabe2/EinString.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Aufgabe2/EinString.pl')
-rw-r--r--Aufgabe2/EinString.pl56
1 files changed, 56 insertions, 0 deletions
diff --git a/Aufgabe2/EinString.pl b/Aufgabe2/EinString.pl
new file mode 100644
index 0000000..6938091
--- /dev/null
+++ b/Aufgabe2/EinString.pl
@@ -0,0 +1,56 @@
+#!/usr/bin/env perl
+#===============================================================================
+#
+# FILE: EinString.pl
+#
+# USAGE: ./EinString.pl
+#
+# DESCRIPTION: Eine Datei in eine String hängen.
+#
+# OPTIONS: ---
+# REQUIREMENTS: ---
+# BUGS: ---
+# NOTES: ---
+# AUTHOR: Martin Talarczyk (MT), talarczyk.martin@fh-swf.de
+# ORGANIZATION: FH Südwestfalen, Iserlohn
+# Matrikel-Nr.: 10036162
+# VERSION: 1.0
+# CREATED: 22.10.2015 09:19:52
+# REVISION: ---
+#===============================================================================
+
+use strict;
+use warnings;
+use utf8;
+
+binmode (STDIN, ":encoding(UTF-8)");
+binmode (STDOUT, ":encoding(UTF-8)");
+binmode (STDERR, ":encoding(UTF-8)");
+use open ":encoding(UTF-8)";
+
+
+#-------------------------------------------------------------------------------
+# Variabelen Deklarasion
+#-------------------------------------------------------------------------------
+my $longString;
+
+#open file
+my $opfp_file_name = 'Rilke-Herbsttag.txt'; # input file name
+
+open my $opfp, '<', $opfp_file_name
+ or die "$0 : failed to open input file '$opfp_file_name' : $!\n";
+
+
+ while(my $line = <$opfp>)
+ {
+ $longString = $longString . $line;
+ }
+
+
+
+#close file
+close $opfp
+ or warn "$0 : failed to close input file '$opfp_file_name' : $!\n";
+
+print $longString;
+