in reply to De referencing
One good tool for sorting this sort of thing out, in a general sense, is Data::Dumper, which is good at printing-out any ol’ thing so that you can see what it is. Once you can see it, you can probably see your way clear (along with taking a good re-look at the documentation) as to how to properly de-reference it and use it.
use Data::Dumper;
print STDERR Data::Dumper->Dump([ $align ], [ 'align' ]);
The STDERR (“standard error-output”) stream is a traditional place to send error-messages and “chatty” in-progress status messages. It normally maps to the terminal, or, in the case of Apache, to the error-log.
In this case, though, the documentation example for Bio::DB::Sam ought to be sufficient. In their example, read1 clearly returns an object ... and the documentation obliquely says (without actually saying), that this object is a Bio::DB::Bam::Alignment object, which is separately documented in CPAN. When the documentation does not go that far, Data::Dumper will usually give you the important-clue by having identified the object class-name that a particular variable has been bless()ed into. A search for that class-name on CPAN, more often than not, will be fruitful.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: De referencing
by Anonymous Monk on Jan 19, 2014 at 16:20 UTC | |
by Anonymous Monk on Jan 19, 2014 at 16:34 UTC |