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
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
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
> > > >
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...
>
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
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
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
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
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
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
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
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/
--- "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)
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/
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
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
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
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
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
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
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
.--[ 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
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
23 matches
Mail list logo