[Thread Prev][Thread Next][Thread Index]
Re: Strings with spaces
- To: Alan.Harder@Ebay (Alan Harder)
 
- Subject: Re: Strings with spaces
 
- From: Jim Nicholson <jim@xxxxxxxxxx>
 
- Date: Tue, 28 Jul 1998 23:26:53 -0400 (EDT)
 
- Cc: Pilot Manager <pilotmgr@xxxxxxxxxxxxxxxxxxxx>,        Ernie Brouwer <ebrouwer@xxxxxxxxxxxxxxxxxxxxx>
 
- In-reply-to: <199807281633.JAA11888@moshpit.EBay.Sun.COM>
 
- References: <199807281633.JAA11888@moshpit.EBay.Sun.COM>
 
- Reply-to: jim@xxxxxxxxxx
 
Ok, and here's a hint: perl's glob function/operator does NOT like
filenames with spaces. So look for 
   @list = <$SOMEDIR/*>
constructs.
I've got an Installer.pm now that replaces these with a function call
to a little routine I wrote to use opendir/readdir to build the list;
interestingly, 
  
   opendir FOO $SOMEDIR
   @list = readdir FOO;
handles the names with spaces ok. What it doesn't do that glob does is 
lose the '.' and '..' for you.
My Installer patch isn't quite ready - I'm getting segfaults on
PDA::Pilot::File::open, which means I've got to start digging
there. Also, I was lazy and added File::Basename to the "use" list; is 
this a problem for those still using perl 5.003? My perl is a debian
package, and I'm unsure what's base library vs. modules debian
includes that aren't base.
- Jim
Alan Harder writes:
 > > Has anyone else noticed that a lot of the conduits for PilotManager
 > > are not handling strings with embedded spaces well? I'm particularly
 > > seeing it in "Installer" and "Sync Memo". For example:
 > ...
 > > Before I start tackling the code, are these known problems? Has anyone 
 > > fixed them?
 > 
 > known? yes.. found time to fix? nope! :(
 > It would be great if you could look into these!  Please start with Installer.
 > If I find time I will do SyncMemo.. but if I don't get to it maybe you could
 > fix that one up too..
 > Send me the patches and I'll put out new versions..
 > 
 > thanks!!
 > 
 > 	- Alan
 >