Re: array modification

2007-12-13 Thread Jenda Krynicky
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 s

Re: array modification

2007-12-13 Thread John W . Krahn
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 el

Re: array modification

2007-12-13 Thread Jenda Krynicky
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 > > > >

Re: array modification

2007-12-12 Thread Chas. Owens
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... >

Re: array modification

2007-12-12 Thread Steve Bertrand
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

Re: array modification

2007-12-12 Thread Rob Dixon
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] http://learn.perl.or

Re: array modification

2007-12-12 Thread Rob Dixon
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 characte

Re: array modification

2007-12-12 Thread John W . Krahn
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 variabl

Re: array modification

2007-12-12 Thread Jenda Krynicky
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 > > as

Re: array modification

2007-12-12 Thread Chas. Owens
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

Re: array modification

2007-12-12 Thread Chas. Owens
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

Re: array modification

2007-12-12 Thread protoplasm
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/

Re: array modification

2007-12-11 Thread jeff pang
--- "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)

Re: array modification

2007-12-11 Thread yitzle
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/

array modification

2007-12-11 Thread Sayed, Irfan (Irfan)
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 Now i want output like dadsad assasd so i did for (@array) { print $_,"\n"; } My query is that can i store the output of this for loop in vari

Re: Array modification

2007-08-16 Thread Chas Owens
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 co

RE: Array modification

2007-08-16 Thread Sayed, Irfan (Irfan)
on then my 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

Re: Array modification

2007-08-16 Thread Chas Owens
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

Re: Array modification

2007-08-16 Thread Xavier Noria
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 as

Array modification

2007-08-16 Thread Sayed, Irfan (Irfan)
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 I need to assign no. to those values. for example: if arra

Re: Array modification

2002-10-22 Thread John W. Krahn
Schwedler Kofoed wrote: > > Hi There, Hello, > I would like to change a array @xx looking like this: > > R23 4587 4985934 3245324 6 > > to: > > R23 4587 4985934 3245324 6 > > with other words I would like to insert (not replace) at character > position 8 and 31. I have h

Re: Array modification

2002-10-22 Thread Frank Wiles
.--[ Schwedler Kofoed wrote (2002/10/22 at 20:25:01) ]-- | | Hi There, | | I would like to change a array @xx looking like this: | | R23 4587 4985934 3245324 6 | | to: | | R23 4587 4985934 3245324 6 | | with other words I would like to insert (n

Array modification

2002-10-22 Thread Schwedler Kofoed
Hi There, I would like to change a array @xx looking like this: R23 4587 4985934 3245324 6 to: R23 4587 4985934 3245324 6 with other words I would like to insert (not replace) at character position 8 and 31. I have have tried to use splice and substr but since the changes