#!/usr/bin/env perl 

use 5.10.0;     
use strict;     
use warnings; 

# DO CHANGE 

# Linux: Path to libraries (local) 
use lib qw(/home/bislinks/perl5/lib/perl5);

# Linux: Path to folder containing Template.pm
use lib qw(/home/bislinks/cgi-bin/A1z/Html5); 

# Windows: Path to folder containing Template.pm
use lib qw(C:/Users/hp/up/A1z/Html5); 

# Paths based on Operating System this app is running on
my %os;
%os = 
(
	win => 
	{
		base => "C:/Users/hp/up/A1z/Html5",
		cgibase => "C:/Users/hp/up/A1z/Examples/Ex_Html5",
		cgiurl => "https://192.168.1.103:6684/A1z/Examples/Ex_Html5",
	},
		
	linux =>
	{
		base => "/home/bislinks/cgi-bin/A1z/Html5",
		cgibase => "/home/bislinks/cgi-bin/A1z/Examples/Ex_Html5",
		cgiurl => "",
	},		
);

# END USER CONFIG




# DO NOT CHANGE 

my %sys;
if ($ENV{OS} and $ENV{OS} =~ /^Win/i )
{
	$sys{base} = "$os{win}->{base}" || '.';
	$sys{cgibase} = "$os{win}->{cgibase}" || ".";
	$sys{cgiurl} = "$os{win}->{cgiurl}" || "/";
}
elsif (!defined $ENV{OS} or $ENV{OS} eq '' )
{
	$sys{base} = "$os{linux}->{base}";
	$sys{cgibase} = "$os{linux}->{cgibase}";
	$sys{cgiurl} = "$os{linux}->{cgiurl}" || "/";
}
else
{
	$sys{base} = "$os{linux}->{base}";
	$sys{cgibase} = "$os{linux}->{cgibase}";
	$sys{cgiurl} = "$os{linux}->{cgiurl}" || "/";

}


use Template;	 

my $package_name = 'HTML5::Template'; 

# HTML stuff 

my $h = Template->new(); 

say $h->header('utf8'); 	# 
say $h->start_html(); 
say $h->head_title("$package_name"); 
say $h->head_meta(); 
say $h->head_meta("description---How to use $package_name ", 
"keywords---Package, perl module, html5, cgi compatible", 
"author---webmaster at bislinks.com",
); 
say $h->head_js_css(); 
say $h->head_js_css('Template.css'); 
say $h->end_head(); 
say $h->begin_body();
say $h->body_topnavbar();


say qq~<h1>$package_name</h1>
<div id="main-content" class="container"> 
~; 

# write 
say $h->body_article( 
	header => "<a href='$sys{cgiurl}/TemplateAdmin.cgi' title='Refresh to get the latest/saved content'>Refresh</a> ", 
	content => $h->write_file( file => "$sys{cgibase}/open_file_example.txt"),
	 
);


# edit file
 say $h->body_article( 
	header => "Edit page items", 
	action => "TemplateAdmin",
	content => $h->edit_file( file => "$sys{cgibase}/open_file_example.txt") 
 );


say qq~</div>
<!--end main-->
~;  


say $h->body_js_css(); 
say $h->end_body();
say $h->end_html(); 

__DATA__ 
Where am I				in DATA section of .pl 
Why is this showing up?		This shows up when the given file path is wrong or for some reason unable to open it!