-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?
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.
You /could/ use 'C:\\install\\_import\\Temporary Internet Files' to get
what you want, but it's stupid.
Use 'C:/install/_import/Temporary Internet Files' instead.
The Windows command line uses '\' instead of '/' because Microsoft
didn't get the idea of making MS-DOS (and, later, Windows) into the
half-assed Unix clone it is until MS-DOS 2.0, and in 1.0, it had already
been established that '/' was used to mark command flags. (Today, some
programs still use '/' for the purpose, but many programs follow the
Unix tradition and use '-' [or sometimes '+'] instead.) But that is only
the command line; inside programs, '/' works just fine.
--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs