Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > foreach ($a, $b, $c)...

Reply
Thread Tools

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

 
 
Ken Sington
Guest
Posts: n/a
 
      06-13-2004
has anyone tried:

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

well, it doesn't work.

but what if I wanted to do that?
 
Reply With Quote
 
 
 
 
Sam Holden
Guest
Posts: n/a
 
      06-13-2004
On Sat, 12 Jun 2004 20:52:49 -0400,
Ken Sington <ken_sington@nospam_abcdefg.com> wrote:
> 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.

--
Sam Holden
 
Reply With Quote
 
 
 
 
Xaonon
Guest
Posts: n/a
 
      06-13-2004
Ned i bach <(E-Mail Removed)>, Ken Sington
<ken_sington@nospam_abcdefg.com> teithant i thiw hin:

> 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.

--
Xaonon, EAC Chief of Mad Scientists and informal BAAWA, aa #1821, Kibo #: 1
http://xaonon.dyndns.org/ Guaranteed content-free since 1999. No refunds.
"Accepting that identity is relative means two things: that immortality is
impossible, and that immortality is inevitable." -- Eric Zetterbaum
 
Reply With Quote
 
ChrisO
Guest
Posts: n/a
 
      06-13-2004
Ken Sington wrote:
> 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
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      06-13-2004
Ken Sington <ken_sington@nospam_abcdefg.com> wrote:
> 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?



--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      06-13-2004
Ken Sington wrote:
> 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


 
Reply With Quote
 
Ken Sington
Guest
Posts: n/a
 
      06-14-2004
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.
 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      06-14-2004
>>>>> "KS" == Ken Sington <ken_sington@nospam_abcdefg.com> writes:

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

--
Uri Guttman ------ (E-Mail Removed) -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find web user control using foreach in DataList caldera ASP .Net 1 02-22-2005 09:23 PM
loop througth Literials using foreach!! Islam Elkhayat ASP .Net 16 02-12-2005 01:51 AM
Problem with foreach loop =?Utf-8?B?SnVzdGlu?= ASP .Net 2 10-22-2004 08:35 AM
Re: foreach loop error Luc Kumps ASP .Net 0 08-22-2003 10:16 PM
Re: foreach loop error Kevin Spencer ASP .Net 0 08-22-2003 09:11 PM



Advertisments