From f08f2d0e3798ff90b7e68c46751e15b7b991a2a0 Mon Sep 17 00:00:00 2001 From: Martin Talarczyk Date: Fri, 13 Nov 2015 12:17:15 +0100 Subject: Commitel Aufgabe 1 bis 4 --- Aufgabe2/EinString.pl | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Aufgabe2/EinString.pl (limited to 'Aufgabe2/EinString.pl') 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; + -- cgit v1.2.3-70-g09d2