From: "Jay Savage" <[EMAIL PROTECTED]> > On Mon, Apr 7, 2008 at 12:20 AM, Richard Lee <[EMAIL PROTECTED]> wrote: > > my @cal_r = [ @Jan,@Feb,@Mar,@Apr,@May,@Jun,@Jul,@Aug,@Sep,@Oct,@Nov,@Dec > > ]; > > > > take another look at perldoc perlref. what you've created, here, is a > an array (@cal_r) whose single element is an anonymous array with 365 > elements. Since Perl arrays are zero-indexed, if you examine $#cal_r, > you'll see that it is '0' > > You probably meant something more like > > my $cal_r = [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]; #etc. > > But see the perlref and perlreftut for more info.
It's possible to write that as my @cal_r = \(@Jan,@Feb,@Mar,@Apr,@May,@Jun,@Jul,@Aug,@Sep,@Oct,@Nov,@Dec); I find this syntax a bit confusing, but it will prevent you from having to put a backslash before each month's array. Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/