Thread while bzw. Datei durchsuchen, Hilfe gesucht (14 answers)
Opened by optron at 2008-04-29 01:48

renee
 2008-04-29 13:19
#108979 #108979
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Ja:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
rbaecker@test ~ $ vi local.pl
#!/usr/bin/perl

use strict;
use warnings;

$_ = 'hallo';

print;

while( <DATA> ){ chomp }

print;

__END__
test
rbaecker@test ~ $ perl local.pl
Use of uninitialized value in print at local.pl line 12, <DATA> line 2.
hallo


vs.

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
rbaecker@test ~ $ vi local.pl
#!/usr/bin/perl

use strict;
use warnings;

$_ = 'hallo';

print;

while( local $_ = <DATA> ){ chomp }

print;

__END__
test
rbaecker@test ~ $ perl local.pl
hallohallo
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread while bzw. Datei durchsuchen, Hilfe gesucht