Perl Best Practices [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Best Practices [Electronic resources] - نسخه متنی

Damian Conway

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







2.3. Subroutines and Variables


Don't separate subroutine or variable names from the following opening bracket .


In order for the previous rule to work properly, it's important that subroutines and variables

not have a space between their names and any following brackets. Otherwise, it's too easy to mistake a subroutine call for a control structure, or misread the initial part of an array element as an independent scalar variable.

So cuddle subroutine calls and variable names against their trailing parentheses or braces:


my @candidates = get_candidates($marker);
CANDIDATE:
for my $i (0..$#candidates) {
next CANDIDATE if open_region($i);
$candidates[$i]
= $incumbent{ $candidates[$i]{region} };
}

Spacing them out only makes them harder to recognize:


my @candidates = get_candidates ($marker);
CANDIDATE:
for my $i (0..$#candidates) {
next CANDIDATE if open_region ($i);
$candidates [$i]
= $incumbent {$candidates [$i] {region}};
}


/ 317