Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: compilation errors???

by damian1301 (Curate)
on Aug 22, 2001 at 09:19 UTC ( #106881=note: print w/ replies, xml ) Need Help??


in reply to Re: compilation errors???
in thread compilation errors???

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.


Comment on Re: Re: compilation errors???
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://106881]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2015-07-06 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (74 votes), past polls