Re: CPAN modules ...

2006-01-01 Thread Ken Williams


On Dec 31, 2005, at 7:43 PM, John Delacour wrote:


At 6:49 pm -0500 31/12/05, Chris Devers wrote:


On Sat, 31 Dec 2005, John Delacour wrote:

 print `/usr/bin/./printenv`

  ^^

Why the '/./' here?

Isn't `/usr/bin/printenv` equivalent, clearer, and simpler?


Sure, but I didn't get that far.  printenv works in tcsh without the 
path but not in bash, so I tried that in bash, it worked and voilĂ .




That's because in tcsh it's a built-in shell command, but in bash it 
invokes /usr/bin/printenv.  For some reason you seem not to have 
/usr/bin in your path or something.


 -Ken



Re: OT: wget question

2006-01-01 Thread David Ledger
The OS is Unix-like, but the filesystem is not. The 'real' directory 
path delimiter is ':' not '/'. OSX makes a good job of presenting ':' 
as '/' and accepting '\' as ':' where it should. Maybe working though 
URL-encoding is one case where it or wget gets lost.


David


At 21:27 +1100 31/12/05, John Horner wrote:
I hope you don't mind me asking a wget question. I have a feeling it 
may hang on some Mac-specific issue which I'm not getting.


I'm trying to download http://www.guardian.co.uk/pda/avantgo/ for 
offline reading. I'm using wget's --restrict-file-names flag to make 
sure that problem characters aren't written to file names.


Some of the links, for instance Top Stories, still don't work when 
browsing the files.


I'm following a link to:

file:///path/to/0,11725,ID%5E3983240;NAME^Top+stories,00.html

but Firefox can't access it.

The file is there, as

file:///path/to/0,11725,ID%5E3983240%3BNAME%5ETop+stories,00.html

where the colon and caret have been URL-encoded.

Is this a bug in wget? It's sanitising the filename but not linking 
to it correctly?


I'm asking here because someone may know the answer, but also 
because --restrict-file-names=unix is supposed to fix all problems 
with filenames on Unix-like OS'es according to the manpage.


--
David Ledger - Freelance Unix Sysadmin in the UK.
Chair of HPUX SysAdmin SIG of hpUG technical user group (www.hpug.org.uk)
[EMAIL PROTECTED]
www.ivdcs.co.uk


Re: CPAN modules ...

2006-01-01 Thread Vic Norton
This has been an interesting discussion but, unfortunately, my first
question about getting CPANPLUS to work is nowhere near resolved. I'll
have to do a bit more research in that area.

As for the second question about setting up my BBEdit environment, Doug
McNutt's solution of putting everything I need in
   $HOME/.MacOSX/environment.plist
has worked perfectly. After reading through BPRuntimeConfig.pdf from
the Apple developer site I thought I could even be more BBEdit specific
and put its environmental stuff in an LSEnvironment dictionary in
   /Applications/BBEdit.app/Contents/Info.plist
-- but that didn't seem to work.

Thanks to everyone for all the advice.

Regards,

Vic

On 12/31/05, at 10:17 PM -0600, Ken Williams wrote:

On Dec 31, 2005, at 7:43 PM, John Delacour wrote:

 At 6:49 pm -0500 31/12/05, Chris Devers wrote:

 On Sat, 31 Dec 2005, John Delacour wrote:
  print `/usr/bin/./printenv`
   ^^

 Why the '/./' here?

 Isn't `/usr/bin/printenv` equivalent, clearer, and simpler?

 Sure, but I didn't get that far.  printenv works in tcsh without the 
 path but not in bash, so I tried that in bash, it worked and voilĂ .


That's because in tcsh it's a built-in shell command, but in bash it 
invokes /usr/bin/printenv.  For some reason you seem not to have 
/usr/bin in your path or something.

  -Ken



Re: Foundation in Perl script

2006-01-01 Thread Sherm Pendley

On Dec 28, 2005, at 9:09 PM, Manfred Bergmann wrote:


The toll-free bridge also includes something like this?
my $str = NSString-stringWithString(astring);

where with PerlObjCBridge you have to use this:
my $str = NSString-stringWithCString_(astring);


Yes - strings are bridged both ways. Although, tied objects aren't  
passed or returned, just copies. Because Perl's native string- 
handling is generally more useful from within Perl scripts than  
NSString's methods, the default for methods that return NSString  
objects is to return them as string scalars. So the $str in the above  
wouldn't be a blessed NSString object reference, just an ordinary  
scalar.


You can get NSString objects if you want, by setting  
$CamelBones::ReturnStringsAsObjects to a non-zero value. You can use  
local() to localize the change, like this:


my $str;
{
local $CamelBones::ReturnStringsAsObjects = 1;
$str = NSString-stringWithString(aString);

# $str is an NSString object
}

	# After the local() above falls out of scope, ReturnStringsAsObjects  
reverts back to its

# old value. So, this method returns a scalar string, not an object.
print $str-uppercaseString();

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org