CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
why sometimes $. doesnt work

 



fenniger
Novice

Sep 13, 2008, 11:24 PM

Post #1 of 2 (309 views)
why sometimes $. doesnt work Can't Post

hello there, very basic question:

at first I wrote a segment of code like this:

print OUTPUT "word num $.: $_\n" foreach(@allwords)

and the output came out to be:

word num 0: *the word*

word num 0: *the next word*

.

.

so I thought something was wrong with the syntax and I wrote it this way:

foreach(@allWords) {
print OUTPUT "word num $.: $_\n" ;
}

and yet, same output... why doesnt $. iterate?


KevinR
Veteran


Sep 14, 2008, 12:50 AM

Post #2 of 2 (299 views)
Re: [fenniger] why sometimes $. doesnt work [In reply to] Can't Post

$. does not work on arrays
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives