If you want to loop through the whole array with the for loop, wouldn't you want to have $#filenames+1 instead? Usually it would be much easier just to use @filenames in scalar context like so: for(my $i=0;$i<@filenames;$i++){stuff...}Also, you don't need to have a semi-colon to finish a statement if a brace immediately follows which means I can do stuff like: sub foo{return reverse split//,shift} #no semi-colon :)
my $i = foo("oof rab");
print $i;
(to the root node)Just so I don't have to create another post, I noticed that some of your calls use arrays slices when what you want is array indexes. This means taht @array[-1] is different than $array[-1] and could possibly lead to problems.
Hope I helped :)
$_.=($=+(6<<1));print(chr(my$a=$_));$^H=$_+$_;$_=$^H;
print chr($_-39); # Easy but its ok.
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, 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, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|