Re: changing backgorund color error
On Sat, 2003-01-25 at 00:25, MJ wrote: > The below given part of code from a cgi script is > working fine but when I try to change the back ground > color to > print "\n"; print "\n"; looks like you need to maybe this will help..you have that qoute at the end..by the 2 print "\n"; -- jd [EMAIL PROTECTED] Bad spellers of the world untie! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: changing backgorund color error
Mj wrote: > The below given part of code from a cgi script is > working fine but when I try to change the back ground > color to > print "\n"; Something is wrong here. Check your closing quotes - the line as it is above won't compile. You should have: print "\n"; This may or may not be your problem. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modules
Ismar Dupanovic wrote: > Got 2 modules and a driver script that uses both. Both modules > require Exporter and export their functions. However in my driver > script I have to fully qualify the function names of the SECOND > module(module->function), while the functions of the first module > become > part of my main:: package namespace and are called without any > mention of > the module name. > > I know the modules are good since I have no problems calling their > methods > if I use them individually. But whenever I use both in my driver > script one of them has to have its functions proceeded > by the module name. > > There is no name clashing in variables or function names. > May we see your initialisation code please? Just that up to the run-time stuff. Otherwise I can't guess why it's behaving this way. Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
write a parser using perl
Hi everyone, I'm new to Perl. Does anyone have experence with writting parser by perl? Any places i can find some examples? thanks a lot. - tao __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: write a parser using perl
tao wang wrote: Hi everyone, I'm new to Perl. Does anyone have experence with writting parser by perl? Any places i can find some examples? thanks a lot. Parser of what? XML, HTML, ID3 tags, Mail messages, etc.? Check CPAN (http://search.cpan.org) first because if more than two people could use the functionality it is probably there ;-) http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: write a parser using perl
thanks. I need parse a text file, which is like a text database file, but not very structured. many thanks. --- Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > tao wang wrote: > > Hi everyone, > > > > I'm new to Perl. Does anyone have experence > with > > writting parser by perl? Any places i can find > some > > examples? thanks a lot. > > > > Parser of what? XML, HTML, ID3 tags, Mail messages, > etc.? Check CPAN > (http://search.cpan.org) first because if more than > two people could use > the functionality it is probably there ;-) > > http://danconia.org > __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: write a parser using perl
tao wang wrote: thanks. I need parse a text file, which is like a text database file, but not very structured. many thanks. In that case you will need to decide what the "structure" is, and what you can guarantee. A normal text database is going to be parsed in the following general manner: open the file, step through the delimited portions of the file, in many cases line by line with a while loop, until some condition is met, in many cases EOF, possibly split on some character(s) within each delimited portion, and store those to some data structure that can then be manipulated or fire off events that handle things such as a start of a new element, the body of an element, the end of an element, etc. perldoc -f open perldoc perlopentut perldoc -f split perldoc -f close For instance a comma delimited file could be handled like so (though some would prefer DBD::CSV)... my $file = '/path/to/file.csv'; my $INPUTFILE; open($INPUTFILE,"$file") or die "Can't open input file for reading: $!"; while (my $line = <$INPUTFILE>) { my @values = split(/,/,$line); my $count = 0; foreach my $val (@values) { print "Element $count: $val\n"; $count++; } } close($INPUTFILE); --untested-- http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: write a parser using perl
You'll want to look at: perldoc -f pack perldoc -f unpack if you're working with fields of pre-determined lengths and the database files aren't delimited. Perhaps if you could post an example we could give you better advice. - Johnathan Wiggins d'Anconia wrote: tao wang wrote: thanks. I need parse a text file, which is like a text database file, but not very structured. many thanks. In that case you will need to decide what the "structure" is, and what you can guarantee. A normal text database is going to be parsed in the following general manner: open the file, step through the delimited portions of the file, in many cases line by line with a while loop, until some condition is met, in many cases EOF, possibly split on some character(s) within each delimited portion, and store those to some data structure that can then be manipulated or fire off events that handle things such as a start of a new element, the body of an element, the end of an element, etc. perldoc -f open perldoc perlopentut perldoc -f split perldoc -f close For instance a comma delimited file could be handled like so (though some would prefer DBD::CSV)... my $file = '/path/to/file.csv'; my $INPUTFILE; open($INPUTFILE,"$file") or die "Can't open input file for reading: $!"; while (my $line = <$INPUTFILE>) { my @values = split(/,/,$line); my $count = 0; foreach my $val (@values) { print "Element $count: $val\n"; $count++; } } close($INPUTFILE); --untested-- http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: changing backgorund color error
Not to be too much of a pain but... You should reconsider using the bgcolor property at all since it has been depreciated. Consider using CSS like:
body {background-color: #004152; }
... Or at least: From the looks of your code, I'm wondering if you 'use strict'. If you aren't, start. Also consider how your variables are scoped. It looks like you're causing yourself all sorts of headaches by not limiting the visibility of your variables. You'd also avoid tons of quote errors and improve the readability of your code by using the << operator like so: print < Content-type: text/html Results of Search
body {
background-color: #004152;
}
Results of Search in $title Below are the results of your Search in no particular order: END_OF_HTML for my $key (keys %include) { next unless $include{$key} eq 'yes'; print qq($titles{$key}\n); } print < Search Information: Terms: END_OF_HTML print join(', ',@terms), "\n" print < Boolean Used: $FORM{'boolean'} Case $FORM{'case'}\n"; Back to Search Page $title; END_OF_HTML } The below given part of code from a cgi script is working fine but when I try to change the back ground color to print "\n"; print "\n"; looks like you need to maybe this will help..you have that qoute at the end..by the 2 print "\n"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: changing backgorund color error
Hi Jonathan, I'm going to take issue with you on a couple points. I think all the original poster needed was to take a second look at his quote escaping. Johnathan Kupferer wrote: > You should reconsider using the bgcolor property at all since it has > been depreciated. Depends on why it has been deprecated. It works. It's very backwards compatible. It is much more portable than style specifications. > From the looks of your code, I'm wondering if you 'use strict'. If you > aren't, start. Also consider how your variables are scoped. It looks > like you're causing yourself all sorts of headaches by not limiting the > visibility of your variables. Great advice. > You'd also avoid tons of quote errors and improve the readability of > your code by using the << operator like so: Depends on the visual effect you want. I have particular standards for readability in both HYML and structured programming, and they are not the same. Therefore I prefer to use: indent (int spacing, string test) {...} to set the specifications for how my output will appear, while maintaining the flow of indentaion within my program code. It is a matter of taste. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: changing backgorund color error
You should reconsider using the bgcolor property at all since it has been depreciated. Depends on why it has been deprecated. It works. It's very backwards compatible. It is much more portable than style specifications. Quite true. You have to even drag out the font tags for compatability reasons at times, but last I checked, the only place I needed to abandon XHTML and CSS was for the mac's default mail program... I forget its name but it has no CSS support at all. All the same, I was troubled by the missing and tags as indicative of a more general malaise in regards to the evolving standards... You'd also avoid tons of quote errors and improve the readability of your code by using the << operator like so: Depends on the visual effect you want. I have particular standards for readability in both HYML and structured programming, and they are not the same. Therefore I prefer to use: indent (int spacing, string test) {...} to set the specifications for how my output will appear, while maintaining the flow of indentaion within my program code. It is a matter of taste. Also true, it is a matter of taste. My main point in throwing it out was to make sure it was something people were aware of. In general, quoting HTML can be a pain without a few perlish tricks like << and qq(). These days I'm a fan of slurping an XHTML template up into a DOM with XML::DOM::Parser and working with it that way. Its all about taste and fads, that's why programming is an art form... at least with perl. - Johnathan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: write a parser using perl
Tao Wang wrote: > > Hi everyone, Hello, > I'm new to Perl. Does anyone have experence with > writting parser by perl? Any places i can find some > examples? thanks a lot. http://search.cpan.org/search?query=parse&mode=module John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]