Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dereferencing 1

Status
Not open for further replies.

Graziella

Programmer
Jul 8, 2004
38
AT
Hi,

I think this is an issue of dereferencing.
I am using a module with
use Lingua::EN::Sentence qw(get_sentences);
Then my code contains:

my ($sen) = &get_sentences($text);
print "HELLO $sen\n";
where get_sentences is a subroutine called from the module Sentence.pm in the package above.
However, when I print out the output of get_sentences,
I get "HELLO ARRAY(0x19b2c9b8)"
What might be wrong ?

Grazia
 

get_sentences seems to be spitting an array.
I'm really not familiar with this module.

Code:
use Lingua::EN::Sentence qw(get_sentences);

my $sen = &get_sentences($text);

    foreach my $sentence (@$sen) {
    print "HELLO $sentence \n";
    }
 
As the module documentation shows:

Code:
my $sentences=get_sentences($text);     ## Get the sentences.
foreach my $sentence ([b]@$sentences[/b]) {

get_sentences() is returning a reference and needs to be dereferenced as in the bold text above


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top