in reply to XML Simple

The module xml::simple is not load
use XML::Simple;

You might need to install XML::Simple. Since you are new to Perl, the recommendation is to use another XML parser.

How format numbers (1246633 => 1 246 633)
From http://perldoc.perl.org/perlfaq5.html#How-can-I-output-my-numbers-with-commas-added%3f: Number::Format

Replies are listed 'Best First'.
Re^2: XML Simple
by Arenas (Novice) on May 31, 2015 at 14:28 UTC
    Thanks for your reply!

    I have see the chapter for 'how format numbers is this the only way to format numbers with regex?

    Do you have links to get dif. xml modules?

    Best regards

    @r

      use Number::Format; my $x = new Number::Format(-thousands_sep => ' '); my $number = 1234567890; print $x->format_number($number);
      $ perl example.pl 1 234 567 890

      You will need to install Number::Format from CPAN (see other answer)

      You can also try this, but it does not take into account numbers with comma's:

      my $number = 1234567890; print format_number($number); sub format_number{ my($x) = @_; $x = reverse $x; $x =~ s/(\d{3})/$1 /g; $x = reverse $x; return $x; }

      This prints:

      1 234 567 890
        hello @FBRM Many Thanks for your reply! The better expression is "Mask" I have find also this: http://bip.weizmann.ac.il/course/prog2/pm/Number_Format.html "From germany"
        #!/usr/bin/perl $number = '12586' use Number::Format qw(:subs :vars); $THOUSANDS_SEP = '.'; $DECIMAL_POINT = ','; $INT_CURR_SYMBOL = 'DEM'; my $formatted = format_number($number); format_picture($number, '## ### ### ###')
        Gestion: How can i run this little stuff?

        Greats,

        @r

      You can search for modules at .