Stuart Arnold <mailto:[EMAIL PROTECTED]> wrote: >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of >> Brian Raven >> Sent: Thursday, February 28, 2008 5:03 AM >> To: [email protected] >> Subject: RE: Determine the OS >> >> >> Rolando A Ampuero <> wrote: >>> I need to determine the type of OS/Architecture that a script is >>> running on. >>> >>> Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is there >>> a clever way in Perl to find this out without doing a system call? >> >> The special variable $^O will probably not be suitable for that level >> of detail, so see 'perldoc Config'. >> >> HTH> For windows, its quite a mess! > You can start by looking at 'Win32.pm' and the function > 'Win32::GetOSVersion()' > But that will get you only so far. > > You may want to look at how to get some of Windows internals by > getting 'ScriptomaticV2.hta' from MS to see some internals. > > Not sure of *NIX ways.
Hmmm... my original post missed the point that the OP was interested in the platform that the script was running on (I blame lack of caffeine). The Config module is created at build time, so its information may not be accurate at run time (e.g. you could have a 32 bit build running under a 64 bit OS). Getting detailed information about the platform on which a script is actually running is going to be platform specific, and it is almost certainly going to involve system calls, or running external commands (e.g. the uname command on *nix). I suppose that the 'clever' answer would be avoid write scripts that need to know that (see 'perldoc perlport' perhaps)! HTH -- Brian Raven ========================================= Atos Euronext Market Solutions Disclaimer ========================================= The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions. Atos Euronext Market Solutions Limited - Registered in England & Wales with registration no. 3962327. Registered office address at 25 Bank Street London E14 5NQ United Kingdom. Atos Euronext Market Solutions SAS - Registered in France with registration no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris France. L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions. Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank Street E14 5NQ Londres Royaume Uni. Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France. ========================================= _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
