Hi,
I want to determine if a directory is empty and delete it.
I have tried
if ( -d $dd && -z $dd)
but that doesn't seem to work. Does -z work
only with plain files?
Should I read the directory and if it contains only . and .., determine that
is empty? It must be an easier way than that. Any
Without being able to debug the code, I can only take an educated guess.
You are declaring $string on the same line on which you are performing your
pattern match.
If the pattern does not produce a result, $string will remain ( or become )
uninitialized.
This would produce the exact error that
I've several of those in the file that have only keys but no values.
This
could be problematic. Is there a way, I can flag these while filling the
hash up?
Thanks,
perdeep
-Original Message-
> use strict;
> use warnings;
>
> my %defln = ();
>
> while (my $line = ) {
>chop(
I've several of those in the file that have only keys but no values. This
could be problematic. Is there a way, I can flag these while filling the
hash up?
Thanks,
perdeep
-Original Message-
From: John Bernard [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 30, 2002 3:37 PM
To: 'Mehta
No! this did not change the behavior.
perdeep
-Original Message-
From: Trevor Joerges [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 30, 2002 3:55 PM
To: Mehta, Perdeep; [EMAIL PROTECTED]
Subject: Re: [Perl-unix-users] Perl help
Your printing to a filehandle OUT. What do you need t
Your printing to a filehandle OUT. What do you need the greater than symbol
before the $string for? If you are trying to print a literal greater than
string you will need to escape it "\> $string\n" otherwise just print
"$string\n".
Hope this helps.
Trevor Joerges
SendMIME Software
www.sendmime.
Hi All,
I would appreciate any help on the following code.
Here I fill the defln hash with the appropriate keys and values:
use strict;
use warnings;
my %defln = ();
while (my $line = ) {
chop($line);
if ($line =~ /^$/) {
next;
}
else {
my
Hi Kobby,
The first is fairly straightforward:
@files = grep -d, <$your_filespec> ;
The second requires a module:
use File::Path ;
rmtree $your_dir ;
hth,
Craig Arnold
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, Sept
Hi,
I Luc Novales, engineer at system administration service in C.E.N.A.
I'm a newbee with perl and I have a problem of compatibility with perl
5.8.0 on Solaris 8.
Using internal "perlgrent" function to get groups informations in NIS
tables, long lines (941 characters) exit the data aquisition.