Hi Илья,
some comments on your code:
On Wed, 06 May 2015 08:09:01 +
Илья Рассадин elcaml...@gmail.com wrote:
HI, Anirban.
Regexp and hash of arrays can help you.
my @a =
('1900-0','1900-1','NULL','NULL','1900-2','1900-4','1902-5','1902-6','1902-7','1902-8');
Always start with
-- Forwarded message --
From: Shlomi Fish shlo...@shlomifish.org
Date: Wed, May 6, 2015 at 11:31 AM
Subject: Fw: Perl array question
To: shlo...@gmail.com
Begin forwarded message:
Date: Wed, 6 May 2015 11:04:30 +0300
From: Shlomi Fish shlo...@shlomifish.org
To: beginners
Thanks to all for your kind support.
On Wed, May 6, 2015 at 1:39 PM, Илья Рассадин elcaml...@gmail.com wrote:
HI, Anirban.
Regexp and hash of arrays can help you.
my @a =
('1900-0','1900-1','NULL','NULL','1900-2','1900-4','1902-5','1902-6','1902-7','1902-8');
my %result;
foreach (@a)
Hi, Shlomi.
Of course, you need to use strict and warnings. I'm sorry to not specify it
my answer.
And I'm agree with your suggestion about checking result of regexp
validation.
For cycle create very concrete and understandable lexical scope and you
can safely use loop variable outside this
Hi Vincent,
On Wed, 06 May 2015 10:07:41 +0200
Vincent Lequertier s...@riseup.net wrote:
It's a bit ugly, but here is one way to do it :
Your code encourages many bad practices. Some notes are:
#!/usr/bin/perl
no use strict;/use warnings;:
Thank you for the review, I'm learning and didn't know about this way of
using hashes :-)
---
Vincent Lequertier
s...@riseup.net
Le 2015-05-06 11:09, Shlomi Fish a écrit :
Hi Vincent,
On Wed, 06 May 2015 10:07:41 +0200
Vincent Lequertier s...@riseup.net wrote:
It's a bit ugly, but here is
It's a bit ugly, but here is one way to do it :
#!/usr/bin/perl
my @array = ('1900-0', '1900-1', 'NULL', 'NULL', '1900-2', '1900-4',
'1902-5', '1902-6', '1902-7', '1902-8');
my $num1900 = 'EARFCN=1900, PCID=';
my $num1902 = 'EARFCN=1902, PCID=';
for (@array) {
# print $_ . \n;
$num1900
HI, Anirban.
Regexp and hash of arrays can help you.
my @a =
('1900-0','1900-1','NULL','NULL','1900-2','1900-4','1902-5','1902-6','1902-7','1902-8');
my %result;
foreach (@a) {
next if $_ eq 'NULL';
my ($earfcn, $pcid) = /^(\d+)-(.+)$/;
push @{$result{$earfcn}}, $pcid;
Hi List
I have the following array ---
('1900-0','1900-1','NULL','NULL','1900-2','1900-4','1902-5','1902-6','1902-7','1902-8');
There are two part for each element separated by a dash.
first one known as earfcn and second one is pcid .
The requirement is For the same “earfcn”, concatenate the
On Wed, 6 May 2015 12:49:53 +0530
Anirban Adhikary anirban.adhik...@gmail.com wrote:
Hi List
I have the following array ---
('1900-0','1900-1','NULL','NULL','1900-2','1900-4','1902-5','1902-6','1902-7','1902-8');
There are two part for each element separated by a dash.
first one known as
-- Forwarded message --
From: Shlomi Fish shlo...@shlomifish.org
Date: Wed, May 6, 2015 at 11:31 AM
Subject: Fw: Perl array question
To: shlo...@gmail.com
Begin forwarded message:
Date: Wed, 6 May 2015 11:04:30 +0300
From: Shlomi Fish shlo...@shlomifish.org
To: beginners
anirban.adhik...@gmail.com (Anirban Adhikary) writes:
Hi List
I have the following array ---
('1900-0','1900-1','NULL','NULL','1900-2','1900-4','1902-5','1902-6','1902-7','1902-8');
There are two part for each element separated by a dash.
first one known as earfcn and second one is pcid .
12 matches
Mail list logo