Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: De referencing

by sundialsvc4 (Abbot)
on Jun 22, 2013 at 22:25 UTC ( #1040297=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: De referencing
Re^2: De referencing
by Anonymous Monk on Jan 19, 2014 at 16:20 UTC
    How do you complete align record. For instance I would like to print all the align record as it is in sam file if it satisfies a particular condition.
      YEs I kind of have same qn....how to print complete record

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040297]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2015-07-04 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls