> I think I am picking up some bad habits so maybe you guys can help. > > I currently use this notation @{$hash{key}} to access an array stored in > a hash. > I keep seeing posts that it is better to use an object like notation. > Can I see some examples on how you would access the array or an element > of an array. > > Also is there a way to access slices in a foreach something like > > Foreach ((@arrar)[1,3..6]){ > code > } >
I wouldn't necessarily call it a bad habit as it does execute properly, it just doesn't produce as readable of code... Rob already covered -> well so I will just point you to some "light" reading if you thirst for more... perldoc perlreftut perldoc perlref perldoc perldsc perldoc perllol Your foreach slice should work. foreach really just takes a 'list' as opposed to an array, so if your slice will produce a list it should work... http://danconia.org -- Boycott the Sugar Bowl! You couldn't pay me to watch that game. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>