Hello Rich,

Friday, July 13, 2001, Busse, Rich <[EMAIL PROTECTED]> wrote:

BR> In C, I can do something like this:

BR>         char ch ;
BR>         char sz [] = "?:\\dir\\myfile.ini" ;
BR>         for ( ch = 'c' ; ch <= 'z' ; ch++ )
BR>         {
BR>                 sz[0] = ch ;
BR>                 . . . 

BR> to spin thru all the possible drives on a Windows NT box. But Perl complains
BR> about trying to compare/increment a non-numeric. Any way around this?
well... it's not a perl way :)
in perl, you can write something like this:

my $path= ":\\dir\\myfile.ini" ;
for my $d ( 'a'..'z' )
{
 my $fullpath= $d.$path;
 ....
}

BR> Also, to look at each character in a string, I can do:

BR>         int i ;
BR>         char sz [] = "A string" ;
BR>         for ( i = 0 ; i < strlen (sz) ; i++ )
BR>         {
BR>                 ch = sz [i] ;
BR>                 . . .

BR> How do I access each character in a string with Perl? TIA... 

perldoc -f substr


Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]


Reply via email to