Bundle::Xmms

2002-08-29 Thread Tor Hildrum

I have installed Bundle:Xmms, and I'm pretty sure it went okay.

Going to read n/sources/modules/03modlist.data.gz
Term::ReadKey is up to date.
Term::ReadLine::Perl is up to date.
Term::ANSIColor is up to date.
MPEG::MP3Info is up to date.
Xmms is up to date.

But, when I try to use it, I get error messages like this:

Perl error: Can't locate auto/Xmms/Remote/get_playlis.al in INC(INC
contain: /sw/lib/perl5/darwin /sw/lib/perl5 /sw/lib/perl5/darwin
/sw/lib/perl5 /System/Library/Perl/darwin /System/Library/Perl
/Library/Perl/darwin /Library/Perl /Library/Perl
/Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .)
at (eval 59) line 13

[hildrum:~/] tor% cd /Library/Perl/darwin/auto/Xmms/Remote
[hildrum:auto/Xmms/Remote] tor% ls
Remote.bs   Remote.bundle

Here is the code:

$xmms_remote = Xmms::Remote-new();

sub xmms {
  $title = $xmms_remote-get_playlist_title;
  $artist = $xmms_remote-get_playlist_artist;
  $song = $xmms_remote-get_playlist_song;
  $time = $xmms_remote-get_playlist_time;
  print ...;
}

Anyone used this module, or have any answers/hints?

Tor




Re: Reading a file in- different in MacOS X?

2002-08-10 Thread Tor Hildrum

[EMAIL PROTECTED] wrote:

 Hi all,
 
 My scripts, which are running perfectly well on a Win2000 webserver, do not
 function correctly under MacOS X.
 
 The first thing I've been able to identify that is malfunctioning is the
 standard file reading process I've always used:
 
 while(FILE){
 push (@array,$_);
 }
 
 print $array[1];  ##prints the second line of file
 
 For some reason MacOS X reads the entire file in to $array[0] the first time
 round, instead of putting one line per array element.
 
 Has anybody else had this problem?

[localhost:~] tor% perl -e 'while(){push(@array,$_)} print \$array\[1\]:
$array[1];'
first line # my input
second line # my input
third line  # my input + ^D
$array[1]: second line
[localhost:~] tor% 

I never had any problems with this.
Mac OS X 10.1.5, Perl 5.6.0

Tor




Re: Reading a file in- different in MacOS X?

2002-08-10 Thread Tor Hildrum

[EMAIL PROTECTED] wrote:

 [EMAIL PROTECTED] wrote:
 
 Hi all,
 
 My scripts, which are running perfectly well on a Win2000 webserver, do not
 function correctly under MacOS X.
 
 The first thing I've been able to identify that is malfunctioning is the
 standard file reading process I've always used:
 
 while(FILE){
 push (@array,$_);
 }
 
 print $array[1];  ##prints the second line of file
 
 For some reason MacOS X reads the entire file in to $array[0] the first time
 round, instead of putting one line per array element.
 
 Has anybody else had this problem?
 
 [localhost:~] tor% perl -e 'while(){push(@array,$_)} print \$array\[1\]:
 $array[1];'

Forget this, the problem is probably the line-endings used in the file.
:)

Tor




Perl/Tk, RTFM didn't work :(

2002-07-01 Thread Tor Hildrum

I've read the archives and felt confident that I should get this to work,
but I don't :(

I grabbed dyld from http://www.lehigh.edu/Macintosh/X/ptk/dyld-tk, replaced
it with the old dyld. Forgot to change the permissions, and had to install
OS X on a separate partition to change the permissions back :)
Then grabbed TK800.024 from CPAN, and edited MMutil.pm

Doesn't work though.

dyld: perl multiple definitions of symbol _LangExit
/Library/Perl/darwin/auto/Tk/Event/Event.bundle definition of LangExit
/Library/Perl/darwin/auto/Tk/Tk.bundle definition of _LangExit

Is the error message.

Should I try reinstalling Tk? Replacing /usr/lib/dyld? Or is there maybe
some quick fix I can do?

Tor




Re: Perl/Tk, RTFM didn't work Solved

2002-07-01 Thread Tor Hildrum

[EMAIL PROTECTED] wrote:

Replying to my own message

 I grabbed dyld from http://www.lehigh.edu/Macintosh/X/ptk/dyld-tk, replaced
 it with the old dyld. Forgot to change the permissions, and had to install
 OS X on a separate partition to change the permissions back :)
 Then grabbed TK800.024 from CPAN, and edited MMutil.pm
 
 Doesn't work though.
 
 dyld: perl multiple definitions of symbol _LangExit
 /Library/Perl/darwin/auto/Tk/Event/Event.bundle definition of LangExit
 /Library/Perl/darwin/auto/Tk/Tk.bundle definition of _LangExit

Jerry Levan gave me a hint that you had to set some environment variable for
it to work. I didn't really see it mentioned in any previous mail to the
group, and it wasn't mentioned on
http://www.lehigh.edu/~sol0/Macintosh/X/ptk/dyld-tk.
You have to set the DYLD_ALLOW_MULTISYMS variable in your shell for dyld to
accept the multiple definitions of _LangExit.

Oh well, it finally works for me as well :)

Tor




Re: Serial ports?

2002-06-24 Thread Tor Hildrum

 Has anyone tried accessing serial ports from perl?

I tried accessing a USB-port.
 
 I tried installing Device::Serial and it crashes hard  (text is
 printed on the screen as if it was a console indicating it is waiting
 for the remote debugger to attach).

snip

 Somewhere around test 85 the Mac crashes badly.  Even from user mode.

That is strange. The kernel shouldn't really panic, unless you where running
this process in kernel space. Trying to access an I/O port or
hardware-mapped memory shouldn't give you a kernel panic from user space.
The kernel should just reject it, and send a signal to your process.
 
 I don't know if this crash would affect different serial ports or
 non-SUB serial ports or whatever.
 
 Any thoughts?

I think you have to use a device driver.
Or you need to make your script run in kernel space, you can't access any HW
from user space. 

http://developer.apple.com/techpubs/macosx/Darwin/IOKit/IOKitFundamentals/Ab
out/index.html

Tor




Re: Serial ports?

2002-06-24 Thread Tor Hildrum

 On another Mac with a built in serial port I am just reading/writing
 from /dev/cu.modem and it is working fine.

Running Mac OS X?
From my understanding, that shouldn't be possible. Unless you are using some
kind of ioctl call.

Tor




Re: DBI

2002-05-02 Thread Tor Hildrum

 Does any one have any tips for installing perl modules
 
 I have tried to install the DBI module using CPAN and manually, but both
 times I cannot seem to get then to connect up?
 
 Thank you
 
 roland
 
 What DB are you using and is set up properly? If MYSQL what version
 are you running? I'm using the eSuite4X MYSQL3 and DBI installed fine
 from cpan, not sure if I tinkerd with it manually or not though.

I installed MySQL from fink, and DBI and DBD:mysql from CPAN without
problem.
I didn't really 'answer' any of the questions while installing DBI either.
Just hitting enter all the way(You might choose to actually read the
questions). But, it is working flawless for me. :)

Tor