Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8065175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:35:05+00:00 2026-06-05T11:35:05+00:00

I am working a trying to understand how this one perl module works, it

  • 0

I am working a trying to understand how this one perl module works, it is called XML::Smart. Most of it was easy to figure out except for one thing that is not so much related to the module.

What I want to do is copy a hash from my script into the XML::Smart module for proccessing. After a little bit of “banning” on it I managed to make it do what I wanted. The problem is I don’t what exactly I did. If someone could give a clue of why this works what it means in english that would be great.

I saw something like this when I was messing around with rolling my own modules in that meaning it had something to do with making a class, not sure if that is what it was called or it has anything similar.

Here is my code;

#!/usr/bin/perl
use strict;
use warnings;
use XML::Smart;

my $xml_obj = XML::Smart->new();

my %config_file = (
    "server01" => {
        "connection" => {
            "address" => "10.0.0.4",
            "port" => "22",
        }, "authentication" => {
            "username" => "admin",
            "password" => "password",
        },
    },
);

$xml_obj->{config} = {%config_file};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:35:07+00:00Added an answer on June 5, 2026 at 11:35 am

    It creates a reference to a new hash with a (shallow) copy of the old hash.

    {} is a hashref.

    { "foo", "bar", "x", "y" } defines a hashref with a list of keys and values.

    If you put a hash inside {} it is in list context, so is turned into a list of keys and values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to figure this one out for about 2 days and cant
I've spent a while trying to figure this one out. I'm sure someone with
I'm trying to understand how Eval() works for a specific purpose. I'm working on
I'm trying to get a one-to-many relationship working with grails/gorm. I don't understand how
I have spent the day trying to fathom this one out (needless to say
I am trying to understand how the linux syscall sched_setaffinity() works. This is a
I been having trouble trying to figure this out. When I think I have
I am trying to understand how Wicket LoadableDetachable model is working. What i understand
I have been working on a project and trying to understand how these components
I'm trying to better understand the concept of 'autocommit' when working with a Postgres

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.