in reply to Re: read and link !
in thread read and link !

my $dir = "c:\\temp\\";

For the benefit of any who might not know: You don't need to use backslashes when running on a Windows machine; Perl will do the right thing and convert a forward-slash path delimiter to the appropriate delimiter for whatever platform it's running on. That way you don't have to backslash escape your backslashes. You can just write:

my $dir = "c:/temp/";

which is just a little easier and less error prone, not to mention makes your programs a little less platform-specific. : )

Jon

Replies are listed 'Best First'.
Re: Re: Re: read and link !
by jdporter (Paladin) on Oct 29, 2002 at 21:54 UTC
    Actually, it's not perl that does it. Forward slashes are recognized by Windows as equivalent to backslashes for purposes of path delimiting. It's only certain of the windows-based programs -- including the braindead command shell! -- that insist that forward slashes are only for indicating command-line options.
Re: Re: Re: read and link !
by roik (Scribe) on Oct 29, 2002 at 16:53 UTC
    Thanks for the tip!
    I can see it is useful in this and most other cases, but would it cause a problem if I wanted to concatenate $dir back with $_ and use it in a system call to DOS?
    i.e. Perl likes /, but does DOS?