programming-examples/perl/String/The DATA Filehandle get the data from the same script.pl

36 lines
526 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#while(<DATA>){
# Do something with the data here
#}
#__DATA__
# The actual data
#Or you could use the $_ explicitly
#while($_=<DATA>){
# Do something with the data here
#}
#__DATA__
# The actual data
#Or use another variable instead of $_ as follows:
#while($inputline=<DATA>){
# Do something with the data here
#}
#__DATA__
# The actual data
while(<DATA>){
print if /A/; # Print the line if it matches A
}
__DATA__
A
B
I
N
J
K