foreach ($a, $b, $c)...

K

Ken Sington

has anyone tried:

foreach ($a, $b, $c){
...
}

well, it doesn't work.

but what if I wanted to do that?
 
S

Sam Holden

has anyone tried:

foreach ($a, $b, $c){
...
}

well, it doesn't work.

It does work just fine, as long as your replace '...' with some valid
perl syntax.

"It doesn't work" isn't a useful problem description, especially when it
does in fact "work".
but what if I wanted to do that?

Then you do it.
 
X

Xaonon

Ken Sington said:
has anyone tried:

foreach ($a, $b, $c){
...
}

well, it doesn't work.

My, what a specific description of the problem. It "works" fine for me,
assuming the variables had already been defined.
 
C

ChrisO

Ken said:
has anyone tried:

foreach ($a, $b, $c){
...
}

well, it doesn't work.

but what if I wanted to do that?

Dude, what does "doesn't work" MEAN? Provide an EXAMPLE. It DOES work
if you do it right:

$ perl -e '$a = "This"; $b = "DOES"; $c = "work!"; for ($a, $b, $c) {
print "$_ \n" }'
This
DOES
work!

-ceo
 
T

Tad McClellan

Ken Sington said:
has anyone tried:

foreach ($a, $b, $c){
...
}

well, it doesn't work.


You are the only person who knows what "doesn't work" means when
you say it.

One or more other people must know what you mean when you say it
if they are to be able to help you understand, fix or change it...


You have not given us enough information to get an answer.

Have you seen the Posting Guidelines that are posted here frequently?
 
J

Jürgen Exner

Ken said:
has anyone tried:

I'm sure many people have
foreach ($a, $b, $c){
...
}

well, it doesn't work.

Please define "doesn't work".
- What did you expect it to do?
- What actual behaviour did you observe?
- In which way was the observed behaviour different from the expected
behaviour?
but what if I wanted to do that?

Please define "that". What did you expect this code fragment to do?

jue
 
K

Ken Sington

folks are too kind.
yeah, i read the guide lines.

I thought I was asking the right q. guess not.

well, the problem was solved.
I was just playing around with foreach loops.

but thanks folks.

great hobby, that PERL.
 
U

Uri Guttman

KS> folks are too kind.
KS> yeah, i read the guide lines.

KS> I thought I was asking the right q. guess not.

you asked the right question but with too little information. do you see
the difference? and as many have said, the phrase 'doesn't work' all by
itself is useless and carries no information. context is all.

KS> well, the problem was solved.
KS> I was just playing around with foreach loops.

and you never showed what the real problem was nor your 'solution'

KS> but thanks folks.

KS> great hobby, that PERL.

then pick up another hobby like juggling swiss army chainsaws. if you
want help and are asked for more information, you are supposed to give
it.

uri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top