- or download this
$ perl -MO=Deparse -e '<*>'
use File::Glob ();
glob('*');
-e syntax OK
- or download this
foreach $file (@files) {
open FH, $file or
die "Error opening $file: $!\n";
- or download this
for my $file (@files) {
open my $fh, '<', $file or
...
# ...
# no need for an explit close()
}
- or download this
$ cat foo.pl
#!/usr/bin/perl
...
$ cat foo.pl
Gotcha!
- or download this
elsif ( data =~ /^\x89PNG\x0d\x0a\x1a\x0a/) {
type = 'PNG';
}