Re: Difference between for & foreach loop

2009-05-25 Thread Chas. Owens
On Mon, May 25, 2009 at 23:50, sanket vaidya wrote: snip > So to conclude > 'for' & 'foreach' are the two different ways to write same thing & there is > no particular advantage of using one over other. > > Group, correct me if I am wrong. snip I wouldn't say there is no advantage; for is four ch

RE: Difference between for & foreach loop

2009-05-25 Thread sanket vaidya
-Original Message- From: Randal L. Schwartz [mailto:mer...@stonehenge.com] Sent: Monday, May 25, 2009 10:10 PM To: beginners@perl.org Subject: Re: Difference between for & foreach loop > ""sanket" == "sanket vaidya" writes: "sanket> What is the difference between the 'for' & 'foreac

Re: interaction with a module and http tags

2009-05-25 Thread Gunnar Hjalmarsson
jm wrote: Gunnar Hjalmarsson wrote: jm wrote: seems to be some requirement for html via a module call that's not necessary in straight perl inline html. I'm still confused about what the real problem is, but it sounds like you are on the wrong track. AFAIK, there is no "straight perl inline

Re: interaction with a module and http tags

2009-05-25 Thread jm
when i say "straight perl inline html" i refer to html written in a print statement such as print " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";> http://www.w3.org/1999/xhtml\"; lang=\"en\" xml:lang=\"en\"> Floot Fire Privacy ... "; this

Re: interaction with a module and http tags

2009-05-25 Thread Gunnar Hjalmarsson
jm wrote: it's not Mason; it's strictly homegrown code. seems to be some requirement for html via a module call that's not necessary in straight perl inline html. I'm still confused about what the real problem is, but it sounds like you are on the wrong track. AFAIK, there is no "straight pe

Re: interaction with a module and http tags

2009-05-25 Thread jm
Ray, it's not Mason; it's strictly homegrown code. seems to be some requirement for html via a module call that's not necessary in straight perl inline html. thanks for the suggestion, though. i appreciate your suggestion. joe On Mon, May 25, 2009 at 8:22 PM, Raymond Wan wrote: > > Hi Joe,

Re: interaction with a module and http tags

2009-05-25 Thread Raymond Wan
Hi Joe, jm wrote: why do the tags in the sub work and the page display perfectly with the additional empty tags, yet only print out the code as ascii output when i remove the 2nd set of tags? why are the tags in the sub not considered legitimate html code when the structures are identica

Re: interaction with a module and http tags

2009-05-25 Thread Gunnar Hjalmarsson
jm wrote: i've created a module, part of which creates the beginning of a web page. the module overall works fine. the sub in question even works fine, except for one point. here's the sub in the module: sub html_start { my %options = @_; # $options{title} = page ti

interaction with a module and http tags

2009-05-25 Thread jm
i've created a module, part of which creates the beginning of a web page. the module overall works fine. the sub in question even works fine, except for one point. here's the sub in the module: sub html_start { my %options = @_; # $options{title} = page title

Re: Difference between for & foreach loop

2009-05-25 Thread Randal L. Schwartz
> ""sanket" == "sanket vaidya" writes: "sanket> What is the difference between the 'for' & 'foreach' loops? I know that they "sanket> can be used interchangeably then what is the purpose of keeping them "sanket> separate? Can anyone suggest me a good url which can tell the difference "sanke

Re: Difference between for & foreach loop

2009-05-25 Thread Chas. Owens
On Mon, May 25, 2009 at 03:16, Gunnar Hjalmarsson wrote: > sanket vaidya wrote: >> >> What is the difference between the 'for' & 'foreach' loops? I know that >> they >> can be used interchangeably then what is the purpose of keeping them >> separate? > > The _words_ 'for' and 'foreach' can be used

Re: readdir() question

2009-05-25 Thread Telemachus
On Mon May 25 2009 @ 4:34, sanket vaidya wrote: > Hi all, > > > > Kindly look at the code below: > > > > use warnings; > > use strict; > > opendir(DIR, "D:\\test") || die "can't opendir: $!"; > > my @dots = readdir(DIR); > > print map{"$_.\n"}...@dots; > > > > .. > > ... > > Tes

readdir() question

2009-05-25 Thread sanket vaidya
Hi all, Kindly look at the code below: use warnings; use strict; opendir(DIR, "D:\\test") || die "can't opendir: $!"; my @dots = readdir(DIR); print map{"$_.\n"}...@dots; .. ... Test1 Test2 Test3 Where Test1, Test2, Test3 are files within test directory. Apart from that

Re: Difference between for & foreach loop

2009-05-25 Thread Gunnar Hjalmarsson
sanket vaidya wrote: What is the difference between the 'for' & 'foreach' loops? I know that they can be used interchangeably then what is the purpose of keeping them separate? The _words_ 'for' and 'foreach' can be used interchangeably in foreach loops, but a true for loop is something else.

Re: Difference between for & foreach loop

2009-05-25 Thread Erez Schatz
2009/5/25 sanket vaidya : > What is the difference between the 'for' & 'foreach' loops? There is none. http://perldoc.perl.org/perlsyn.html#Foreach-Loops : "The foreach keyword is actually a synonym for the for keyword, so you can use foreach for readability or for for brevity. (Or because the