Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

stu42j (6348)

  (email not shown publicly)

Journal of stu42j (6348)

Monday August 27, 2007
01:49 PM


[ #34236 ]

There Is More Than One Way To Do It - Not All Of Them Are Good.

Some legacy code that I am working on, frequently uses this "interesting" idiom for getting the first element of an array.

my @array = some_function();
my $i = 0;
foreach my $hash (@array) {
  $var = $hash->{somekey};

I am particularly puzzled by the unused $i.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.