in reply to __DATA___ File Handle
It is a way of using data that is directly placed inside of the script within the __DATA__ section of the file.
It works like a filehandle but does not need to be opened or closed.
For example,
use strict; use warnings; while (<DATA>) { # works just like a file my $line = $_; # removes line feed chomp($line); # ..... add your code here print "LINE: $line\n"; } __DATA__ Line 1 Line 2 Line 3 Line 4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: __DATA___ File Handle
by si_lence (Deacon) on Aug 13, 2009 at 10:35 UTC | |
by ikegami (Patriarch) on Aug 13, 2009 at 13:31 UTC |