You say you are new to programming. Perl is not an easy language for a
programming novice. Most tutorials will show you how to accomplish, in Perl,
something you already know in another language.

There are few tutorials on the use of modules because all well-written
modules have, as part of their documentation, examples of their use. Pick
any modules at random from the standard issue, or others from www.cpan.org,
and study their examples.

May I also recommend 'Perl Power!' by Michael Schilli
(http://www.perlmeister.com/index.html), and 'The Perl 5 Programmers
Reference' (http://ez2www.com/go.php3?site=book&go=1566047501 on Amazon) or
something similar, and annotate it.

PS: Looking for web references to the books, I came across the following
advice:-

>>... (and if you want to learn Perl as your first programming language you
should SERIOUSLY re-think that).

>>Not for a total novice programmer (who shouldn't learn Perl first anyway),
...

>> A person new to ALL programming should NOT buy this book ...

If you want to learn programming, I can only recommend 'Algorithms + Data
Structures = Programs' by Niclaus Wirth (out of print).

- Roger -


----- Original Message -----
From: "Sunthari" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 5:50 AM
Subject: Help on script


> Dear List,
>
> I am new to programming and currently looking into
> Perl. I am going thru the available Perl tutorial in
> the net but there are less examples especially on how
> to use modules.
>
> I have wrote this simple script of match word and
> count it for a text file (well, did some cut-n-paste
> here and there). I wanted to extend it by putting an
> interface- webpage with a searchbox to post the search
> word to this script.
>
> I have tried CGI.pm but I failed to read/pass the
> search word to script. Please take a look at this
> script and html file . Please mind me if there's
> really stupid mistakes since I desperately need some
> help.
>
> Really looking forward to hear from the list asap.Your
> help is very much appreciated.
>
> Rgds,
>
> P/S: I have attached the following:
>       match.txt - original sript without cgi
>       matchcgi.txt - using CGI.pm
>       match.htm
>
>


----------------------------------------------------------------------------
----


> #!usr/perl/bin
>
> @ARGV = "C:\\Perl\\bin\\folder\\princess.txt";
> use CGI;
> $q = new CGI;
> $pattern =  $cgi-> param("query");
>
> chop($pattern);
> $filename = $ARGV [0];
> $count =0;
>
> print $q-> header(),
> print $q-> start_html,
> print $q-> <h1> TheOutputs,/h1>\n",
> print "Matches found : $pattern\n";
>
> while ($line = <>) {
>           if  ($line =~ (/$pattern/)) {
>                @words = split (/$pattern/, $line);
>                 $count += @words-1;
>
> }
>
> if (eof) {
>         $filename = $ARGV[0]; }
>
> }
>
> if ($count == 0 ) {
>     print "No matches found. \n";
> } else {
>      print "Total numbers of matches : $count \n";
> }
>
> print $q-> end_html


----------------------------------------------------------------------------
----


> #!usr/perl/bin
>
> @ARGV = "C:\\Perl\\bin\\folder\\princess.txt";
>
> print "Enter your search pattern: ";
> $pattern =<STDIN>;
> chop($pattern);
> $filename = $ARGV [0];
> $count =0;
> print "Matches found :\n";
>
> while ($line = <>) {
>           if  ($line =~ (/$pattern/)) {
>                @words = split (/$pattern/, $line);
>                 $count += @words-1;
>
> }
>
> #Pointing back to the first element in text after EOF
> if (eof) {
>         $filename = $ARGV[0]; }
>
> }
>
> if ($count == 0 ) {
>     print ("No matches found. \n");
> } else {
>      print "Total numbers of matches : $count \n";
> }
>
>
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to