Help with Perl programming. Writing to files, writing in subroutines, etc

CSci 260 PerlProgram 3 – Fall 2019
Objective
Work with modules
Work with files
Work with data structures
Assignment
This program will create a package to store a list of music files. The package will
have to store the name of each song and its time. I’ll leave the exact
implementation of the data structure up to you. To manipulate the list of songs
we need a set of subroutines. These MUST be implemented exactly as
specified.
Specifics
Each of the following functions must be implemented exactly as specified. The
functions should be exported. The data structure should not be exported, it must
be private to the module.
addSong (name of song, time of song) – Adds a song to the list and its time (a
string in “XX:XX” format) to the list. If the song already exists update the
information.
removeSong (name of song) – Removes the song from the list, if it exists in the
list. Return a true or false value indicating whether or not the song was actually
removed. Either way, the song will not exist in the list after this function.
isSongInList (name of song) – Returns a true or false value (not a string
containing ‘true’ or ‘false’) indicating if the song is currently in the list (return true)
or not (return false). This search is not case specific but other than that must be
an exact match to return true.
numberOfSongs ( ) – returns the number of songs in the list
clear ( ) – empties the list of songs
printSongs ( ) – Returns a single scalar containing a neatly formatted list of
songs and each songs time – one song per line. The songs should appear in the
list in alphabetical order, with the times right justified.
saveList (datafile) – Saves the list of songs to a data file, one song per line. Use
a comma to separate the song and time – so don’t use a comma in the song title
of your test data). datafile refers to the name of a data file, it may or may not
contain a path (but it won’t when we test it). This function returns a true value if
the data file is saved, otherwise it returns a false value.
loadList (datafile) – Fills internal data structure with songs from data file. The
data file will have one song per line, with a comma separating the song title and
the time. If the internal data structure currently contains songs it is emptied
before being filled with the information from the file. This function returns a true
value if data file exists and is loaded into the data structure, otherwise does
nothing (including NOT removing current list and not crashing) other than
returning false. datafile refers to a string value containing the name of a data
file.
setTitle (title of list) – Sets the title of the list of songs – think a CD title or a
playlist title (“Running” or “DanceMix1”).
getTitle() – Returns the “title” of the list of songs
matchingSongs (text to find) – returns an array of song titles (just the title) of
songs that contain the provided text. For a couple of bonus points, return either
an array or a scalar to an array, depending upon the specific context.
Requirements
use strict
Make sure this package meets the requirements of a module. Among the other
requirements export only the subroutines listed above.
Complete comment section that includes your name, id number, email address,
program number and a brief description of the program.
The code for the package must be in a module called SongList. Write your own
test program. You will be graded mostly on the SongList module but a through
main program will be necessary. The test program has no specific requirements
other than it must test the module.
Questions?
Ask, sooner rather than later. Or both.
You can bring them to class or email me.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER