in reply to Use of uninitialized value for file name
Update:...but that won't explain why you get an initialization error.
For example
prints#!/usr/bin/perl use warnings; use strict; opendir(DIR_A, './testdir') or die $!; while (my $job = readdir(DIR_A)) { print "$job\n"; if ($job =~ /something/) { print "Something was seen\n"; } }
when testdir is empty, and prints. ..
when testdir contains the file something.pl.. .. something.pl Something was seen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |