Bryan Harris wrote:
Doesn't that try to re-localize (?) the @array variable every time
through the loop? i.e. doesn't it re-run the my() function every time
through the loop? For some reason I thought that was a no-no.
my() happens when the code is compiled so it is *not* re-run every time
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every time
through the loop. The assignment happens when the code is run so it is
re-run every time.
$ perl -e '
for (1..5) {
my $count;
$count += 1;
print $count;
last if $count == 3;
}
print
From: John W. Krahn jwkr...@shaw.ca
Bryan Harris wrote:
[stuff cut out]
It is usually best to declare variables in the smallest scope possible
so:
while (more work to do)
{
my @array = split $string;
# do work on array
}
Doesn't that try to re-localize (?)
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run so
it is re-run every time.
$ perl -e '
for (1..5) {
my $count;
$count += 1;
print $count;
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run
so it is re-run every time.
$ perl -e '
for (1..5) {
my $count;
$count += 1;
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run
so it is re-run every time.
$ perl -e '
for (1..5) {
my
On Tue, May 12, 2009 at 18:11, John W. Krahn jwkr...@shaw.ca wrote:
Bryan Harris wrote:
[stuff cut out]
It is usually best to declare variables in the smallest scope possible
so:
while (more work to do)
{
my @array = split $string;
# do work on array
}
Doesn't that try to
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run
so it is re-run every time.
$ perl -e '
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is
run so it is
Hello,
I am a complete beginner - no programming background.
I want to begin with Perl and I decided to by Randal's book *Learning Perl*.
I seem to have been progressing smoothly till when I arrived at the code
below on page 65.
my @names = qw/ tom fred dan betty roy /;
my $result =
That does the first line in function:
my($what, @array) = @_;
That puts to $what the first parameter passed to function and to @array
the rest of parametres..in this case @names. So you have a copy of
@names in @array. But I am begginer too, so maybe i undersand it
wrong;-) And for
On Thu, Apr 2, 2009 at 07:06, Joseph Mwesigwa Bbaale
joemwesi...@gmail.com wrote:
Hello,
I am a complete beginner - no programming background.
I want to begin with Perl and I decided to by Randal's book *Learning Perl*.
I seem to have been progressing smoothly till when I arrived at the code
Joseph Mwesigwa Bbaale wrote:
my @names = qw/ tom fred dan betty roy /;
my $result = which_element_is(dan @names);
sub which_element_is {
my($what, @array) = @_;
foreach (0..$#array) {
if ($what eq $array[$_]) {
return $_;
}
}
-1;
}
snip
Please,
On Thu, Apr 2, 2009 at 13:18, Gunnar Hjalmarsson nore...@gunnar.cc wrote:
snip
Another thing is that I was a little surprised to see that a book written by
Randal contains an example where a function is called with before the
name. It's not just a matter of taste, but the character changes
On Mon, Mar 30, 2009 at 2:20 PM, ANJAN PURKAYASTHA
anjan.purkayas...@gmail.com wrote:
Hi,
Here is my problem;
I have a series of arrays with 0s and 1s. here is an example: (1, 0, 1, 1).
I need to parse through this series of arrays and extract the index of the
0s in the array.
Is there any
On Mon, Mar 30, 2009 at 14:20, ANJAN PURKAYASTHA
anjan.purkayas...@gmail.com wrote:
Hi,
Here is my problem;
I have a series of arrays with 0s and 1s. here is an example: (1, 0, 1, 1).
I need to parse through this series of arrays and extract the index of the
0s in the array.
Is there any
On Mon, Mar 30, 2009 at 14:28, Rodrick Brown rodrick.br...@gmail.com wrote:
snip
Millions of ways here is one:
snip
my $pos = 0;
for my $index (@arr) {
if ( $index == 0 ) {
printf (%d , $pos );
}
$pos++;
}
snip
If you are going to go with a full bore for loop, you might as well
ANJAN PURKAYASTHA wrote:
Hi,
Hello,
Here is my problem;
I have a series of arrays with 0s and 1s. here is an example: (1, 0, 1, 1).
I need to parse through this series of arrays and extract the index of the
0s in the array.
Is there any quick way of doing this?
$ perl -le'
my @array = ( 1,
On Tue, 31 Mar 2009 04:49:17 +1000, John W. Krahn jwkr...@shaw.ca wrote:
Or instead of using arrays you could store the 1s and 0s in strings:
$ perl -le'
my $string = 10110111001;
print $-[0] while $string =~ /0/g;
'
1
4
8
9
Hi John,
Could you explain how the above code works please? I
Dave Tang wrote:
On Tue, 31 Mar 2009 04:49:17 +1000, John W. Krahn jwkr...@shaw.ca wrote:
Or instead of using arrays you could store the 1s and 0s in strings:
$ perl -le'
my $string = 10110111001;
print $-[0] while $string =~ /0/g;
'
1
4
8
9
Could you explain how the above code works
On Sun, 2008-11-16 at 08:35 -0800, hotkitty wrote:
How do I combine the arrays so that the the newstuff in array1 gets
appended only to an item in array2 if the dates match?
Create a hash of lists with the dates as its keys. Go through Array2
and push each oldstuff on the list stored in the
hotkitty wrote:
Hi,
Hello,
I have two arrays, as follows:
Array1=(
date 11/01/2008 newstuff1,
date 10/27/2008 newstuff2,
date 10/24/2008 newstuff3
)
Array2=(
date 11/01/2008 oldstuff1,
date 10/31/2008 oldstuff2,
date 10/30/2008 oldstuff3,
date 10/29/2008 oldstuff4,
date 10/28/2008
Richard wrote:
Hello,
Hello,
I have small Perl project and got stuck on following problem :
There is a zip file with bunch of files in it. I need to search
through it and find if every xxx.txt file has xxx.log pair and list
all of those .txt without pairs.
Use File::Basename to separate
Mr. Shawn H. Corey wrote:
On Sat, 2008-08-02 at 06:31 -0700, hsfrey wrote:
I'm trying to set up a list of words to ignore in a text.
I tried it like this:
my @ignore = (U.S.C, Corp, Miss, Conf, Cong);
and later in a loop
if ( $exists $ignore [$lastWord] ) { next;}
But that tested positive
On Sat, 2008-08-02 at 06:31 -0700, hsfrey wrote:
I'm trying to set up a list of words to ignore in a text.
I tried it like this:
my @ignore = (U.S.C, Corp, Miss, Conf, Cong);
and later in a loop
if ( $exists $ignore [$lastWord] ) { next;}
But that tested positive for EVERY $lastWord
On Thursday 10 July 2008 05:59:36 Anirban Adhikary wrote:
Dear list
I want to capture the output of w and then I want to do some job as per the
o/p of w command in my linux system. So i have written the code as follows
use strict;
use warnings;
open (LS, w|) or die can't open w: $!;
my
On Thu, Jul 10, 2008 at 5:59 AM, Anirban Adhikary
[EMAIL PROTECTED] wrote:
Dear list
I want to capture the output of w and then I want to do some job as per the
o/p of w command in my linux system. So i have written the code as follows
open (LS, w|) or die can't open w: $!;
my @arr = LS;
On Thu, Jul 10, 2008 at 8:48 AM, Stephen Kratzer [EMAIL PROTECTED] wrote:
Anirban,
The output of 'w' is delimited by whitespace, not necessarily a single space.
Try passing the pattern '\w+' to split. Something like this:
I think you meant the '\s+' pattern.
-- j
Stephen Kratzer wrote:
On Thursday 10 July 2008 05:59:36 Anirban Adhikary wrote:
Dear list
I want to capture the output of w and then I want to do some job as per the
o/p of w command in my linux system. So i have written the code as follows
use strict;
use warnings;
open (LS, w|) or die
On Thursday 10 July 2008 10:33:31 Jay Savage wrote:
On Thu, Jul 10, 2008 at 8:48 AM, Stephen Kratzer [EMAIL PROTECTED] wrote:
Anirban,
The output of 'w' is delimited by whitespace, not necessarily a single
space. Try passing the pattern '\w+' to split. Something like this:
I think you
On Jul 10, 5:59 am, [EMAIL PROTECTED] (Anirban Adhikary)
wrote:
Dear list
I want to capture the output of w and then I want to do some job as per the
o/p of w command in my linux system. So i have written the code as follows
use strict;
use warnings;
open (LS, w|) or die can't open w: $!;
Thanks for the answers.
I have tried to use quotemeta but it did not work as expected, DBI's
quote function was exactly what I want.
Thanks again,
On Jul 1, 6:35 pm, [EMAIL PROTECTED] (Amit Saxena) wrote:
use
$*dbh*-*quote*($str)
On Tue, Jul 1, 2008 at 4:59 AM, Gunnar Hjalmarsson [EMAIL
use
$*dbh*-*quote*($str)
On Tue, Jul 1, 2008 at 4:59 AM, Gunnar Hjalmarsson [EMAIL PROTECTED]
wrote:
Beyza wrote:
I have an array which has strings like;
John's House
Bla bla;
etc,
When I use them in an SQL query, perl gives an error. So, I need to
put escape character for every
Beyza wrote:
Hi,
I would like to know how to insert escape character in front of
special characters in an array.
I have an array which has strings like;
John's House
Bla bla;
etc,
When I use them in an SQL query, perl gives an error. So, I need to
put escape character for every special
Beyza wrote:
Hi,
I would like to know how to insert escape character in front of
special characters in an array.
I have an array which has strings like;
John's House
Bla bla;
etc,
When I use them in an SQL query, perl gives an error. So, I need to
put escape character for every
Beyza wrote:
I have an array which has strings like;
John's House
Bla bla;
etc,
When I use them in an SQL query, perl gives an error. So, I need to
put escape character for every special character. Is there any quick
way to do it?
perldoc -f quotemeta
--
Gunnar Hjalmarsson
Email:
Steve Bertrand wrote:
Hi all,
Can someone explain to me how I can fix this up to achieve my desired
results?
my $time = (split (/:/, (grep (/^info/, @contents[0];
I figured it out :)
my $time = (split (/:/, (grep (/^info/, @contents))[0]))[0];
I neglected to realize that the result
Steve Bertrand wrote:
Can someone explain to me how I can fix this up to achieve my desired
results?
my $time = (split (/:/, (grep (/^info/, @contents[0];
A sample snip of data:
this382:3828
info447:4729
that274:9294
...and I just want the $time to become info447.
The way
Steve Bertrand wrote:
Hi all,
Hello,
Can someone explain to me how I can fix this up to achieve my desired
results?
my $time = (split (/:/, (grep (/^info/, @contents[0];
A sample snip of data:
this382:3828
info447:4729
that274:9294
...and I just want the $time to become info447.
Rob Dixon wrote:
Steve Bertrand wrote:
Can someone explain to me how I can fix this up to achieve my desired
results?
my $time = (split (/:/, (grep (/^info/, @contents[0];
A sample snip of data:
this382:3828
info447:4729
that274:9294
...and I just want the $time to become info447.
The
Steve Bertrand wrote:
Can someone explain to me how I can fix this up to achieve my desired
results?
my $time = (split (/:/, (grep (/^info/, @contents[0];
A sample snip of data:
this382:3828
info447:4729
that274:9294
...and I just want the $time to become info447.
my $time;
Paul Lalli wrote:
On Feb 26, 11:07 am, [EMAIL PROTECTED] (Irfan Sayed) wrote:
Hello All,
I have two arrays contains exact no. of elements. Now what I need to do
is , I want to execute certain commands to each elements of the array at
a time.
It means that I want take first element of first
On Tue, Feb 26, 2008 at 10:07 AM, [EMAIL PROTECTED] wrote:
Hello All,
I have two arrays contains exact no. of elements. Now what I need to do
is , I want to execute certain commands to each elements of the array at
a time.
@array1 = (1,2,3);
@array2 = (4,5,6);
for (my $i=0; $i
On Tue, Feb 26, 2008 at 8:07 AM, [EMAIL PROTECTED] wrote:
Hello All,
I have two arrays contains exact no. of elements. Now what I need to do
is , I want to execute certain commands to each elements of the array at
a time.
It means that I want take first element of first array and
On Feb 26, 11:07 am, [EMAIL PROTECTED] (Irfan Sayed) wrote:
Hello All,
I have two arrays contains exact no. of elements. Now what I need to do
is , I want to execute certain commands to each elements of the array at
a time.
It means that I want take first element of first array and first
From: John W.Krahn [EMAIL PROTECTED]
On Wednesday 12 December 2007 07:15, Jenda Krynicky wrote:
From: jeff pang [EMAIL PROTECTED]
--- Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
My query is that can i store the output of this for loop in
variable or
list. so that if i print
On Thursday 13 December 2007 03:52, Jenda Krynicky wrote:
From: John W.Krahn [EMAIL PROTECTED]
On Wednesday 12 December 2007 07:15, Jenda Krynicky wrote:
From: jeff pang [EMAIL PROTECTED]
You can add a \n (or \r\n on windows,etc) at the end of
each element in the array,like,
From: Chas. Owens [EMAIL PROTECTED]
Yes, but I am the one making pronouncements about how people should
code. Rob was just calling me on being a little pompous. I still
think that use of $_ in places other than the start of a loop (with a
function that uses the default variable like split,
Irfan, this will work:
#!/opt/local/bin/perl
use warnings;
use strict;
my @output = (dadsad, assasd);
foreach (@output)
{
print $_\n;
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Dec 12, 2007 1:00 AM, jeff pang [EMAIL PROTECTED] wrote:
snip
You can add a \n (or \r\n on windows,etc) at the end of each
element in the array,like,
snip
In Perl, \n is not linefeed, it is the newline character. It
translates to the proper sequence of characters on each operating
system,
On Dec 12, 2007 12:04 AM, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
Hi All,
I have some string stored in array as follows.
@array=(dadsad,assasd) Now if i print this array then it is printing as
dadsad,assasd
I certainly hope you are not using barewords like this. This will
work (for
From: jeff pang [EMAIL PROTECTED]
--- Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
My query is that can i store the output of this for loop in
variable or
list. so that if i print the content of that variable or array then
it
should print as
dadsad
assasd
You can add
On Wednesday 12 December 2007 07:15, Jenda Krynicky wrote:
From: jeff pang [EMAIL PROTECTED]
--- Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
My query is that can i store the output of this for loop in
variable or
list. so that if i print the content of that variable or array
then
Chas. Owens wrote:
On Dec 12, 2007 1:00 AM, jeff pang [EMAIL PROTECTED] wrote:
snip
You can add a \n (or \r\n on windows,etc) at the end of each
element in the array,like,
snip
In Perl, \n is not linefeed, it is the newline character. It
translates to the proper sequence of characters on
Chas. Owens wrote:
Only use the default variable with functions and operators that use
it by default like chomp and regexes.
What's this? The Gospel according to Chas?!
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Rob Dixon wrote:
Chas. Owens wrote:
Only use the default variable with functions and operators that use
it by default like chomp and regexes.
What's this? The Gospel according to Chas?!
Hey now...
Take into consideration that this is not everyone's point of view.
Just because you (and I,
On Dec 13, 2007 1:02 AM, Steve Bertrand [EMAIL PROTECTED] wrote:
Rob Dixon wrote:
Chas. Owens wrote:
Only use the default variable with functions and operators that use
it by default like chomp and regexes.
What's this? The Gospel according to Chas?!
Hey now...
Take into
The built in join() function sounds like what you want.
Read up on it here:
http://perldoc.perl.org/functions/join.html
$output = join(\n, @array);
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
--- Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
My query is that can i store the output of this for loop in
variable or
list. so that if i print the content of that variable or array then
it
should print as
dadsad
assasd
You can add a \n (or \r\n on windows,etc) at the end of
On Oct 29, 11:09 am, [EMAIL PROTECTED] (John W . Krahn) wrote:
On Monday 29 October 2007 06:42, Mike Tran wrote:
Hey all,
Hello,
I'm new with Perl and need help with this simple script. I'm still
playing around with the script below to get a feel for Perl. My
script below is
Thank you, Tom, that is exactly what I was looking for!!
Thanks again!
-Greg
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 29 Oct 2007 at 8:42, Mike Tran wrote:
Hey all,
I'm new with Perl and need help with this simple script. I'm still
playing around with the script below to get a feel for Perl. My script
below is incomplete and I'm doing an array within an array which is
incorrect. Please help.
PROTECTED]
Sent: 29 October 2007 15:30
To: beginners @ perl. org
Subject: Re: array within array
On 29 Oct 2007 at 8:42, Mike Tran wrote:
Hey all,
I'm new with Perl and need help with this simple script. I'm still
playing around with the script below to get a feel for Perl. My script
On Monday 29 October 2007 07:29, Beginner wrote:
while (EXCLUDE) {
chomp;
my @fields = split(/|/,$_);
^^^
$exclude_bases{$F[0]} = 0; # $f[0] contains base_no
}
close(EXCLUDE);
open(BASE,base.txt)|| die(Could not open file!);
while (BASE) {
Andrew Curry schreef:
be very careful with exists, it auto creates the structure
use Data::Dumper;
my %hash;
if (exists $hash{a}{b}) {}
print Dumper(\%hash)
then the next time you use exists it is there.
defined is much safer as it doesnt do this.
No, the difference here
On Monday 29 October 2007 06:42, Mike Tran wrote:
Hey all,
Hello,
I'm new with Perl and need help with this simple script. I'm still
playing around with the script below to get a feel for Perl. My
script below is incomplete and I'm doing an array within an array
which is incorrect. Please
On Oct 29, 6:42 am, [EMAIL PROTECTED] (Mike Tran) wrote:
Hey all,
I'm new with Perl and need help with this simple script. I'm still
playing around with the script below to get a feel for Perl. My script
below is incomplete and I'm doing an array within an array which is
incorrect. Please
beginners
Subject: Re: array within array
On Monday 29 October 2007 06:42, Mike Tran wrote:
Hey all,
Hello,
I'm new with Perl and need help with this simple script. I'm still
playing around with the script below to get a feel for Perl. My
script below is incomplete and I'm doing an array within
On Thursday 25 October 2007 11:03, [EMAIL PROTECTED] wrote:
Hi
Hello, Please do not top-post, TIA.
This will do what you want:-
perl -le '@test=(1,2,3,4,5);print join \n,@test;'
The -l option ensures a final newline after the last element of the
array is printed. The order of the
On 25 Oct 2007, at 4:59 PM, Sayed, Irfan (Irfan) wrote:
Hi All,
I have one array say my @test=(1,2,3,4,5);
if I print this array it will print like this
print @test\n;
and the output is
1 2 3 4 5
so I mean to say that if I type print @test1\n;
then output should come as
1
2
3
4
5
Try map:
Sayed, Irfan (Irfan) wrote:
I have one array say my @test=(1,2,3,4,5);
if I print this array it will print like this
print @test\n;
and the output is
1 2 3 4 5
now my req. is that I want to store these array values in another array
in such a fashion where I can print like
1
2
3
4
5
so I
guide.
Thanks in Advance.
Regards
Irfan.
-Original Message-
From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 25, 2007 5:06 PM
To: beginners@perl.org
Subject: Re: Array Manipulation
Sayed, Irfan (Irfan) wrote:
I have one array say my @test=(1,2,3,4,5); if I print
On Oct 25, 1:59 am, [EMAIL PROTECTED] (Irfan Sayed) wrote:
Hi All,
I have one array say my @test=(1,2,3,4,5);
if I print this array it will print like this
print @test\n;
and the output is
1 2 3 4 5
now my req. is that I want to store these array values in another array
in such a fashion
On Oct 25, 4:21 pm, [EMAIL PROTECTED] (Ron Bergin) wrote:
print $_,$/ for @test;
Nothing wrong with that, but I usually write:
print $_\n for @test;
TMTOWTDI!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi
This will do what you want:-
perl -le '@test=(1,2,3,4,5);print join \n,@test;'
The -l option ensures a final newline after the last element of the array is
printed. The order of the options is important as changing it to el
wouldn't
work.
--
Andrew
Edinburgh,Scotland
On Thu, 25 Oct
Similar issue here, but with a twist.
I have an input file that I'm reading in that is pipe delimited. (HL7
actually)
So far I have
my @record = split (/\|/,$_);
I want to take $record[16] and replace it with $record[16] /
$record[7] ONLY if $record[7] is not empty.
I have this accomplished by
On 10/25/07, Greg [EMAIL PROTECTED] wrote:
my @record = split (/\|/,$_); #split on '|' characters
My question comes in, how do I put the |'s back in the line in memory
so that I can continue with my working script?
I think you're looking for join(), maybe something like this:
my $line =
Hi All,
Thanks a lot for the advice/help. I think it would be better to avoid using
this feature :)
Regards,
Pavan
On 9/11/07, Jeff Pang [EMAIL PROTECTED] wrote:
2007/9/11, Pavanvithal Torvi [EMAIL PROTECTED]:
I wanted to ask others if this is expected behaviour.
Yes.
If I make use
On 9/11/07, Pavanvithal Torvi [EMAIL PROTECTED] wrote:
Hi All,
Thanks a lot for the advice/help. I think it would be better to avoid using
this feature :)
snip
It is perfectly safe to use negative indexes. Perl 6 won't be out for
a while and this feature change is one of the smaller
Pavanvithal Torvi [EMAIL PROTECTED] asked:
While debugging a script I came across a scenario where array
access was happening with a negative index.
(because of a corner case that was not properly handled).
This resulted in accessing the array in a reverse order.
[...]
I wanted to ask
2007/9/11, Pavanvithal Torvi [EMAIL PROTECTED]:
I wanted to ask others if this is expected behaviour.
Yes.
If I make use of this feature will it cause compatibility issues with the
later versions of perl.
Please don't use $a and $b as variable names,they are built-in
variables used by
On 9/10/07, Pavanvithal Torvi [EMAIL PROTECTED] wrote:
snip
If I make use of this feature will it cause compatibility issues with the
later versions of perl.
snip
Negative indexing has been around at least since Perl 5 (and I think
it goes back much farther than that). As for compatibility
On 11 Sep 2007 at 13:04, Chas Owens wrote:
Negative indexing has been around at least since Perl 5 (and I think
it goes back much farther than that). As for compatibility with
future versions of Perl, you should have no problem with the Perl 5
line (e.g. 5.10, the next and possibly last Perl
On 9/11/07, Jenda Krynicky [EMAIL PROTECTED] wrote:
snip
OH MY !
Yet another reason to stay away from Perl6.
After reading that part of S09 I can't keep from thinking that Perl6
was designed specifically for golf and obfu. Well *.
snip
Heh. Perl 6 is going to meet a lot of resistance, but
On Aug 16, 2007, at 11:47 AM, Sayed, Irfan (Irfan) wrote:
I have one array which stores some data after executing specific
command. Depends on situation , command has different output at
different time. sometime array may store 4 values or it may store 5
values.
Now my req. is that I need to
On 8/16/07, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
Hi All,
I have one array which stores some data after executing specific
command. Depends on situation , command has different output at
different time. sometime array may store 4 values or it may store 5
values.
Now my req. is that
programme should pick up the
third element of the array
Please help
Regards
Irfan.
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 16, 2007 4:16 PM
To: Sayed, Irfan (Irfan)
Cc: beginners@perl.org
Subject: Re: Array modification
On 8/16/07, Sayed
On 8/16/07, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote:
Thanks Chas but my req. is little bit different.
As I said the data in the array will not be fixed so I don't know how
many elements are present in the array. I don't want to just print the
contents of the array but to use the contents
On Sun, 2007-08-12 at 22:55 -0400, yitzle wrote:
I got an array of values where the order is relevent, eg the ages of
Alice, Bob and Charles, and I want to make a hash out of it. I got
this code that does it:
my %ages = (alice = $r[0], bob = $r[1], charles = $r[2]);
Is there a more elegent
Ken Foskey wrote:
On Sun, 2007-08-12 at 22:55 -0400, yitzle wrote:
I got an array of values where the order is relevent, eg the ages of
Alice, Bob and Charles, and I want to make a hash out of it. I got
this code that does it:
my %ages = (alice = $r[0], bob = $r[1], charles = $r[2]);
Is there
On Aug 13, 9:40 am, [EMAIL PROTECTED] (Ken Foskey) wrote:
On Sun, 2007-08-12 at 22:55 -0400, yitzle wrote:
I got an array of values where the order is relevent, eg the ages of
Alice, Bob and Charles, and I want to make a hash out of it. I got
this code that does it:
my %ages = (alice =
On Mon, 2007-08-13 at 07:47 -0700, Paul Lalli wrote:
On Aug 13, 9:40 am, [EMAIL PROTECTED] (Ken Foskey) wrote:
On Sun, 2007-08-12 at 22:55 -0400, yitzle wrote:
I got an array of values where the order is relevent, eg the ages of
Alice, Bob and Charles, and I want to make a hash out of it.
-Original Message-
From: yitzle [EMAIL PROTECTED]
Sent: Aug 12, 2007 10:55 PM
To: beginners@perl.org beginners@perl.org
Subject: Array to Hash
I got an array of values where the order is relevent, eg the ages of
Alice, Bob and Charles, and I want to make a hash out of it. I got
this
minky arora wrote:
Hello Team,
I have a problem and I need some ideas to put me on the right track to
form an algo:
I have four 8x12 arrays (Arr1,Arr2, Arr3,Arr4) and ONE 16x24 (ARR5) array.
Now these four arrays are formatted in a particular way by a robot(
these are actually plates with
On Aug 9, 5:38 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
minky arora wrote:
Hello Team,
I have a problem and I need some ideas to put me on the right track to
form an algo:
I have four 8x12 arrays (Arr1,Arr2, Arr3,Arr4) and ONE 16x24 (ARR5) array.
Now these four arrays are
On Aug 9, 5:13 pm, [EMAIL PROTECTED] (Minky Arora) wrote:
Hello Team,
I have a problem and I need some ideas to put me on the right track to
form an algo:
I have four 8x12 arrays (Arr1,Arr2, Arr3,Arr4) and ONE 16x24 (ARR5) array.
Please define I have. You are not talking about arrays in
On Jul 23, 4:35 am, [EMAIL PROTECTED] (Jeevs) wrote:
I just wanted to know what does the following line do
@{$args{owner}} = qw(hero wierd);
lets assume $args{owner} = 'sachin';
Then it would mean @{sachin} = qw(hero wierd);
what would {sachin} stand for does it mean an hash refernce or
On Jul 23, 1:51 pm, [EMAIL PROTECTED] (John W. Krahn) wrote:
John W. Krahn wrote:
jeevs wrote:
I just wanted to know what does the following line do
@{$args{owner}} = qw(hero wierd);
You are assigning a list to the anonymous array in $args{owner}.
lets assume $args{owner} =
jeevs wrote:
Hi forum!
Hello,
I just wanted to know what does the following line do
@{$args{owner}} = qw(hero wierd);
You are assigning a list to the anonymous array in $args{owner}.
lets assume $args{owner} = 'sachin';
'sachin' is a scalar value.
Then it would mean @{sachin} =
John W. Krahn wrote:
jeevs wrote:
I just wanted to know what does the following line do
@{$args{owner}} = qw(hero wierd);
You are assigning a list to the anonymous array in $args{owner}.
lets assume $args{owner} = 'sachin';
'sachin' is a scalar value.
Then it would mean @{sachin}
101 - 200 of 688 matches
Mail list logo