Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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.

Replies are listed 'Best First'.
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 to print complete record

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040297]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-11-20 01:11 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (282 votes). Check out past polls.