>>> "Brett W. McCoy" <[EMAIL PROTECTED]> 2/5/2002 10:35:48 AM >>>
>
>That's just more a matter of style -- I get the willies when subroutines
>modify global values invisibly.
Great advice. thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Tue, 5 Feb 2002, John Mooney wrote:
> Actually, it is not an incorrect way I believe, so much as he is using
> slightly incorrect syntax. From the Nutshell ...
I really meant 'incorrect' in its usage, not the syntax -- he was using it
in a void context.
> ... I think the key is that he was
>>> "Brett W. McCoy" <[EMAIL PROTECTED]> 2/4/2002 9:28:42 PM >>>
>>On Mon, 4 Feb 2002, david wright wrote:
>>
>> i can't use the ternary operator like this? (damn waste if not) thanks.
>>
>> foreach $dup (@array){
>> (-d $dup) ? print "yes: $dup \n": print "no: $dup \n";
>> )
>
>Yes, that i
On Feb 4, Brett W. McCoy said:
>On Mon, 4 Feb 2002, david wright wrote:
>
>> i can't use the ternary operator like this? (damn waste if not) thanks.
>>
>> foreach $dup (@array){
>> (-d $dup) ? print "yes: $dup \n": print "no: $dup \n";
>> )
>
>Yes, that is an incorrect way to use the ?: op
On Mon, 4 Feb 2002, david wright wrote:
> i can't use the ternary operator like this? (damn waste if not) thanks.
>
> foreach $dup (@array){
> (-d $dup) ? print "yes: $dup \n": print "no: $dup \n";
> )
Yes, that is an incorrect way to use the ?: operator -- the operataor is
handed an expr
David Wright wrote:
>
> i am sending @array a directory (i.e. example /usr/dw5) which contains a
> lot of files and folders (directories).
> (i have already checked the value of @array and $dup and they are as
> desired.) What i want to accomplish is: print yes, "$dup (file name)" if
> it's a dir
On Monday, February 4, 2002, at 07:26 PM, Jeff 'japhy' Pinyan wrote:
> On Feb 4, david wright said:
>
>> i am sending @array a directory (i.e. example /usr/dw5) which
>> contains a
>> lot of files and folders (directories).
>
> Be warned that readdir() returns NAMES, not PATHS.
>
> opendir DI
On Feb 4, david wright said:
>i am sending @array a directory (i.e. example /usr/dw5) which contains a
>lot of files and folders (directories).
Be warned that readdir() returns NAMES, not PATHS.
opendir DIR, "/some/dir";
@files = readdir DIR;
closedir DIR;
@files will contain (".", ".."
On Monday, February 4, 2002, at 06:57 PM, Timothy Johnson wrote:
>
> Did you chdir to the directory? Otherwise your script might be
> checking the
> wrong directory.
>
> opendir(DIR,"/mydir");
> @array = readdir(DIR);
> chdir "/mydir";
> foreach $dup (@array){
> (-d $dup) ? print "yes: $d
Original Message-
From: david wright [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 5:51 PM
To: [EMAIL PROTECTED]
Subject: file test doesn't seem to be working
i am sending @array a directory (i.e. example /usr/dw5) which contains a
lot of files and folders (directories).
(i have
i am sending @array a directory (i.e. example /usr/dw5) which contains a
lot of files and folders (directories).
(i have already checked the value of @array and $dup and they are as
desired.) What i want to accomplish is: print yes, "$dup (file name)" if
it's a directory (folder) i am testing i
11 matches
Mail list logo