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

Re: [MacPerl] Using Mac NDBM files with Unix Perl




Stephane Jose <jose.stephane@uqam.ca> writes:

}Ë 14:03 -0400 06/04/97, Roger Espinosa nous disait:
}
}> On Sat, 5 Apr 1997 16:20:53 -0800 (PST) jerry@pwa.acusd.edu (Jerry Stratton)
}> wrote:
}>
}> >I'm trying to upload some MacPerl NDBM files to my Unix site for web
}> >use. Do I need to do some sort of conversion? My MacPerl databases are
}> >single file; Unix Perl seems to expect ".pag" and ".dir" files.
}> >
}> >What do I need to do to my MacPerl NDBM files to use them on Unix?
}> >
}>
}> On the UNIX side, you need to say
}>
}>      use DB_File;
}>
}> before doing any "dbm" accessing -- that way, UNIX will expect the same
}> database files as you're making on the Mac (as long as you transfer in
}> binary, etc)
}>
}> DB_File requires the "Berkeley DB" library to be installed on your system.
}> If you don't have that installed, you won't be able to do this.
}>
}> Roger
}
}Hi,
}
}I followed this mail exchange with great interrest since I've been
}unsuccessfully trying to use MacPerl created dbm files on a Unix server (I
}develop my scripts with MacPerl then port everything to a Unix server).
}
}I locally installed the DB_File.pm module, unshift it to @INC, then
}I tried to 'use DB_File' but the server errors seem to indicate that
}someting is missing:
}
}> Can't load module DB_File, DynaLoader not linked into this perl at
}>/weblink/gescom/cgi-bin/librairies/DB_File.pm line
}> 249
}>
}> [Mon Apr 7 11:07:51 1997] access to
}>/weblink/gescom/cgi-bin/_testDBMunix.pl failed for g2345.258.interlink.net,
}> reason: malformed header from script
}
}Since I'm not even sure the Berkeley DB library is installed (my ISP is not
}too cooperative - I know, I could change ISP, but it is not that simple...)
}I am a bit confused. Can I install the Berkeley DB library locally knowing
}that I simply have ftp access to the Unix server (no telnet)?
}
}I really need to find a solution to transparently exchange dbm files
}between Mac and Unix. Any Suggestions?

I've dealt with similar problems many times in the past, transferring
binary floating point data between platforms.  When dealing with binary
files on two different machines that are in formats that you either know
are incompatible or aren't sure are compatible, the best way is to convert
to something you know both machines can read and write, text.  The text
doesn't necessarily have to be human usable.  It just has to be in a form
that you can use to recreate the binary file on either machine.

In this case, there's probably already a solution: Data::Dumper, which
seems to be designed for this task.  Go to any CPAN archive and get a hold
of it.  You'll want the Dumper.pm.NOXSUB for MacPerl, and probably for your
Unix machine.  If your ISP lets you put CGI's on his machine by ftp, then
you'll probably be able to use it.  Otherwise, it's going to be difficult
unless your ISP has an ftp server that lets you execute arbitrary commands.
Telnet access would be preferrable.


}
}Thanks in advance for any tips or pointers.
}Regards
}
}StŽphane
}
}	___________________________________________________
}	G    E    S    C    O    M  Info:Communication  Inc
}	___________________________________________________
}		   4 0 0 8,   r u e   R o s s
}		   V e r d u n  (Qc)   CANADA
}		   H 4 G   1 Y 4
}	___________________________________________________
}	tel: (514) 762-1958         http://www.gescom.qc.ca
}	fax: (514) 762-4296        mailto:info@gescom.qc.ca
}	___________________________________________________


---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us