[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] problem specifying path



At 10:22 PM -0500 2/15/00, Paul N. Schatz wrote:
>=3D09I am a MacPerl beginner.  I am having the following problem.  I am
>attempting to execute the following script:
>
>******************************
>#!Perl
>open (IN,  '  7500HD :Utilities:MacPerl =3D9F:README') or die;
>while ($line =3D3D <IN>) {
>=3D09print ($line);
>}
>close (IN);
>******************************
>
>=3D09The script doesn't work, and the reason is the blank spaces which
>occur in the name of my hard drive:  There are two blank spaces at the
>beginning and one at the end of "  7500HD ".  I know this is the problem
>because if I rename the hard drive "7500HD", i.e., I eliminate the spaces
>in the name, the script works.  However, if I do this renaming, other
>things break, for example various of my AppleScripts.  So I wish to retain
>this awful name which occurred a long time ago during a fit of stupidity.
>
>=3D09I have tried everything I can think of to get the script to work
>including:
>=3D09using backslash-space in place of each space;
>=3D09using the octal or hexidecimal equivalents of the ascii code for
>each space;
>=3D09using %20 for each space---which is what Netscape does;
>=3D09using Ctrl-V-space for each space;
>
>=3D09None of these work.  There must be a simple way to do this?

The simplest thing to do is to get used to using sysopen() all the=3D20
time, which doesn't do any of the whitespace ignoring that open() is=3D20
documented to do.  Read the documentation for open() to see what's=3D20
happening, but ignore the part where it tells you to put ./ in front=3D20
of the file name, because that won't work.  The next simplest thing=3D20
is to bite the bullet, rename your drive, and fix your AppleScripts.

>=3D09Paul
>--
>Paul Schatz
>Chem Dept
>University of Virginia

--
Paul Schinder
schinder@pobox.com

# =3D3D=3D3D=3D3D=3D3D=3D3D Want to unsubscribe from this list?
# =3D3D=3D3D=3D3D=3D3D=3D3D Send mail with body "unsubscribe" to macperl-re=
quest@macp=3D
erl.org