I am trying to install the File::Copy module from CPAN. I've already downloaded and unzipped the file to the Perl folder. C:\Perl\perl-5.8.6
How do I install this module? Thanks Liza -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Thursday, February 10, 2005 3:05 PM To: [email protected] Subject: ActivePerl Digest, Vol 13, Issue 10 Send ActivePerl mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit http://listserv.ActiveState.com/mailman/listinfo/activeperl or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of ActivePerl digest..." Today's Topics: 1. RE: Handling a uint16? (Brian Raven) ---------------------------------------------------------------------- Message: 1 Date: Thu, 10 Feb 2005 12:27:58 -0000 From: "Brian Raven" <[EMAIL PROTECTED]> Subject: RE: Handling a uint16? To: <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" [EMAIL PROTECTED] wrote: > Hi, list! > I know this is OT, but the Win32 list is ignoring my attempts to > subscribe... > > I'm working with Win32_VideoController, trying to get the > VideoArchitecture method. Unfortunately, that's one of several > methods that returns an unsigned integer (16 bit, in this case). > Here's my question: How can I manipulate a uint16 (or a uint32, for > that matter) so that it will work as the value in a "switch" > statement? That is... > > for ($obj->VideoArchitecture) { > /^(1)$/ && do { $arch = "Other", last }; > /^(2)$/ && do { $arch = "Unknown", last }; > /^(3)$/ && do { $arch = "CGA", last }; > . . . > $arch = "Whoopsie!" ; # DEFAULT > } Why the regex, and why the brackets if you don't use what they capture? If the values are numeric then the following would probably be better: $_ == 1 && do ... Also, '$obj->VideoArchitecture' doesn't look much like an array (given your 'if' statement below), so why the 'for' loop? > > When I try it, it doesn't even trip on the default! However, it does > work in the clumsy if-elsif-elsif-...-else structure: > > if ($obj->VideoArchitecture == 1) { > $arch = "Other"; > } elsif ($obj->VideoArchitecture == 2) { > $arch = "Unknown"; > } ... > > I'd just prefer getting the more elegant code working (mostly 'cuz > it's one of my favorite Perl thingies). A more 'perl-ish' way of doing this sort of thing would be to use a hash, e.g. my %arch_names = (1 => "Other", 2 => "Unknown", 3 => "CGA", ...); $arch = $arch_name{$obj->VideoArchitecture}; $arch = "Whoopsie!" unless defined $arch; Alternatively, if the values that you want to translate are all numeric, and essentially contiguous, you could use an array. However, if you really want to do it with a 'switch' statement you could start by: 'ppm install Switch' if it isn't already installed, then 'perldoc Switch' HTH -- Brian Raven ----------------------------------------------------------------------- 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 LIFFE Holdings Plc or any of its subsidiary companies. ----------------------------------------------------------------------- ------------------------------ _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs End of ActivePerl Digest, Vol 13, Issue 10 ****************************************** _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
