From: Rob H. <for...@us...> - 2001-12-20 02:34:48
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv9176 Modified Files: Browse.pm File.pm Log Message: browse doesn't use UI, so it shouldn't have "use SandWeb::UI" at the top ;) Browse just uses HTML::Template to return content to the main CGI, which puts it all together using UI. Also, File now uses itself ( which is, admittedly, weird ). What I probably need to be doing is adding a public method for file_read and file_write, which just call the private methods doing the actual work. hmm.. yeah, that'll be better. I'll do it now. Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -U2 -r1.22 -r1.23 --- Browse.pm 2001/12/18 02:12:06 1.22 +++ Browse.pm 2001/12/20 02:34:46 1.23 @@ -7,5 +7,4 @@ use strict; use lib '../lib'; -use SandWeb::UI; use SandWeb::File; use HTML::Template; Index: File.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -U2 -r1.18 -r1.19 --- File.pm 2001/12/20 02:26:24 1.18 +++ File.pm 2001/12/20 02:34:46 1.19 @@ -152,13 +152,11 @@ my $tofile = $args{'tofile'}; - open ( FROM_FILE, "< $location/$filename" ); - my @fromfile = (<FROM_FILE>); - close FROM_FILE; - - open ( TO_FILE, "> $tofile" ); - foreach my $line (@fromfile) { - print TO_FILE "$line"; - } - close TO_FILE; + my $file = SandWeb::File->new( + 'location' => "$location", + 'filename' => "$filename", + ); + + my @fromfile = $file->file_read(); + $file->file_write( 'contents' => "@fromfile" ); return $return; |