Hi MynameisAchint,
To really get the help you want it will be wonderful if you follow the advice giving in How do I post a question effectively?.

...I wish to run a for loop for that array...
Instead of using a for loop as used in C, why not use for/foreach as Perl like thus:

my @array_data = qw( 21 45 perl 28 monks); foreach my $data (@array_data){ print $data,"\n"; }
Update:
However, if you want to iterate over the array, using the index of the array, Perl also does that for you very cleanly.
my @array_data = (21,45,'perl',28,'monks',' ','togo'); for my $num (0..$#array_data){ print $num,': ',$array_data[$num],"\n"; }
0: 21 1: 45 2: perl 3: 28 4: monks 5: 6: togo
Please, note that I used foreach and for inter-changeably.
And please don't forget that array index start from 0 and not 1, as used in your OP for loop.
Hope this helps

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

In reply to Re: number array with space by 2teez
in thread number array with space by MynameisAchint

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.