On Tue, 28 Feb 2006, John W. Kennedy wrote:
> -alpha- wrote:
> > Hi all.
> >
> > got some code:
> > #! -*- perl -*-
> >
> > opendir(DH,'C:\install\_import\Temporary Internet Files') && (@d =
> > readdir(DH)) && closedir(DH) && print join("\n",@d);
> >
> > get this output:
> >
> > C:\>pl.pl
> > .
> > ..
> > Content.IE5
> > desktop.ini
> > C:\>
> >
> > I'm pointless why... there is more than 35 000 files. Could anyone
> > please give me a hint?I have no idea; it works for me (with a different directory name though). I do get the names of all subdirectories in this folder. > Never, ever, ever use '\' to separate directories in a program written > in /any/ language. Use '/'. '/' will always work, and it will avoid the > problem you're seeing, which is caused by the fact that '\' is being > interpreted in your directory name just as it is in any other character > string. This is not true. Backslashes work just fine in single-quoted strings in Perl (you need to escape them in front of single quotes, and before the end of the string, but otherwise they are fine). > You /could/ use 'C:\\install\\_import\\Temporary Internet Files' to get > what you want, but it's stupid. Strong words for wrong or at least misleading advice. Please play nice! Cheers, -Jan _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
