473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to retrieve array data using for loop in perl?

7
hi i have an array,i want read data using for loop,i tried below manner ,but i am getting first value all times.can any one suggest is there anything wrong in my syntax.
Please don't use foreach loop if u want to use foreach just provide how to read each value based on loop iteration count.
Expand|Select|Wrap|Line Numbers
  1. @a = qw(ashd asda asdhas ahsdhasd ahsdhasd hdj dssd sdd sdjdh);
  2.  
  3. for($i=0;$i< $#a;$i++) {
  4. print " $a[i] \n";
  5.  
  6. }
i am getting output below manner
ashd
ashd
ashd
ashd
ashd
ashd
ashd
ashd
Feb 26 '13 #1
1 1591
Please check your print statement.
Expand|Select|Wrap|Line Numbers
  1. @a = qw(ashd asda asdhas ahsdhasd ahsdhasd hdj dssd sdd sdjdh);
  2.  
  3. for($i=0;$i< $#a;$i++) {
  4. print " $a[$i] \n";
  5.  
  6. }
Feb 26 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Pete Davis | last post by:
I've never done this in C# so I don't know what the appropriate way of doing it is. I've got an array of bytes and I need to convert the array into "usable" data. For example, the first 4 bytes...
2
seshu
by: seshu | last post by:
Hi everybody this is seshu i have a small doubt while designing an application in my application i am supposed to use a query to retrive the data asume names and purchase...
1
by: sonasiva | last post by:
Dear all iam new for ASP I have data in database as like as follows Name company shares date A x ...
2
by: Divas | last post by:
Dear Sir Please help me for below question. How check the System.DbNull values from database when we retrive the data from databa Thanx
2
by: job alerts | last post by:
Hi Im using SMTP for sending the mail.But i dont know how to receive the mail.Im sending the mail using ASP.Net C#.If some one having the codings for retrive the Email using POP3 means please send...
3
by: nico3334 | last post by:
I'm filling in a Report with SQL data using VB code. I'm using LOOP and MoveNext. Before using MoveNext, I would like to be able to check whether the new data is equal to the previous data that was...
5
Inbaraj
by: Inbaraj | last post by:
Hi.. In oracle i am having 100 tables each contains more then 500 records... Due to virus attack i lost the C drive (OS) in my PC but i installed oracle in D: drive. No i want to retrive the...
1
by: kalpu123 | last post by:
how to create retrive the data from database for every 2 minutes
4
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be...
3
by: amollokhande1 | last post by:
Hi All, I am using Sql server 2005 as a backend for my application. I want to read/write the unicode data using sql query. When I am using insert into UnicodeData values('سي') command and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.