All,
Thanks for the help from everyone!
I would apologize for my careless when I post my code, the left single
quote around the # was missed when I cut and paste.
the shortname does work as everyone expected. But I have to do more
work from the code who calls this oneliner in order to get the short
name. I was thinking use the Win32's GetShortName(), unfortunately,
the old version Perl I have does not have this call. So I end up with
converting the long name to short name.
Thanks again.
Xu
Mina Naguib <> wrote in message news:<XfkOa.36870$ >...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Xu Yang wrote:
> > Hi,
> >
> > I have an oneliner Perl script (see below) works fine when the path
> > name is 8.3 format on Win2K, but failed after it operated on a path
> > name contains space:
> >
> > c:\perl -e "while(<>) {if(/^define/){print $ARGV.#'.$_;}}" c:\usr\*.tt
>
> A shorter version of this is:
>
> perl -ne 'print "$ARGV.#$_" if /^define/'
>
> > If I change the "c:\usr" to "c:\program files", it failed with error:
> > Can't open c:\program files\*.tt.
> > I double quote the path, did not help either.
>
> I'm not 100% sure how filename globbing works under windows' shell, but try the old 8.3
> compatability naming, it might work:
>
> c:\progra~1\*.tt
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQE/CdB4eS99pGMif6wRAiJ4AJ9A2RRreI7fIl5HjNscETWpUsUOyQ CdEdBT
> dlH3Nu72i4G3/IYh9YCJ+fc=
> =k2QF
> -----END PGP SIGNATURE-----