On Sun, Mar 10, 2013 at 11:06:14AM -0400, Brandon McCaig wrote:
> There is no array here. There are only lists. See perldoc
> perldata.
>
> > List value constructors
> > List values are denoted by separating individual values
> > by commas (and enclosing the list in parentheses where
semantics). Thus, in your example above you passed split
/PATTERN/ and /EXPR/ (split is built-in and its semantics are not
the same as user-defined functions), and in exchange split
returned a list of ('a', 'b', 'c'), which your for-loop then
iterated over. At no poin
On Sat, Mar 09, 2013 at 08:19:43PM -0600, Chris Stinemetz wrote:
> I don't think that is true.
>
> Example being:
>
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> use Data::Dumper;
>
> my $firstVar = "One";
> my $secondVar = "Two";
>
> my @array;
> push @array,[$firstVar, $secondVar];
>
On Sat, Mar 9, 2013 at 2:57 PM, Brandon McCaig wrote:
> On Sat, Mar 09, 2013 at 07:24:37AM -0600, Chris Stinemetz wrote:
> > Each anonymous array @files and @newFiles has 5 total elements.
>
> Just to nitpick, @files and @newFiles are not anonymous arrays.
> They are just arrays. They have names.
On Sat, Mar 09, 2013 at 07:24:37AM -0600, Chris Stinemetz wrote:
> Each anonymous array @files and @newFiles has 5 total elements.
Just to nitpick, @files and @newFiles are not anonymous arrays.
They are just arrays. They have names. You cannot have anonymous
arrays in Perl except by reference. Th
------
Your talent is God's gift to you. What you do with it is your gift back to God.
---
From: Chris Stinemetz
To
Never mind, I got it.
I was over thinking it.
I just created one anonymous array with the elements I wanted then used the
following loop.
foreach my $file (@files) {
print join( "\t", @$file[0], @$file[1] ), "\n";
$ftp->put(@$file[0], @$file[1]) || die "can't put files: @$file[0] \t
@$file[1
Thank you in advance.
Each anonymous array @files and @newFiles has 5 total elements.
How can I alter this nested for so that just the unique elements are
printed instead of each element twice?
foreach my $file (@files) {
foreach my $newFileName ( @newFiles ) {
print join( "\t", @$file, @$ne
nt would be 'za' which is 'longer'
> > than the final value specified'; whereas, 'yz' isn't:
>
> Actually, no. "z" is in the sequence, so it stops there.
>
> Try:
>
> for ( 'u' .. ' ' ){
> print "$_ "
C.DeRykus wrote:
And, here's the doozy for me as I tried remembering:
If the final value specified is not in the sequence that the
magical increment would produce, the sequence continues
until the next value is longer than the final value specified.
On Apr 13, 8:54 am, shawnhco...@gmail.com (Shawn H Corey) wrote:
> C.DeRykus wrote:
> > Clear as mud? Did you say 'Hell, no'...? Go then and
> > meditate on autoincrement magic, grasshopper. When
> > enlightenment comes, please report back and explain it
> > to us too...
>
> Actually, it is be
2010/4/13 Magne Sandøy :
> Thanks for all the good info. I think I have a grasp on incrementing and
> comparison, but now, what puzzles me, is the fact that when I use "le" less
> than or equal, why does it actually increment the "z"? It is by then passed
> the less than, and already at equal to "z
Shawn H Corey wrote:
Owen wrote:
On Tue, 13 Apr 2010 05:35:51 +0200
Magne Sandøy wrote:
Hi.
I'm new to perl, and I stumbled across a strange behavior in my for
loop. In the following code, the second for loop actually counts way
passed what I expected, and actually stops at "yz&q
C.DeRykus wrote:
Clear as mud? Did you say 'Hell, no'...? Go then and
meditate on autoincrement magic, grasshopper. When
enlightenment comes, please report back and explain it
to us too...
Actually, it is because string-comparison operators order strings
differently than auto-increment.
On Apr 12, 8:35 pm, msan...@gmail.com (Magne Sandøy) wrote:
> Hi.
>
> I'm new to perl, and I stumbled across a strange behavior in my for loop.
> In the following code, the second for loop actually counts way passed
> what I expected, and actually stops at "yz" and n
Owen wrote:
On Tue, 13 Apr 2010 05:35:51 +0200
Magne Sandøy wrote:
Hi.
I'm new to perl, and I stumbled across a strange behavior in my for
loop. In the following code, the second for loop actually counts way
passed what I expected, and actually stops at "yz" and not "z&qu
On Tuesday 13 Apr 2010 11:17:12 Magne Sandøy wrote:
[SNIP]
>
> Hi again.
>
> Does this mean this is a bug?
It's not a bug - this is how it works.
> My point is to get "z" at the end. Using "eq" or lt" wont work.
You need to evaluate the condition at the end of the loop instead of at the
begin
Shlomi Fish wrote:
Hi Magne,
On Tuesday 13 Apr 2010 10:37:15 Magne Sandøy wrote:
Shlomi Fish wrote:
Hi Magne,
On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote:
Hi.
I'm new to perl, and I stumbled across a strange behavior in my for
loop. In the following code, the s
Hi Magne,
On Tuesday 13 Apr 2010 10:37:15 Magne Sandøy wrote:
> Shlomi Fish wrote:
> > Hi Magne,
> >
> > On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote:
> >> Hi.
> >>
> >> I'm new to perl, and I stumbled across a strange behavior in my
Shlomi Fish wrote:
Hi Magne,
On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote:
Hi.
I'm new to perl, and I stumbled across a strange behavior in my for loop.
In the following code, the second for loop actually counts way passed
what I expected, and actually stops at "yz"
Hi Magne,
On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote:
> Hi.
>
> I'm new to perl, and I stumbled across a strange behavior in my for loop.
> In the following code, the second for loop actually counts way passed
> what I expected, and actually stops at "yz"
On Tue, 13 Apr 2010 05:35:51 +0200
Magne Sandøy wrote:
> Hi.
>
> I'm new to perl, and I stumbled across a strange behavior in my for
> loop. In the following code, the second for loop actually counts way
> passed what I expected, and actually stops at "yz" and not
Hi.
I'm new to perl, and I stumbled across a strange behavior in my for loop.
In the following code, the second for loop actually counts way passed
what I expected, and actually stops at "yz" and not "z" as expected.
As shown by the third for loop, incrementing the l
PigInACage wrote:
> Hello all.
>
> I've got a file CSV with 3 column
> name,surname,group
>
> if one of the column has got a space like
> Davide,Super Dooper,Group
> I cannot use it in a for loop
>
> for i in `cat list.csv` ; do echo $i ; done
> the r
On Fri, Nov 27, 2009 at 6:32 PM, PigInACage wrote:
> Hello all.
>
> I've got a file CSV with 3 column
> name,surname,group
>
> if one of the column has got a space like
> Davide,Super Dooper,Group
> I cannot use it in a for loop
>
> for i in `cat list.csv`
PigInACage wrote:
> Hello all.
>
> I've got a file CSV with 3 column
> name,surname,group
>
> if one of the column has got a space like
> Davide,Super Dooper,Group
> I cannot use it in a for loop
>
> for i in `cat list.csv` ; do echo $i ; done
> the r
Hello all.
I've got a file CSV with 3 column
name,surname,group
if one of the column has got a space like
Davide,Super Dooper,Group
I cannot use it in a for loop
for i in `cat list.csv` ; do echo $i ; done
the result is
Davide,Super
Dooper,Group
how can I have all inone line?
Really t
Bryan Harris wrote:
Note that the foreach variable is an alias to the loop list so modifying
the variable also modifies the list elements.
Out of curiosity, is it possible to manually create aliases like this as
well? e.g. to make $x an alias to $y?
I do not know the exact answer to your que
[lots of stuff cut out]
> Note that the foreach variable is an alias to the loop list so modifying
> the variable also modifies the list elements.
Out of curiosity, is it possible to manually create aliases like this as
well? e.g. to make $x an alias to $y?
- B
--
To unsubscribe, e-mail: b
Kelly Jones wrote:
If I do a for loop in a subroutine, do I have to declare it private
with my()? I always though for() did that for me, but I ran into a bug
where code like this:
sub foo {for $i (1..2) {print $i;}}
affected my global $i (I think). Or was I imagining it?
The variable in a
Kelly Jones wrote:
If I do a for loop in a subroutine, do I have to declare it private
with my()? I always though for() did that for me, but I ran into a bug
where code like this:
sub foo {for $i (1..2) {print $i;}}
affected my global $i (I think). Or was I imagining it?
Probably, since $i
If I do a for loop in a subroutine, do I have to declare it private
with my()? I always though for() did that for me, but I ran into a bug
where code like this:
sub foo {for $i (1..2) {print $i;}}
affected my global $i (I think). Or was I imagining it?
--
We're just a Bunch Of Regular Gu
e loop does what i'm after
#my $pos = -1;
#while(1) {
#$pos = index($string, $subString, $pos + 1); # find next
position
#print "\nPOS: $pos\n";
#last if $pos == -1; # index returns -1 if substring has no
match
#push @indexes, $pos;
#}
# Wanted to convert it to a for
dippa wrote:
>
> Trying to work out why:
> 1. the for loop does not work, want the same logic as the while loop
> 2. for(my $pos = -1; $pos == -1; $pos++) only iterates through once
> 3. for(my $pos = 0; $pos == -1; $pos++) does not enter loop at all
Because in both cases your
x27;m after
#my $pos = -1;
#while(1) {
#$pos = index($string, $subString, $pos + 1); # find next
position
#print "\nPOS: $pos\n";
#last if $pos == -1; # index returns -1 if substring has no
match
#push @indexes, $pos;
#}
# Wanted to convert it to a for loop for learni
On Dec 21, 2007 3:49 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I want to determine the duration of the single iterations of
> a for-loop i.e. after each iteration the duration should
> be printed out. Is there a function for this implemented or
> must this be done with
On Friday 21 December 2007 03:49, [EMAIL PROTECTED] wrote:
>
> Hello,
Hello,
> I want to determine the duration of the single iterations of
> a for-loop i.e. after each iteration the duration should
> be printed out. Is there a function for this implemented or
> must thi
Hello,
I want to determine the duration of the single iterations of
a for-loop i.e. after each iteration the duration should
be printed out. Is there a function for this implemented or
must this be done with the difference of two times
derived from localtime? Thank you very much!
Guenter
Gowtham schreef:
> Martin Barth:
>>> for my ($index = 0; $index <= 10; $index++) {
>>>print ("$hour:$min:$sec\n");
>>> }
>>
>> for my $index (0..10){
>> print ("$hour:$min:$sec\n");
>> }
>
> Don't wrap the entire loop initializer, condition and
> counter update in my(). [...]
Gowtham,
On Jul 10, 9:13 pm, [EMAIL PROTECTED] (Martin Barth) wrote:
> > for my ($index = 0; $index <= 10; $index++) {
>
> > print ("$hour:$min:$sec\n");
>
> > }
>
> for my $index (0..10){
> print ("$hour:$min:$sec\n");
>
> }
>
> hth
Don't wrap the entire loop initializer, condition and counter upd
CM Analyst wrote:
for my ($index = 0; $index <= 10; $index++) {
for (my $index = 0; $index <= 10; $index ++ ) {
--- Shawn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
> for my ($index = 0; $index <= 10; $index++) {
>
> print ("$hour:$min:$sec\n");
>
> }
for my $index (0..10){
print ("$hour:$min:$sec\n");
}
hth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hello.
I have this code that works fine without the for loop
but fails with it with this error message:
"Missing $ on loop variable at time.pl line 7."
Here's the code itself:
###
use strict;
use warnings;
use Time::Local;
my ($sec, $min, $hour, $mday, $mon, $yea
essageID (90){
> : print $messageID . "\n";
> : }
> : It outputs nothing..
>
> Actually, it outputs "90\n". There is no reason why
> the list in a 'for' loop cannot iterate over just one item.
> In fact, it can make testing easier by allowing us t
ot;90\n". There is no reason why
the list in a 'for' loop cannot iterate over just one item.
In fact, it can make testing easier by allowing us to
substitute a list with just one test item.
foreach my $item ( @very_large_array ) {
print "$item\n";
}
Can be rep
Few things that I can see. I'm sure others will give you more ideas.
On 7/27/05, David Foley <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>Can you please look at the below script. The SQL query
> works on it's own in separate script. But not when it is put into
Hi Guys,
Can you please look at the below script. The SQL query
works on it's own in separate script. But not when it is put into the
"for" loop in this script
. Any ideas??
Hello. I've been hacking on Erik Oliver's rather
nice setext-to-html script, refining it beyond the
original interpretations of setext back in 2002.
I've run into two major snags that my limited
knowledge
of Perl is not allowing me to get past. I'd
appreciate
any pointers or assistance anyone ca
JupiterHost.Net wrote:
Andrew Gaffney wrote:
Charles K. Clarkson wrote:
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
: : I have code that uses a 'foreach(@array) {}' to loop
: through an array. I now need to be able to get the
: array index inside of that. I know I could switch to
: a 'for($loopva
Andrew Gaffney wrote:
Charles K. Clarkson wrote:
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
: : I have code that uses a 'foreach(@array) {}' to loop
: through an array. I now need to be able to get the
: array index inside of that. I know I could switch to
: a 'for($loopvar=0;$loopvar<@array;$lo
Charles K. Clarkson wrote:
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
:
: I have code that uses a 'foreach(@array) {}' to loop
: through an array. I now need to be able to get the
: array index inside of that. I know I could switch to
: a 'for($loopvar=0;$loopvar<@array;$loopvar++) {}' to
: do that
I have code that uses a 'foreach(@array) {}' to loop through an array. I
now need to be able to get the array index inside of that. I know I
could switch to a 'for($loopvar=0;$loopvar<@array;$loopvar++) {}' to do
that, but I'd have to change some other code also. If not that way, is
there a way
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
:
: I have code that uses a 'foreach(@array) {}' to loop
: through an array. I now need to be able to get the
: array index inside of that. I know I could switch to
: a 'for($loopvar=0;$loopvar<@array;$loopvar++) {}' to
: do that, but I'd have to change so
I have code that uses a 'foreach(@array) {}' to loop through an array. I now need to be
able to get the array index inside of that. I know I could switch to a
'for($loopvar=0;$loopvar<@array;$loopvar++) {}' to do that, but I'd have to change some
other code also. If not that way, is there a way
u can use $max_days_old=67).
Rob
-Original Message-
From: Damian Scott [mailto:[EMAIL PROTECTED]
Sent: Monday, January 19, 2004 8:48 PM
To: [EMAIL PROTECTED]
Subject: for loop not ending
Ok. Here's my situation. I am modifying a Perl script that was created
some time ago and am
Ok. Here's my situation. I am modifying a Perl script that was created
some time ago and am learning Perl on kind of a "trial by fire" basis
(with a couple of good books).
The problem was first brought to my attention that we still had old log
files greater than 60 old. The gziplog Perl scri
On Jul 13, Janek Schleicher said:
>Hari Krishnaan wrote at Thu, 10 Jul 2003 14:03:32 -0700:
>
>> I was using a for loop in the following manner in one of my perl programs.
>>
>> for($j=31, $n=$initial;$j>=0,$n<=$final;$j--,$n++) {
The test of $j >= 0 is waste
Hari Krishnaan wrote at Thu, 10 Jul 2003 14:03:32 -0700:
> I was using a for loop in the following manner in one of my perl programs.
>
> for($j=31, $n=$initial;$j>=0,$n<=$final;$j--,$n++) {
>
> # Executing statements here
> }
> }
> 1) Is it legal in perl to
Date sent: Thu, 10 Jul 2003 14:03:32 -0700 (PDT)
From: Hari Krishnaan <[EMAIL PROTECTED]>
Subject:Question on For loop usage in Perl
To: [EMAIL PROTECTED]
> Hello all,
> I was using a for loop in the following manner
Hello all,
I was using a for loop in the following manner in one of my perl programs.
for($j=31, $n=$initial;$j>=0,$n<=$final;$j--,$n++) {
# Executing statements here
}
1) Is it legal in perl to use the for loop as mentioned above ?
2) If so when i compile perl gives a message as f
"Johnson, Shaunn" wrote:
> --thanks for the reply.
>
> --even still, if the file already exists,
> --nothing is printed inside of the file.
> --it's still empty and i'm not sure
> --where it's breaking down.
>
> --i mean, i can see that it doesn't
> --even print the first line (print statement),
>
Shaunn Johnson wrote:
> --Rob
>
> --Thanks for your script! Looks like it works like
> --a champ!
>
> --However, I don't have a clear understanding
> --as to *how* it works. Specifically, how is the
> --'build regex' being applied inside the SQL?
> --I mean, how is it getting IN there?
> --I'm lo
--Rob
--Thanks for your script! Looks like it works like
--a champ!
--However, I don't have a clear understanding
--as to *how* it works. Specifically, how is the
--'build regex' being applied inside the SQL?
--I mean, how is it getting IN there?
--I'm looking at it and I don't fully grok the
Rob Dixon wrote:
>
> John W. Krahn wrote:
> >
> > You should show the OP how to do it in perl. :-)
>
> Yes, but tough to do when I can only guess what 'date' does
> and I have no *nix system with me.
Rob, Rob, Rob ... you mean you're still running that evil MS OS? ;-)
> Thanks for filling the
John W. Krahn wrote:
> Rob Dixon wrote:
> >
> > Shaunn Johnson wrote:
> > >
> > > # create a few variables
> > > my $addr='[EMAIL PROTECTED]';
> > > #my $outfile=`date +%d%b%Y`;
> > > my $outfile=`date | cut -f 1 -d ' '`;
> > > my $datetype=`date`;
> > > my $file='/usr/local/home/joe/tmp/backup_lis
Rob Dixon wrote:
>
> Shaunn Johnson wrote:
> >
> > # create a few variables
> > my $addr='[EMAIL PROTECTED]';
> > #my $outfile=`date +%d%b%Y`;
> > my $outfile=`date | cut -f 1 -d ' '`;
> > my $datetype=`date`;
> > my $file='/usr/local/home/joe/tmp/backup_list.txt';
> > my $matchday=`date +%a`;
> >
e the loop, or, if
> I create a file outside of the for loop, nothing
> is written in the file.
>
> What am I doing wrong?
>
> When I run the script as-is, I do not get an error,
> but I don't get the results that I expect, either.
>
> If I change the script so that
x27;t know *why* it's not printing
--anything and not returning an error.
--any thoughts?
-X
-Original Message-
From: WC -Sx- Jones [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 1:56 PM
To: [EMAIL PROTECTED]
Subject: Re: problem opening file inside for-loop
On Wednesday, May 2
On Wednesday, May 28, 2003, at 12:43 PM, Johnson, Shaunn wrote:
my $file='/usr/local/home/joe/tmp/backup_list.txt';
You cannot create a variable from something that does not yet exist.
Try creating it first:
`touch /usr/local/home/joe/tmp/backup_list.txt`;
my $file='/usr/local/home/joe/tmp/ba
Howdy:
I have a script where I would like to connect to
my database (PostgreSQL) and do a dump
depending on what day it is. I'm having
problems trying to figure out why I either can't
open a file to write to it inside the loop, or, if
I create a file outside of the for loop, nothing
Hi Michael.
Michael Hooten wrote:
> While stepping through the code I wrote, I distinctly noted that the
> substitution on $_ did NOT affect the array and vice versa.
If you watch carefully what Perl is doing, it aliases correctly _until_
you choose to modify the array. After this the correct val
PROTECTED]
Subject: Re: For loop aliasing AND changing an array within a loop.
On Wed, Jan 22, 2003 at 02:10:34PM -0800, John W. Krahn wrote:
> Zeus Odin wrote:
> > I think I read somewhere that you should NOT delete array elements from
> > within a loop. However, the following
Paul Johnson wrote:
>
> On Wed, Jan 22, 2003 at 02:10:34PM -0800, John W. Krahn wrote:
> >
> > I think that you are thinking of hashes.
>
> From perlsyn:
>
> If any part of LIST is an array, "foreach" will get very
> confused if you add or remove elements within the loop
> body, for example
On Wed, Jan 22, 2003 at 02:10:34PM -0800, John W. Krahn wrote:
> Zeus Odin wrote:
> > I think I read somewhere that you should NOT delete array elements from
> > within a loop. However, the following works very well.
>
> I think that you are thinking of hashes.
From perlsyn:
If any part of LIS
Zeus Odin wrote:
>
> When you loop through an array
>
>for(@array){ ... }
>
> should not each array element be aliased into $_: if you change $_, you
> also change the element?
Yes, that is correct.
> This is what I remembered. However, a problem I
> just encountered shook this recollectio
When you loop through an array
for(@array){ ... }
should not each array element be aliased into $_: if you change $_, you
also change the element? This is what I remembered. However, a problem I
just encountered shook this recollection.
I think I read somewhere that you should NOT delete arra
> >> my @array = (1 .. 100);
> >> my $counter = 0;
> >>
> >> for (@array) {
> >> print "index -> $counter element -> $_\n";
> >> $counter++;
> >> }
> >
> > The other approach is to use a C-style for-
On Thursday, April 11, 2002, at 05:09 , Jeff 'japhy' Pinyan wrote:
>> my @array = (1 .. 100);
>> my $counter = 0;
>>
>> for (@array) {
>> print "index -> $counter element -> $_\n";
>> $counter++;
>> }
>
> The oth
comments:
the for loop looks at the first element (0), @ary gets shifted inside the
loop, then the for loop looks at the second element in @ary, which is now 2,
since the 0 was shifted off the front. @ary is shifted again inside and
then the for loop looks at the third element remaining
Hi all,
I've noticed some interesting behavior when trying to shift an array that
you're iterating over. For example:
my @ary = (0..1000);
for (@ary)
{
if($_ <= 1000)
{
shift @ary;
}
}
print scalar @ary, "\n";
This prints 500 on my NT box with ActiveStat
McCoy"
cc: "Nikola Janceski"
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED]
02/20/2002 04:26 Subject: RE: Grep function inside
On Wed, 20 Feb 2002 [EMAIL PROTECTED] wrote:
> Thank you - it worked. I got my output as expected. But why is '\n'
> considered so bad in perl unlike shell scripting. Why did I not get the
> output with '\n'. Just curious!!!
It's not considered bad, but it can mess up things when you are trying
<[EMAIL PROTECTED]>
02/20/2002 10:02 AM cc: [EMAIL PROTECTED]
Subject: RE
Subject:Grep function inside a for loop does grep the values.
To: [EMAIL PROTECTED]
BCC to: From: [EMAIL PROTECTED]
Date sent: Tue, 19 Feb 2002 17:13:00 -0500
> Can somebody help me on what is wrong in
;, "N015\n");
let us know how it goes.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 9:11 AM
To: Nikola Janceski
Cc: [EMAIL PROTECTED]
Subject: RE: Grep function inside a for loop does NOT grep the values.
Thanks guys,
[EMAIL PROTECTED]
cc:
02/19/2002 05:28 PM Subject: RE: Grep function inside
a for loop does NOT grep the
can you give us a snip of what's in
@prv_lst
@txn_log
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: Grep function inside a for loop does NOT grep the values.
Hi,
I am sorry, I mea
On Tue, 19 Feb 2002 [EMAIL PROTECTED] wrote:
> Can somebody help me on what is wrong in the following piece of code?
>
> foreach (@prv_lst)
> {
> $item = $_;
> @list_prv = grep (/$item/, @txn_log);
> print "The foll. are the Txn details for Trading Partner $item \n";
>
Hi,
I am sorry, I meant to say grep does not work inside a for loop.
regards,
Satya
- Forwarded by Satya Devarakonda/THP on 02/19/2002 05:18 PM
Can somebody help me on what is wrong in the following piece of code?
foreach (@prv_lst)
{
$item = $_;
@list_prv = grep (/$item/, @txn_log);
print "The foll. are the Txn details for Trading Partner $item \n";
print @list_prv;
for (@txn_lst)
{
Hi
Everyone had to crawl before they could walk,
JON, stop being polite and help me
I need your assistance now...
Cheers
Bruce
>>> Jon Molin <[EMAIL PROTECTED]> 02/14/02 12:00PM >>>
This smells homework!
/jon
Bruce Ambraal wrote:
>
> Hi
>
> I have done (b) for coding see below, could som
This smells homework!
/jon
Bruce Ambraal wrote:
>
> Hi
>
> I have done (b) for coding see below, could someone assist with
> (a) (b) (d)
>
> #!/usr/local/bin/perl -w
> my $num_rows;
> my $i;
> my $r;
>
> $num_rows = ;
>
> for ($r = 1; $r <= $num_rows; $r++)
> {
> for ($i=1; $i<=
Hi
I have done (b) for coding see below, could someone assist with
(a) (b) (d)
#!/usr/local/bin/perl -w
my $num_rows;
my $i;
my $r;
$num_rows = ;
for ($r = 1; $r <= $num_rows; $r++)
{
for ($i=1; $i<= $r; $i++) {print (" \n");}
for ($i = $num_rows + 1 - $r;$i>=1; $i--){ pr
Hi
I have done (b) for coding see below, could someone assist with
(a) (b) (d)
#!/usr/local/bin/perl -w
my $num_rows;
my $i;
my $r;
$num_rows = ;
for ($r = 1; $r <= $num_rows; $r++)
{
for ($i=1; $i<= $r; $i++) {print (" \n");}
for ($i = $num_rows + 1 - $r;$i>=1; $i--){ pr
IL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: August 10, 2001 8:03 AM
Subject: problems with a for-loop
>I'm stuck with a for-loop and would appreciate any help I can get. I
hope
>the code is somewhat intelligible, as it comes out of a larger
script.
>
&g
I'm stuck with a for-loop and would appreciate any help I can get. I hope
the code is somewhat intelligible, as it comes out of a larger script.
The code serves to print out individual search results for a flatfile
database query, called in a cgi-script.
All matching records are stor
On Sun, 24 Jun 2001, Tim Grossner wrote:
> I am using a for (@targets) loop to connect to cisco routers...if the
> target is unreachable I need it to go on to the next target in the array
> @targets. What should I look for? An "else" statement or what?
You can do something like this:
for(@targe
foo) { if (condition) {do stuff } }
hth,
Jos Boumans
- Original Message -
From: "Tim Grossner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 24, 2001 11:13 PM
Subject: For loop...
> I am using a for (@targets) loop to connect to cisco routers...if
I am using a for (@targets) loop to connect to cisco routers...if the
target is unreachable I need it to go on to the next target in the array
@targets. What should I look for? An "else" statement or what?
Tim Grossner
voice - 217-438-6161
pager - 217-467-3148
cell - 217-971-3060
data - [EMAIL
99 matches
Mail list logo