- or download this
open(FILE, "<file.txt");
my @thing = <FILE>;
...
push @crap,$_;
}
}
- or download this
open(FILE, "<file.txt");
while(local $_ = <FILE>) {
...
}
}
close FILE;
- or download this
open(FILE,"<file.txt");
my $template = '';
...
$template .= $line;
}
close FILE;
- or download this
my $template = '';
open(FILE, "<file.txt") && while($template .= <FILE>) {};
close FILE;
die "bad stuff happened" unless length $template;