[Bioperl-l] The usage of $field->$_
Peng Yu
pengyu.ut at gmail.com
Fri Jun 4 20:26:53 UTC 2010
I know this is not a hard question. But I'm still learning perl.
I don't see the usage "->$_" in man perlvar. Would you please show me
where is the documentation that has detailed discussion on this?
On Fri, Jun 4, 2010 at 3:06 PM, Mark A. Jensen <maj at fortinbras.us> wrote:
> This is a fairly basic perl idiom. $_ is changing with the outer loop
> containing the print statement, which is probably looping through the
> accessors for the object represented by $field.
> ----- Original Message ----- From: "Peng Yu" <pengyu.ut at gmail.com>
> To: <bioperl-l at lists.open-bio.org>
> Sent: Friday, June 04, 2010 12:15 PM
> Subject: [Bioperl-l] The usage of $field->$_
>
>
>> In the Eutilities cookbook,
>> http://www.bioperl.org/wiki/HOWTO:EUtilities_Cookbook
>>
>> I see the following code,
>>
>> print join(',', grep {$field->$_} qw(is_date
>> is_singletoken is_hierarchy is_hidden is_numerical)),"\n\n";
>>
>> I'm not quite familiar with the usage of $field->$_. I don't see where
>> it is covered in man perlvar (I don't the usage of $_ for pattern
>> matching, but not in $variable->$). Would you please let me know where
>> is the document that explain this usage?
>>
>> --
>> Regards,
>> Peng
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>>
>
>
--
Regards,
Peng
More information about the Bioperl-l
mailing list