B
Billy
All,
I have a html file that contains a simple comma delimitated list of items:
~1 Red Apple, 1 Green Apple, 1 Orange,
%item:4%,%item:5%,%item:6%,%item:7%,%item:8%,%item:9%,%item:10^
This list begins with ~ and ends with ^.
I can open the file but never using perl before I am looking for a bit of
help.
Below is what I use to make sure I can even access the file... this part
doesn't give any error but doesn't print anything either..
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
open (test, "trialfile.html") || die ("Could not open file. <br> $!");
while (<>) {
if (/~/) {
print;
}
}
close (test);
It opens the file and doesn't print anything except a blank page. What I am
looking for is to have it print everything after ~ but before any % or ^.
I thought it would at least print the ~ but it doesn't....
I know some people who have been programming a while might think this is
easy but for me it is not so any help would be appreciated.
Thank you,
Billy McCain
I have a html file that contains a simple comma delimitated list of items:
~1 Red Apple, 1 Green Apple, 1 Orange,
%item:4%,%item:5%,%item:6%,%item:7%,%item:8%,%item:9%,%item:10^
This list begins with ~ and ends with ^.
I can open the file but never using perl before I am looking for a bit of
help.
Below is what I use to make sure I can even access the file... this part
doesn't give any error but doesn't print anything either..
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
open (test, "trialfile.html") || die ("Could not open file. <br> $!");
while (<>) {
if (/~/) {
print;
}
}
close (test);
It opens the file and doesn't print anything except a blank page. What I am
looking for is to have it print everything after ~ but before any % or ^.
I thought it would at least print the ~ but it doesn't....
I know some people who have been programming a while might think this is
easy but for me it is not so any help would be appreciated.
Thank you,
Billy McCain