Hi,
I've two arrays of same depth (let it be 6)
1st Array:- @unique {11 , 23, 44, 66, 900, 1009}
2nd Array:- @occ_count {2, 77, 22, 2, 77,29}
Here I'm looking for a sorting mechanism with the following conditions:-
a. Sort 2nd Array in descending order such that it
Rinku Mahesh wrote:
Hi,
I've two arrays of same depth (let it be 6)
1st Array:- @unique {11 , 23, 44, 66, 900, 1009} 2nd Array:- @occ_count {2,
77, 22, 2, 77,29}
Here I'm looking for a sorting mechanism with the following conditions:-
a. Sort 2nd Array in descending order such that it
Hi Rinku,
Now I could try and explain this in my own words but I think this will help
you a lot more.
http://www.unix.org.ua/orelly/perl/advprog/ch02_02.htm
What you are looking for is a very common thing, your not the first to bump
into this problem :-)
Regards,
Rob
On 12/12/06, Rinku
Rinku Mahesh schreef:
I've two arrays of same depth (let it be 6)
1st Array:- @unique {11 , 23, 44, 66, 900, 1009}
2nd Array:- @occ_count {2, 77, 22, 2, 77,29}
[...]
b. The values of 1st array should also change in accordance with
the positions of elements of 2nd array such
--- Rob Coops [EMAIL PROTECTED] wrote:
Hi Rinku,
Now I could try and explain this in my own words but I think this
will help you a lot more.
http://www.unix.org.ua/orelly/perl/advprog/ch02_02.htm
What you are looking for is a very common thing, your not the first
to bump into this
Rinku Mahesh mailto:[EMAIL PROTECTED] wrote:
: If the above explaination is confusing I'm looking for a way
: where every element of an array can be mapped to corresponding
: element of another array and as a whole both the arrays require
: a sorting w.r.t. 2nd array.
M.J. Dominus wrote
On Tue, December 12, 2006 6:25 am, Ovid wrote:
--- Rob Coops [EMAIL PROTECTED] wrote:
Hi Rinku,
Now I could try and explain this in my own words but I think this will
help you a lot more.
What you are looking for is a very common thing, your not the first to
bump into this problem :-)
Hi All,
I want to calculate the time difference(hh:mm:ss) between two when they are
provided with date and time. Could anyone provide the module to handle this?
--
Thanks and Regards,
Rajeev Kilaru
Associate
Charles River Team
Franklin Templeton Technologies (FTT-ISC)
Hyderabad
Work Pone:
kilaru rajeev wrote:
Hi All,
I want to calculate the time difference(hh:mm:ss) between two when they are
provided with date and time. Could anyone provide the module to handle
this?
Maybe this can get you started:
http://beta.nntp.perl.org/group/perl.datetime/2006/05/msg6342.html
Mathew
kilaru rajeev am Dienstag, 12. Dezember 2006 13:22:
Hi All,
Hello
I want to calculate the time difference(hh:mm:ss) between two when they are
provided with date and time. Could anyone provide the module to handle
this?
There are different modules to handle date/time tasks.
CPAN is a great
On Mon, 11 Dec 2006 06:02:25 -0800, Rinku Mahesh wrote:
-
my @fields =();
my @unique_elements=();
my %seen = ();
foreach my $elem (@fields) {
next if $seen{ $elem }++;
push (@unique_elements, $elem);
}
-
What
I'm trying to declare a zero size hash so a sub function can populate it and
be see by all other sub's.
my %loginHash();
But the use strict doesn't like it. All examples of making a hash
structure is hard coded in the program or is made reading from a file. When
I try to run the script all I
From: stic [EMAIL PROTECTED]
Yeah, very very thank for help, now it`s making exactly what i want.
but could you please explain what all this one line do?
push @{ -d $cesta/$_ ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }, $_ for grep
!/\A\.\.?\z/,readdir $OBSAH;
I`m absolute begginer in
Just write it like:
my %loginHash = ();
This should work.
-Original Message-
From: Dukelow, Don [EMAIL PROTECTED]
Sent: Dec 13, 2006 12:23 AM
To: beginners@perl.org
Subject: declaring a zero size hash
I'm trying to declare a zero size hash so a sub function can populate it and
be see
On 12/12/06, Dukelow, Don [EMAIL PROTECTED] wrote:
I'm trying to declare a zero size hash so a sub function can populate it and
be see by all other sub's.
my %loginHash();
my %loginHash;
should be enough.
But the use strict doesn't like it.
It is not use strict that does not like it. It
On 12/12/06, Dukelow, Don [EMAIL PROTECTED] wrote:
I'm trying to declare a zero size hash so a sub function can populate it and
be see by all other sub's.
my %loginHash();
Maybe you mean this?
my %loginHash = ();
But every new variable (which is what 'my' is declaring) starts out
empty,
I think you need to do:
my %loginhash = {};
Kim Helliwell
LSI Logic Corporation
Work: 408 433 8475
Cell: 408 832 5365
[EMAIL PROTECTED]
Please Note: My email address changed to [EMAIL PROTECTED] on Oct
14. The old email address ([EMAIL PROTECTED]) will stop working after
Jan 15, 2007. Please
On 12/12/06, Helliwell, Kim [EMAIL PROTECTED] wrote:
I think you need to do:
my %loginhash = {};
That's not right. {} is a hash ref, not a hash. It stands for a scalar value.
When you do that
my %h = {}
or, for the same result,
my %h = 1;
my %h = abacate;
you end with a hash
Thanks for the updates, I understand.
Then perhaps someone can help me get this script to set the tcp
to SYN_SENT on 100 ports:
#!/usr/bin/perl
use Socket;
$count=3500;
while ($count3601)
{
$count++;
$addr=sockaddr_in($count,inet_aton('localhost'));
Take a step back -- what are you trying to accomplish?
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is
I have a string like so:
/home/dbsmith/passwd.oftappp1.hpux and I need to parse
out oftappp1 and hpux.
I have tried to use substr and and regexp with =~.
Here is what I have tried, but need some help cause I
am getting frustrated.
NOTE: strings after passwd are variable in length,
could be 3-10
Derek B. Smith am Dienstag, 12. Dezember 2006 23:19:
I have a string like so:
/home/dbsmith/passwd.oftappp1.hpux and I need to parse
out oftappp1 and hpux.
I have tried to use substr and and regexp with =~.
Here is what I have tried, but need some help cause I
am getting frustrated.
Derek B. Smith wrote:
I have a string like so:
/home/dbsmith/passwd.oftappp1.hpux and I need to parse
out oftappp1 and hpux.
I have tried to use substr and and regexp with =~.
Here is what I have tried, but need some help cause I
am getting frustrated.
NOTE: strings after passwd are
If you're dealing with variable length strings, separated by some kind
of character, then regexp is the tool you want, not substr.
This snippet will work so long as hostname and platformname are made
up of \w ... if not, substitute in an appropriate character class.
#!/usr/bin/perl
use strict;
or just:
my $filename=/home/dbsmith/passwd.duby02.linux;
my ($pass,$hostname,$platform)=split /\./, $filename;
~i
On 12/12/06, Lawrence Statton XE2/N1GAK [EMAIL PROTECTED] wrote:
If you're dealing with variable length strings, separated by some kind
of character, then regexp is the tool you
--- D. Bolliger [EMAIL PROTECTED] wrote:
Derek B. Smith am Dienstag, 12. Dezember 2006 23:19:
I have a string like so:
/home/dbsmith/passwd.oftappp1.hpux and I need to
parse
out oftappp1 and hpux.
I have tried to use substr and and regexp with =~.
Here is what I have tried, but
Is there a function (perhaps in a library module) that would take two
strings and return the common substring (if any) contained in the
arguments? I've been looking for such a beast on CPAN, but no luck so
far.
If not, I guess I have to write it myself...
Any help appreciated.
Kim
On 12/12/06, Helliwell, Kim [EMAIL PROTECTED] wrote:
Is there a function (perhaps in a library module) that would take two
strings and return the common substring (if any) contained in the
arguments?
You want the longest possible common substring? Or all of the longest
ones, if there's more
Helliwell, Kim wrote:
Is there a function (perhaps in a library module) that would take two
strings and return the common substring (if any) contained in the
arguments? I've been looking for such a beast on CPAN, but no luck so
far.
Perhaps this is what you require:
Helliwell, Kim am Dienstag, 12. Dezember 2006 21:56:
Is there a function (perhaps in a library module) that would take two
strings and return the common substring (if any) contained in the
arguments? I've been looking for such a beast on CPAN, but no luck so
far.
If not, I guess I have to
On 12/12/06, D. Bolliger [EMAIL PROTECTED] wrote:
$found{$1}++ for ($s2=~/($search)/g); # although count not used below
Didn't $search just come from the data? It's a string, not a pattern.
If it's got any metacharacters, it could break your pattern, or worse.
Cheers!
--Tom Phoenix
Tom Phoenix am Mittwoch, 13. Dezember 2006 02:32:
On 12/12/06, D. Bolliger [EMAIL PROTECTED] wrote:
$found{$1}++ for ($s2=~/($search)/g); # although count not used
below
Didn't $search just come from the data? It's a string, not a pattern.
If it's got any metacharacters, it could
D. Bolliger am Mittwoch, 13. Dezember 2006 02:25:
Sorry for answering my own post...
[snipped]
The script contains a testcase with long strings, it takes 1.2 secs on my
old machine (the test case is certainly not a worst case scenario).
[snipped]
### Test case:
my $pat=join '', 'hello' x
On 12/12/2006 04:00 AM, Rinku Mahesh wrote:
Hi,
I've two arrays of same depth (let it be 6)
1st Array:- @unique {11 , 23, 44, 66, 900, 1009}
2nd Array:- @occ_count {2, 77, 22, 2, 77,29}
Here I'm looking for a sorting mechanism with the following conditions:-
a.
On 12/12/2006 06:35 AM, Mathew wrote:
Maybe this can get you started:
http://beta.nntp.perl.org/group/perl.datetime/2006/05/msg6342.html
Mathew
What is beta.nntp.perl.org ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Mumia W. wrote:
On 12/12/2006 06:35 AM, Mathew wrote:
Maybe this can get you started:
http://beta.nntp.perl.org/group/perl.datetime/2006/05/msg6342.html
Mathew
What is beta.nntp.perl.org ?
I'm it is an archive of perl.org mailing lists. For instance
36 matches
Mail list logo