Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi everybody,

I can't make sense of my little perl script ; I've no idea where the
probleme is... could you give me a way to understand...

I've this short code :
use strict;
use Data::Dumper;
use Lingua::Identify qw/:language_identification/;

my %probabilities;
my %languages = langof_file("test.txt");

print Dumper(%languages);

it print the text in the console :
$VAR1 = 'pt';
$VAR2 = '0.0299573389196567';
$VAR3 = 'tr';
$VAR4 = '0.0152319153730931';
$VAR5 = 'da';
$VAR6 = '0.0359140188331814';

But, I want an output like this one :

$VAR1 = {
          'pt' => '0.0299573389196567',
          'tr' => '0.0152319153730931',
          'es' => '0.0403864688211945',
          'da' => '0.0359140188331814',

What's wrong ?

Re: hash

Quoted text here. Click to load it

Pass Dumper() a reference rather than a list of keys and values:

   print Dumper \%languages;

Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"

Re: hash

Quoted text here. Click to load it

Yes, it's works in my example, then it doesn't works when I try to send
the datas to a distant server using soap::lite

Re: hash

Newsgroups wrote:
Quoted text here. Click to load it

SOAP::Lite has a debug option which I have found to be useful.

You can also output the received XML using "->outputxml(1)";

By using Data::Dumper at both ends you should be able to work out how to
handle the data consistently.

I found that experimenting with SOAP::Data was useful in understanding
SOAP::Lite a little better.

Site Timeline