#!/usr/bin/perl use strict; use warnings; my $datei='test.txt'; if( open(my $fh, '<', $datei) ) { print "Datei gefunden!\n"; while(my $line= <$fh> ) { print "ZEILE $.: $line"; } close($fh); } else { die "Error: couldn't open file '$datei': $!\n"; }