-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jay Savage a écrit :
> On 2/16/06, David Prévot <[EMAIL PROTECTED]> wrote:

[...]

>>I have a program that works with Linux and want it to be used with W$.
>>It puts a big Hash (~1,500,000 keys) in a db in order to be used by an
>>other program, the same lines in each program to call it:
>>
>>my (%tableville);
>>dbmopen(%tableville,"tablebis",0644) or die($!);

[...]

>>The problem is the format of the database : it is not the same for Linux
>>and Active Perl...
>>My question is : is there a db format I can use with Linux and Active
>>Perl ? If yes, how can I call it with the tie() function ? (I made some
>>try but I coudn't make it work under W$).
>>
>>I tried a part of my programs under W$, it works, but I would prefer not
>>to calculate a W$ version and a Linux version (and perhaps a Mac
>>version) of the database, that tooks about one hour to calculate with a
>>non graphical terminal (I have no idea how much time it would take under
>>W$, but I'm afraid it would bug before it ends).
>>
>>Sorry if my English is not good, I would accept reply in French ;)
>>
>>Thanks in advance.
>>
>>David
> 
> 
> What's the problem? You haven't given us an error message. The sample
> code works fine on both platforms for me.
> 

Your right, it works in an Independant way. But there is no error
message, and no results when I want to share the same database (sorry if
I wasn't clear enough in my explenations).

> If you're trying to share the same database file between platforms,
> that's a different story. Different OS use different DBM by default.
> Linux uses GDBM, Windows uses--I think--NDBM or SDBM, and OS X
> probably uses NDBM or GDBM. The way around this is to make sure you're
> losing the lowest common denominator DBM, SDBM, which is the slowest
> and least versatile of the options, but is included with the deafult
> Perl installation on all platforms.
> 
>     use SDBM_File;
>     dbmopen(...);
> 

That works on a little try, I am going to calculate the big database I
want to use with this option to validate it on my computer.

> You may still have problems with encodings and line-endings, and
> you'll have issues switching between different processor types,
> because most DBM implentations are byte-order specific. An intel
> machine, whether BSD, Windows or Linux, can't read a dbm files from
> PPC machines, whether they're running OS X or Linux. The only truly
> portable DBM code would use DB_File, but you'll have to make sure that
> Sleepycat's DB is installed in a standard location on every machine
> you want to run the script.
> 
> Your best bet is going to be using something like MySQL, Postgres, or
> even SQLite, which are designed to be architecture-independant.
> 

I want this program to be used by different persons that doesn't use
Perl, I think it would be enough difficult to make them install Active
Perl. That's why I am looking for a simple way to do it, even if that's
a bit longer to execute. I gonna test if it's not to long...

> HTH,
> 
> -- jay
> --------------------------------------------------
> This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
> private and confidential

Thanks for all

David
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD9RJm18/WetbTC/oRAkVPAJ0U/kj+jJtIg+xhGnHC9B8rS3CCdwCdFlMs
IhMqKCGi0AuekRs9xfSz2dg=
=WRub
-----END PGP SIGNATURE-----


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to