On Monday 20 September 2010 09:49:27 rahul patil wrote:
> Hello all,
>
> below is sample code i have written.Is it right way to declare ar4 which is
> concatenation of ar and ar1
>
> #!/usr/bin/perl
> @ar = {"rahul","patil"};
You shouldn't use { ... } for arrays (this is not C). Use:
my @ar = (
> "PK" == Parag Kalra writes:
PK> #!/usr/bin/perl
PK> use strict;
PK> use warnings;
PK> my @ar = ("rahul","patil");
PK> my @ar1 = ("nitin");
PK> my @ar4;
PK> push @ar4, (@ar, @ar1);
PK> print "@ar4";
it is nice that you are trying to help but your code can be
better. there is
On Mon, Sep 20, 2010 at 1:30 PM, Chaitanya Yanamadala <
dr.virus.in...@gmail.com> wrote:
> @ar = ("rahul","patil");
> @ar1 = ("nitin");
> @ar4 = (@ar,@ar1);
>
> the only problem is u should not define the array with this { } it should
> be defined within this brackets ();
>
> Chaitanya
>
>
This wo
@ar = ("rahul","patil");
@ar1 = ("nitin");
@ar4 = (@ar,@ar1);
the only problem is u should not define the array with this { } it should be
defined within this brackets ();
Chaitanya
On Mon, Sep 20, 2010 at 1:19 PM, rahul patil
wrote:
> Hello all,
>
> below is sample code i have written.Is it
#!/usr/bin/perl
use strict;
use warnings;
my @ar = ("rahul","patil");
my @ar1 = ("nitin");
my @ar4;
push @ar4, (@ar, @ar1);
print "@ar4";
Cheers,
Parag
On Mon, Sep 20, 2010 at 12:49 AM, rahul patil
wrote:
> Hello all,
>
> below is sample code i have written.Is it right way to declare ar4 whi
Hello all,
below is sample code i have written.Is it right way to declare ar4 which is
concatenation of ar and ar1
#!/usr/bin/perl
@ar = {"rahul","patil"};
@ar1 = {"nitin"};
@ar4 = {...@ar,@ar1};
print @ar4[2];
if yes, why it is not printing output as nitin on my system
--
Regards,
Rahul Patil
On Fri, Jul 10, 2009 at 9:25 PM, Gunnar Hjalmarsson wrote:
> You can use a hash slice.
>
> �...@{ $data{$key} }{ @fields } = split /:/, $val;
Thanks Gunnar, your suggestion is enlightening.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...
On 7/10/09 Fri Jul 10, 2009 11:32 AM, "Matteo Riva"
scribbled:
> Hello everybody, I have two lists and I want to merge them like this:
>
> element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc.
>
> I need this to create a sequence of key/value for an
Matteo Riva wrote:
Hello everybody, I have two lists and I want to merge them like this:
element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc.
I need this to create a sequence of key/value for an anonymous hash.
I'm using this code:
# @fields contains the names of the
On Fri, 2009-07-10 at 20:32 +0200, Matteo Riva wrote:
> Hello everybody, I have two lists and I want to merge them like this:
>
> element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc.
>
> I need this to create a sequence of key/value for an anonymous hash.
>
>
Hello everybody, I have two lists and I want to merge them like this:
element 1 of list A, element 1 of list B, A2, B2, A3, B3, etc.
I need this to create a sequence of key/value for an anonymous hash.
I'm using this code:
# @fields contains the names of the hash keys
# $val
Im still trying to figure out hashes. My array consists of two elements, the
first is a filename and the second is a field in the file. So it looks like
this:
File1 UserID
File1 TextID
File1 Field1
File2 UserID
File2 TextID
File2 Field1
File2 Field2
I
Title: Message
I am having
difficulty discovering why a part of my script is doing what it is doing. I have
a script that polls switches every 5 minutes to discover new MAC's. Everything
works fine for discovering new MAC's but now I want to test for existing MAC's
that have moved.
The co
|
| cc:
James Kelty wrote:
> Say I have two large lists of names (uid's). I would like to look at
> both of these files and make sure that a name (uid) doesn't appear in
> BOTH files. Just one or the other. Not sure how to handle that. Any ideas?
The short answer is
perldoc -q duplicate
The long one i
Say I have two large lists of names (uid's). I would like to look at
both of these files and make sure that a name (uid) doesn't appear in
BOTH files. Just one or the other. Not sure how to handle that. Any ideas?
Thanks.
-James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional com
16 matches
Mail list logo