Re: why is 0 first?

2005-12-27 Thread Dr.Ruud
Adriano Ferreira: > Using indices 0 .. n YM: 0 .. (n-1) -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to handle "\" indicating next line

2005-12-27 Thread Khairul Azmi
Hi all, I am writing a code that would check line by line content of a line before processing it. Problem occurs when there are lines that has character "\" indicating a new line. For example preprocessor http_inspect: global \ iis_unicode_map unicode.map 1252 When that happen, my code should

Re: why is 0 first?

2005-12-27 Thread Daniel Lord
And here I thought it was just because 0 comes before 1 ;-) On 27 Dec 2005, at 07:16, Adriano Ferreira wrote: I am curious what the reasoning behind the first element of something being zero is ($array[0]). I know I've read it before, but I can't remember. Thanks! Using indices 0 .. n ma

Digest::MD5 issues

2005-12-27 Thread James Turnbull
Hi all I am having some issues with CPAN. All of a sudden my Digest::MD5 modules says it is not installed. When I try to re-install it I get the following error: install Digest::MD5 Running install for module Digest::MD5 Running make for G/GA/GAAS/Digest-MD5-2.36.tar.gz Undefined subroutin

RE: bleh

2005-12-27 Thread Timothy Johnson
Let me see if I can pre-empt the inevitable flame war over posting an unsubscribe message to the list. At the bottom of just about every post (although strangely, not yours) is the address to send your unsubscribe command to: [EMAIL PROTECTED] To anyone else out there thinking of unsubscribing

RE: file :: find problem

2005-12-27 Thread Timothy Johnson
First of all, you're assuming a context that may or may not be there. You're assuming that the OP is creating a script that can be used on multiple operating systems, regardless of the file separator. In any case, it's good advice to use the '/' separator wherever possible, but to tell someone th

Re: [PATCH] Test that constant overloading is propagated into eval

2005-12-27 Thread Adriano Ferreira
On 12/26/05, Robin Houston <[EMAIL PROTECTED]> wrote: > +# Check that constant overloading propagates into evals As a further confirmation of the fact, the following one-liner (using bigint and eval with strings) that used to output $ perl -Mbigint -e "my $x = eval '1+2'; use Data::Dumper; pr

Re: why is 0 first?

2005-12-27 Thread Adriano Ferreira
>I am curious what the reasoning behind the first element of > something being zero is ($array[0]). I know I've read it before, but > I can't remember. Thanks! Using indices 0 .. n make it possible to work with them like offsets from the beginning of the array. More important from a C point

why is 0 first?

2005-12-27 Thread The Ghost
This isn't specifically a perl question. I am curious what the reasoning behind the first element of something being zero is ($array[0]). I know I've read it before, but I can't remember. Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

bleh

2005-12-27 Thread Welsh, Ed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 unsubscribe -BEGIN PGP SIGNATURE- Version: PGP Desktop 9.0.4 (Build 4042) iQEVAwUBQ7FXHlcLJH9lmXCIAQhsBggAqpJn3SiEwHMJMr3NW0GGs9HtXeg9N2ez iUrKyVjBSZJ9g9FICFm0P1PrTwZKZuxTBM0HbVhy1FYz5frgSCLdJhDWMvK53Ic8 cFROTCWNXQBSvL8KS0AfRhkO0LEu10N5j2CBx

RE: file :: find problem

2005-12-27 Thread Charles K. Clarkson
Timothy Johnson <[EMAIL PROTECTED]> almost bottom posted: : (quote from below): "The file separator in perl is '/', not '\\'" : : That's not necessarily true. Using '\\' as the file separator makes your script more platform dependent than using '/'. AFAIK, '\\' will not work in a unix or Ma

Re: maximum int value

2005-12-27 Thread Alon Marx
Works like a charm. Thank you all. On Tue, 2005-12-27 at 14:44 +0100, John Doe wrote: > Alon Marx am Dienstag, 27. Dezember 2005 14.30: > > Seems like a good solution for my needs, but how do I use it in a perl > > program instead of an inline command? > > > > For example, if I try to set a variab

Re: maximum int value

2005-12-27 Thread John Doe
Alon Marx am Dienstag, 27. Dezember 2005 14.30: > Seems like a good solution for my needs, but how do I use it in a perl > program instead of an inline command? > > For example, if I try to set a variable with such a value: > $a = (1<<$Config{ivsize}*8-1)-1; > > I get an error "Global symbol "%Conf

Re: maximum int value

2005-12-27 Thread Alon Marx
Seems like a good solution for my needs, but how do I use it in a perl program instead of an inline command? For example, if I try to set a variable with such a value: $a = (1<<$Config{ivsize}*8-1)-1; I get an error "Global symbol "%Config" requires explicit package name at" Thanks, Alon On

Re: maximum int value

2005-12-27 Thread swayam panda
I don't think so - Original Message - From: "Alon Marx" <[EMAIL PROTECTED]> To: Sent: Tuesday, December 27, 2005 5:28 PM Subject: maximum int value Is there a constant or a definition for a maximum number in perl? And the same question for a minimum value? Alon -- To unsubscribe, e

Re: maximum int value

2005-12-27 Thread Adriano Ferreira
On 12/27/05, Alon Marx <[EMAIL PROTECTED]> wrote: > Is there a constant or a definition for a maximum number in perl? And > the same question for a minimum value? This may work for you the biggest unsigned integer $ perl -e 'print ~0' 18446744073709551615 # 64-bit integers the maximum signed in

Re: maximum int value

2005-12-27 Thread Xavier Noria
On Dec 27, 2005, at 12:58, Alon Marx wrote: Is there a constant or a definition for a maximum number in perl? And the same question for a minimum value? You have some constants available through the %Config hash in Config.pm: % perl -MConfig -le 'print "$_ = $Config{$_}" for grep /size$/, key

maximum int value

2005-12-27 Thread Alon Marx
Is there a constant or a definition for a maximum number in perl? And the same question for a minimum value? Alon -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: sorting hash

2005-12-27 Thread Timothy Johnson
A variation on the same theme, for sorting by value instead of key: use strict; use warnings; my %hash = qw(1 A 2 B 3 C); foreach my $key ( sort {$hash{$a} <=> $hash{$b} } keys %hash ) { print "$key => $hash{$key}\n"; } -Original Message- From: Charles K. Clarkso

RE: read column into array

2005-12-27 Thread Timothy Johnson
How about something like this? I'm returning just the second element of the resulting list of using split() on $_. This shortcut for getting just one element of a list can be used on any function that returns a list. Naturally this is not the most efficient method, so your mileage may vary.

RE: file :: find problem

2005-12-27 Thread Timothy Johnson
(quote from below): "The file separator in perl is '/', not '\\'" That's not necessarily true. It depends on the module and the context. Many modules will take the path in either format. In this case Perl was interpreting their code correctly, because otherwise it would not have given the

Re: read column into array

2005-12-27 Thread John Doe
Andrej Kastrin am Dienstag, 27. Dezember 2005 10.41: > Hi all, > > is there any simple way to read a column of a file into array; e.g. read > second column > a b h > e r z > u e u > > and write it to @array=(b,r,e). > > Cheers, Andrej There are several ways; which is the best depends from the data

Re: read column into array

2005-12-27 Thread Xavier Noria
On Dec 27, 2005, at 10:41, Andrej Kastrin wrote: is there any simple way to read a column of a file into array; e.g. read second column a b h e r z u e u and write it to @array=(b,r,e). Sure, for instance: my @column = (); while (<>) { my ($field) = (split)[1]; # extract 2n

read column into array

2005-12-27 Thread Andrej Kastrin
Hi all, is there any simple way to read a column of a file into array; e.g. read second column a b h e r z u e u and write it to @array=(b,r,e). Cheers, Andrej -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: not valid win32 app

2005-12-27 Thread John W. Burns
""John W. Burns"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > For some inexplicable reason (at least to me) my windows perl application > has ceased to load. > When I call perl\bin\perl.exe I receive the message "not a valid win32 > application." OS is Windows XP. > I have never