<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial"> </DIV>
<DIV dir=ltr>I'd suggest these files are the Model part of MVC and you should
have a Class that you use to interact with files. This Class is independent of
you Catalyst App and should be able to run in it's own right. Page 135 of the
book discussing Database model because that's the common model but there are
model class for working with files[1]. There are several references in the
book to testing. Testing, along with software versioning are part of the
tool-set you'll want to become familiar with if your going to be writing
software. You could take a look at the advent calendar articles [2], they are
not that up-to-date but useful none the less I'd say.</DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>---> I have actually found a lot of the advent
calendar articles really useful. I was shocked there weren't any for 2015
though, =P. Did we forget to do it last year / weren't there any volunteers?
</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV dir=ltr>Using a database would adios your permissions problems too. If
you just want to sort out permissions problems, you could have the
files/directories owned by the same user that runs you web server or do
something fancy with suexec. </DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>---> UPDATE: Oh...do you mean the root
user?</FONT></DIV>
<DIV dir=ltr><FONT size=2>---> BEFORE-UPDATE: The trouble I
experienced with having it owned by the user associated with the web
domain was that there were two users needing to access
it.</FONT></DIV>
<DIV dir=ltr><FONT size=2>However, what I've done for a quick fix until I can
figure out a better solution, is thrown...</FONT></DIV>
<DIV dir=ltr><FONT size=2>umask 0000;</FONT></DIV>
<DIV dir=ltr><FONT size=2>...into the appname.pm file, and now when I create
directories with 0777 permissions, as in a line like: </FONT></DIV>
<DIV dir=ltr><FONT size=2>mkdir
$my_data_folder_path."new_directory_we_are_making/", 0777;</FONT></DIV>
<DIV dir=ltr><FONT size=2>...they're accessible to both users,</FONT></DIV>
<DIV dir=ltr><FONT size=2>and to enable file reading and writing, I'm just
using Path::Tiny's slurp and spew - spew solving the access/permission
problem, where append would not.</FONT></DIV>
<DIV dir=ltr><FONT size=2>So now I've got a quick fix allowing me to get
cracking with my work,</FONT></DIV>
<DIV dir=ltr><FONT size=2>and then I'll read and research on the side how to
improve it / what the better ways of doing it are.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr>I want to caution you, in the nicest possible way. Writing
software requires a number of skills and a lot of research and learning. You
can't avoid the latter. What may seem like a lot of unnecessary aggravation
(testing and version control) have come about because it's no fun fixing
problems after the event.</DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>---> Yes, I apologise some of the way I wrote
came across as impatient, =). I'm excited to learn, and to reap the long term
benefits, =). </FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV dir=ltr>You could also look at Dancer2 [3] as that be good fit too.</DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>---> Thanks for the tip!</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr>Good luck,</DIV>
<DIV dir=ltr>Dermot.</DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>---> Many thanks for the page numbers I can flick
to, and the links I can visit, =). Grateful!</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV dir=ltr><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR>1) <A
href="https://metacpan.org/pod/Catalyst::Model::File">https://metacpan.org/pod/Catalyst::Model::File</A></DIV>
<DIV dir=ltr>2) <A
href="http://www.catalystframework.org/calendar/">http://www.catalystframework.org/calendar/</A></DIV>
<DIV dir=ltr>3) <A
href="https://metacpan.org/pod/distribution/Dancer2/script/dancer2">https://metacpan.org/pod/distribution/Dancer2/script/dancer2</A></DIV>
<DIV dir=ltr><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV class=gmail_extra><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR>
<DIV class=gmail_quote>On 9 March 2016 at 13:26, Andrew <SPAN dir=ltr><<A
target=_blank
href="mailto:catalystgroup@unitedgames.co.uk">catalystgroup@unitedgames.co.uk</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><U></U>
<DIV bgcolor="#ffffff">
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial"> </DIV>
<DIV dir=ltr>
<DIV class=gmail_extra>
<DIV class=gmail_quote><SPAN class="">
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV>It sounds to me like you should treat these text files as the data
model </DIV>
<DIV><FONT size=2></FONT> </DIV></SPAN>
<DIV><FONT size=2>---> Are you suggesting I do something to them,
or is this just a linguistic point about what to call or refer to the data
as?</FONT></DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>I'm new to Catalyst and </FONT><FONT
size=2>previously coded in procedural perl, where I </FONT><FONT
size=2>always used a policy of: data - processing - layout.</FONT></DIV>
<DIV><FONT size=2>I equate that to Catalyst's Model - Controller - View.
</FONT><FONT size=2>However, my data was always text files, my processing
was cgi scripts, and my layout was always html
templates.</FONT></DIV>
<DIV><FONT size=2>I now code with my processing as subroutines within *.pm
files within Catalyst's Controller folder,</FONT></DIV>
<DIV><FONT size=2>however I haven't touched the View or Model folders - am
still reading in html templates, substituting values, and spitting them
out as the response to the browser - all within my controllers - it's
processing after all.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>In short, I'm happy to call my text files the data
model, where before I would have called them the data.</FONT></DIV>
<DIV><FONT size=2>However - are you suggesting I do
anything?</FONT></DIV></FONT></DIV><SPAN class="">
<DIV><FONT size=2></FONT> </DIV>
<DIV>and yes, do not check it in to your repo.</DIV>
<DIV><FONT size=2></FONT> </DIV></SPAN>
<DIV><FONT size=2>---> I have no idea what repo is. Do you mean
repository, for a versioning system? Atm, my versioning system is to
download the lib folder from the dev server using Cyberduck, and put it in
a folder on my computer hard drive - the folder having a version
number. Then I can upload whatever version I want to the production
server - normally the lib from the latest version folder created.
</FONT></DIV><SPAN class="">
<DIV><FONT size=2></FONT> </DIV>
<DIV> Rather create a model class to access it</DIV></SPAN>
<DIV><FONT size=2>---> I will have to research how to do this. My
resources include google search, and the Definitive Guide to Catalyst
book.</FONT></DIV><SPAN class="">
<DIV><FONT size=2></FONT> </DIV>
<DIV> and configure the path in you config file.</DIV></SPAN>
<DIV><FONT size=2>---> At present, I am reading the path in from a
separate text file.</FONT></DIV><SPAN class="">
<DIV><FONT size=2></FONT> </DIV>
<DIV> When it comes to testing you are going to have to create a
sample of those text files under the t/ directory.</DIV>
<DIV><FONT size=2></FONT> </DIV></SPAN>
<DIV><FONT size=2>---> Still learning Catalyst and haven't touched
testing. I generally don't get it. Either a web app works, or is broken. I
don't get writing code to test if code works. Comes across as some
sort of coding narcissism.</FONT></DIV><SPAN class="">
<DIV><FONT size=2></FONT><FONT size=2></FONT> </DIV>
<DIV>Having said that, you should probably find a way to use a database.
It sounds to me like your data would fit nicely into a database and your
permissions problems to be less significant.</DIV>
<DIV><FONT size=2></FONT> </DIV></SPAN>
<DIV><FONT size=2>---> Yes, I've painless experience of connecting to a
MySQL database. I just hoped I could use Catalyst whilst working in the
same simple way I worked before, where turn around was very fast. I just
have one small task to accomplish, and some files seemed the easiest
quickest way to do it, and I've hit all these permission problems, and I
just thought it must be such a common problem, someone is bound to have
solved it - so I thought to ask the group.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>---> Right now my solution is super simple - just use
spew, and avoid using append.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>---> If there's any advice or tutorials on how to
sort out permissions, or how to use text files as your model in Catalyst,
I'd appreciate it. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Hope that helps,</DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>---> It was insightful, and has given me something to
research. Right now I don't understand enough about how Catalyst works to
know what creating a model class involves, and if it will solve the
permissions problem, or if it was just mentioned as a way of putting the
data folder's path into the config file. I shall look into it, and
hopefully won't be ignorant for too much longer.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>---> And thanks for getting back to me!
=D</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>---> Yours,</FONT></DIV>
<DIV><FONT size=2>---> Andrew.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Dermot.</DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV><FONT
size=2></FONT> </DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>