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 3974134
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:31:57+00:00 2026-05-20T04:31:57+00:00

This snippet basically reads a file line by line, which looks something like: Album=In

  • 0

This snippet basically reads a file line by line, which looks something like:

Album=In Between Dreams
Interpret=Jack Johnson
Titel=Better Together
Titel=Never Know
Titel=Banana Pancakes
Album=Pictures
Interpret=Katie Melua
Titel=Mary Pickford
Titel=It's All in My Head
Titel=If the Lights Go Out
Album=All the Lost Souls
Interpret=James Blunt
Titel=1973
Titel=One of the Brightest Stars

So it somehow connects the “Interpreter” with an album and this album with a list of titles. But what I don’t quite get is how:

while ($line = <IN>) {
    chomp $line;
    if ($line =~ /=/) {
        ($name, $wert) = split(/=/, $line);
    }
    else {
        next;
    }
    if ($name eq "Album") {
        $album = $wert;
    }
    if ($name eq "Interpret") {
        $interpret = $wert;
        $cd{$interpret}{album} = $album; // assigns an album to an interpreter?
        $titelnummer = 0;
    }
    if ($name eq "Titel") {
        $cd{$interpret}{titel}[$titelnummer++] = $wert; // assigns titles to an interpreter - WTF? how can this work?
    }
}
  • 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-05-20T04:31:58+00:00Added an answer on May 20, 2026 at 4:31 am

    The while loop keeps running and putting the current line into $line as long as there are new lines in the file handle <IN>. chomp removes the newline at the end of every row.

    split splits the line into two parts on the equal sign (/=/ is a regular expression) and puts the first part in $name and the second part in $wert.

    %cd is a hash that contains references to other hashes. The first “level” is the name of interpreter.

    (Please ask more specific questions if you still do not understand.)

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

Sidebar

Related Questions

Have a vector of vectors that looks something like this 3 1 2 0
Basically, for this snippet of code, I would like to get the picture to
Maybe this isn't really feasible. But basically, I've been developing a snippet-sharing website and
In this snippet: find( sub { print found . $File::Find::name . \n; }, (.));
This is a code snippet but basically what I want to do is read
Was wondering where I am going wrong with this snippet of code, basically the
Basically my problem is a that I need to copy an uploaded file (which
basically i have a service which looks at two tables - one resides on
This snippet of code always parses the date into the current timezone, and not
This snippet throws an NullPointerException due to the fact that its unboxed to a

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.