[11004] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4604 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 9 14:07:21 1999

Date: Sat, 9 Jan 99 11:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 9 Jan 1999     Volume: 8 Number: 4604

Today's topics:
    Re: Beginner trying to figure out PERL for cgi use (Tad McClellan)
    Re: best way to track time in a script for tuning? (Larry Rosler)
    Re: best way to track time in a script for tuning? <dtbaker-@busprod.com>
    Re: c to perl (Tad McClellan)
    Re: cannot find tiehash.al with BerkeleyDB2.6.4/Perl5.0 (2n3055@usa.net)
    Re: determining controlling tty <craig.berbling@pobox.com>
    Re: Easy binary file access ? (M.J.T. Guy)
        Easy question... <luc2@travelpod.com>
    Re: Easy question... <rick.delaney@home.com>
        Execute perl scripts on remote server cvpereira@my-dejanews.com
    Re: How to do an exact comparison? (Tad McClellan)
    Re: How to do an exact comparison? <craig.berbling@pobox.com>
    Re: If Larry Wall's listening out there.... (Andrew M. Langmead)
        Inspecting MY variables with the debugger <cobalt@dircon.co.uk>
    Re: installing activeperl on windows 98 using personal  (ToNiC0010)
    Re: Need CGI database <bdeitte@blue.weeg.uiowa.edu>
        Perl 5.005 installation question <cadams@teleport.com>
    Re: Perl Criticism (Tad McClellan)
    Re: regexp and broken MY reference <rick.delaney@home.com>
    Re: Remove vars from a foreach loop (Tad McClellan)
    Re: replacing <BR> with a physical carriage return (Tad McClellan)
    Re: replacing <BR> with a physical carriage return (Jason Q.)
    Re: System command in perl CGI (Tad McClellan)
    Re: using strict with CGI.pm <bdeitte@blue.weeg.uiowa.edu>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 9 Jan 1999 10:15:48 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Beginner trying to figure out PERL for cgi use
Message-Id: <kbv777.a0u.ln@magna.metronet.com>

Wayne (wayne@deerhurst.com) wrote:

: Also I have a scaler variable that contains a total eg .
: $total =10.00
: $total = $total + 10.00

: Now when I send this to a web page to give a customer the total they
: spend I would see
: $10 and not $10.00  How do I force my script to keep 2 decimal places?


   perldoc -f printf


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 9 Jan 1999 07:47:36 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: best way to track time in a script for tuning?
Message-Id: <MPG.110119ef82de229d989981@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <369668E2.59B9992B@busprod.com> on Fri, 08 Jan 1999 14:21:54 
-0600, Dan Baker <dtbaker-@busprod.com> says...
> I'm looking for tips and hints on good methods to do some final tuning
> on scripts... I have some that are running, but take a little longer
> than I expect. Are there good ways to throw in some prints that will
> show the time in msec or something like that so I can narrow down what
> areas need tuning?

`perldoc -f times`

Resolution is one tick of the OS clock, typically 60 or 100 per second.

For CPU time:

my $t0 = (times)[0];
< code to be timed >
my $t1 = (times)[0];
printf "%.2f\n", $t1 - $t0;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 09 Jan 1999 11:28:30 -0600
From: Dan Baker <dtbaker-@busprod.com>
Subject: Re: best way to track time in a script for tuning?
Message-Id: <369791BE.56135A48@busprod.com>

Larry Rosler wrote:
> 
> [Posted to comp.lang.perl.misc and copy mailed.]
> 
> In article <369668E2.59B9992B@busprod.com> on Fri, 08 Jan 1999 14:21:54
> -0600, Dan Baker <dtbaker-@busprod.com> says...
> > I'm looking for tips and hints on good methods to do some final tuning
> > on scripts... 
> `perldoc -f times`
> 
> Resolution is one tick of the OS clock, typically 60 or 100 per second.
> 
> For CPU time:
> 
> my $t0 = (times)[0];
> < code to be timed >
> my $t1 = (times)[0];
> printf "%.2f\n", $t1 - $t0;
> 
---------------------
hhhmmm, wonder how I missed that function?! I was looking at time() and
localtime().
the perldoc says its in seconds, but I will whip up a little test to
check it out!

Dan



 Dan

# If you would like to reply-to directly, remove the - from my username
* no spam please... regulated by US Code Title 47, Sec.227(a)(2)(B)  *


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

Date: Sat, 9 Jan 1999 10:28:40 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: c to perl
Message-Id: <o30877.sku.ln@magna.metronet.com>

Jonathan Stowe (gellyfish@btinternet.com) wrote:
: On Sat, 09 Jan 1999 09:11:31 GMT Expert wrote:
: > webmaster@galilnet.co.il wrote:
: >> 
: >> Is there a utility that converts c to perl?
: >> 
: > I am looking for a utility that converts perl to c .

: I am looking for a utility that converts perl to seaweed ...


   I often find myself looking for a job that converts
   Perl into money   ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 09 Jan 1999 16:37:11 GMT
From: 2n3055@usa.net (2n3055@usa.net)
Subject: Re: cannot find tiehash.al with BerkeleyDB2.6.4/Perl5.004_4/PM0.06?
Message-Id: <36998563.46904675@news.supernews.com>

I just get the problem solved,
seems I need a new tie gammer,
as stated in the pod file...

tie %hash, 'BerkeleyDB::Hash',
-Filename  => $filename,
#-Flags     => DB_CREATE
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;

On Sat, 09 Jan 1999 13:33:13 GMT, 2n3055@usa.net (2n3055@usa.net)
wrote:

>I am using Redhat Linux 5.1/intel
>afterdownload BerkeleyDBv2.6.4 and install it,
>if I 
>use BerkeleyDB;
>tie %h, BerkeleyDB, Filename;
>untie %h;
>it produce an error code "cannot find tiehash.al"
>but if I use the dbmopen/dbmclose, instead of tie/untie,
>the program run smoothly?
>what's the problem?
>anybody help?
>thanks.



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

Date: Sat, 09 Jan 1999 17:31:51 +0000
From: Craig Berbling <craig.berbling@pobox.com>
Subject: Re: determining controlling tty
Message-Id: <36979287.22755ED2@pobox.com>

Ronald J Kimball wrote:
> 
> Craig Berbling <cberblin@us.dhl.com> wrote:
> 
> > I want to determine if my perl process is attached to a terminal or not.
> > If not I will direct STDOUT to a log file, otherwise I will spew to the
> > terminal.  I don't want to rely on the output of the 'tty' command or any
> > other external command.  Is there an internal 'perl thingee' or method of
> > determining this ?
> >
> > I have searched this news group and the moderated one, but my eyes are now
> > tired so it's time to post.
> 
> Guess what, you forgot to search the documentation.  :-)
> 
> perlfunc:
> 
>     -X FILEHANDLE
> 
>     -X EXPR
> 
>     -X
> 
>     A file test, where X is one of the letters listed below.  This unary
>     operator takes one argument, either a filename or a filehandle, and
>     tests the associated file to see if something is true about it.  If
>     the argument is omitted, tests $_, except for -t, which tests STDIN.
>     Unless otherwise documented, it returns 1 for TRUE and '' for FALSE,
>     or the undefined value if the file doesn't exist.  Despite the funny
>     names, precedence is the same as any other named unary operator, and
>     the argument may be parenthesized like any other unary operator.
>     The operator may be any of:
> 
>     [...]
> 
>         -t  Filehandle is opened to a tty.
> 
> perlfaq8:
> 
>     How do I find out if I'm running interactively or not?
> 
>     Good question.  Sometimes C<-t STDIN> and C<-t STDOUT> can give
>     clues, sometimes not.
> 
>         if (-t STDIN && -t STDOUT) {
>             print "Now what? ";
>         }
> 
>     On POSIX systems, you can test whether your own process group
>     matches the current process group of your controlling terminal as
>     follows:
> 
>         use POSIX qw/getpgrp tcgetpgrp/;
>         open(TTY, "/dev/tty") or die $!;
>         $tpgrp = tcgetpgrp(TTY);
>         $pgrp = getpgrp();
>         if ($tpgrp == $pgrp) {
>             print "foreground\n";
>         } else {
>             print "background\n";
>         }
> 
> --
>  _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
> ( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
>     /                                  http://www.ziplink.net/~rjk/
>         "It's funny 'cause it's true ... and vice versa."

Ya know I knew I was gonna get bitten for not thoroughly going through the docs,
I guess I shouldn't have drunk those 2 bottles of cough syrup that morning. 
Thanks for the pointers.

Craig


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

Date: 9 Jan 1999 15:05:07 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Easy binary file access ?
Message-Id: <777r73$8i8$1@pegasus.csx.cam.ac.uk>

Jonathan Stowe  <gellyfish@btinternet.com> wrote:
>
>($time,
> $client,
> $object,
> $size,
> $method,
> $status,
> $type,
> $server ) = unpack ( S S S S A4 A3 A6 A32, $request );

Ooops  -  you forgot some quotes:
  $server ) = unpack ('S S S S A4 A3 A6 A32', $request );


Mike Guy


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

Date: Sat, 9 Jan 1999 11:32:59 -0500
From: "news.rogers.ca" <luc2@travelpod.com>
Subject: Easy question...
Message-Id: <777vuk$2el$1@news.on>

In perl, how do I do an IF statement to make sure a variable is only
digits... not chars (like isalpha() / isdigit())

ie: if ( isdigit($variable) )

Thanks,

Luc,
luc2@travelpod.com




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

Date: Sat, 09 Jan 1999 16:32:29 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Easy question...
Message-Id: <3697866A.CEECD6F2@home.com>

[posted & mailed]

news.rogers.ca wrote:
> 
> In perl, how do I do an IF statement to make sure a variable is only
> digits... not chars (like isalpha() / isdigit())

Check the FAQ in perlfaq4, "How do I determine whether a scalar is a
number/whole/integer/float?"

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Sat, 09 Jan 1999 16:03:12 GMT
From: cvpereira@my-dejanews.com
Subject: Execute perl scripts on remote server
Message-Id: <777ujv$fq1$1@nnrp1.dejanews.com>

Hi all,

can I generally execute perl scripts on a remote server ?

Background: We use Novonyx Enterprise Server because of the grat I/O
Performance and the tight Novell-NDS-LDAP integration. But: The Perl-Port is
really bad. So I'd like to put a linux machine right next to the main
web-server to execute perl-scripts. Can I do something like this ? mapping ?
global variables in some perl module ?

Thanks a lot
Clemens


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 9 Jan 1999 10:03:36 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to do an exact comparison?
Message-Id: <oku777.a0u.ln@magna.metronet.com>

Craig Berbling (craig.berbling@pobox.com) wrote:
: Bruce Chu wrote:
: > 
: > if ($variable eq "test") # for string comparisons
: > if ($variable == 10) # for numerical comparisons
: > 
: > "news.rogers.ca" wrote:

: > > it will return true if "test" is in $variable but how do I format the if
: > > statement if I want it to return true only if the string in $variable is
: > > exactly "test" and not "mytest" or "test123"...


: Or 
: if ( $variable =~ /^test$/ )


   Regular expressions are used for matching a pattern.

   eq & == are used for testing for equality.


-------------------
#!/usr/bin/perl -w

use Benchmark;

$variable = 'test';

timethese(1_000_000, {
   'eq' => q!if ($variable eq 'test') {}!,
   'regex' => q!if ($variable =~ /^test$/) {}!
});
-------------------


Benchmark: timing 1000000 iterations of eq, regex...
        eq:  4 wallclock secs ( 4.29 usr +  0.00 sys =  4.29 CPU)
     regex: 13 wallclock secs (12.64 usr +  0.00 sys = 12.64 CPU)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 09 Jan 1999 17:27:14 +0000
From: Craig Berbling <craig.berbling@pobox.com>
Subject: Re: How to do an exact comparison?
Message-Id: <36979172.2DFE2E91@pobox.com>

Craig Berbling wrote:
> 
> Bruce Chu wrote:
> >
> > if ($variable eq "test") # for string comparisons
> > if ($variable == 10) # for numerical comparisons
> >
> > "news.rogers.ca" wrote:
> >
> > > Hello,
> > >
> > >     This may sound like a stupid question but I know if I do...
> > >
> > >             if ( $variable =~ /test/ )
> > >
> > > it will return true if "test" is in $variable but how do I format the if
> > > statement if I want it to return true only if the string in $variable is
> > > exactly "test" and not "mytest" or "test123"...
> > >
> > > Help!
> > > Thanks,
> > >
> > > Luc Levesque
> > > luc2@travelpod.com
> 
> Or
> if ( $variable =~ /^test$/ )
> 
> --
> Craig



---No.  This tests something different:
---
---        $a = "test";
---        $b = "test\n";
---
---        print "yes\n" if $a =~ /^test$/;
---        print "yes\n" if $b =~ /^test$/;
---
---This prints "yes" twice.
-----
---Michael M Rubenstein
---
============================
---   Regular expressions are used for matching a pattern.
---
---   eq & == are used for testing for equality.
---
---
----------------------
---#!/usr/bin/perl -w
---
---use Benchmark;
---
---$variable = 'test';
---
---timethese(1_000_000, {
---   'eq' => q!if ($variable eq 'test') {}!,
---   'regex' => q!if ($variable =~ /^test$/) {}!
---});
----------------------
---
---
---Benchmark: timing 1000000 iterations of eq, regex...
---        eq:  4 wallclock secs ( 4.29 usr +  0.00 sys =  4.29 CPU)
---     regex: 13 wallclock secs (12.64 usr +  0.00 sys = 12.64 CPU)
---
---
-----
---    Tad McClellan                          SGML Consulting
---    tadmc@metronet.com                     Perl programming
---    Fort Worth, Texas
---

Thank you Michael and Tad for clearing that up for me, I hate to proliferate
mis-information but do enjoy learning.

Craig


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

Date: Sat, 9 Jan 1999 18:56:24 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: If Larry Wall's listening out there....
Message-Id: <F5B3A0.DEo@world.std.com>

abigail@fnx.com (Abigail) writes:

>Tell me, do Java or C give context? Do they even give a line number on a
>run time error?

>If you insist on using a primitive editor, you can always do

>   perl -wne 'print if (XX - 2) .. (XX + 2)' file

>with XX the line number of the error.

Even better, the poster could use the "diagnostics" pragma as a base
to create a module to do something similar, and then use PERL5OPTS to
make it their default.

(Or should diagnostics be patched to do it? Its already verbose. Would
adding the source context hurt?)

-- 
Andrew Langmead


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

Date: Sat, 9 Jan 1999 17:14:56 -0800
From: "Paul Davies" <cobalt@dircon.co.uk>
Subject: Inspecting MY variables with the debugger
Message-Id: <36978f6d.0@newsread3.dircon.co.uk>

Hi

It does not appear possible to inspect MY variables in the perl debugger.

Eg:

sub foo {
    my($var) = "avar";
}

I could inspect them when I used the ActiveState perl debugger under windows
NT but now I have moved to Linux I cannot inspect them.

Is there a way round this?

Help appreciated.

Paul





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

Date: 9 Jan 1999 16:34:36 GMT
From: tonic0010@aol.com (ToNiC0010)
Subject: Re: installing activeperl on windows 98 using personal web server
Message-Id: <19990109113436.05499.00009511@ng-fa2.aol.com>

I had problems with Perl on Microsoft Personal Web Server...

I found a really good free server called Xitami, its a 10 minute download from
www.imatix.com, runs CGI scripts seamlessly, and best of all... it isn't
Miscrosoft..


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

Date: Sat, 9 Jan 1999 12:21:48 -0600
From: Brian Deitte <bdeitte@blue.weeg.uiowa.edu>
Subject: Re: Need CGI database
Message-Id: <Pine.A41.3.95.990109121921.33102A-100000@black.weeg.uiowa.edu>

On 9 Jan 1999, Jonathan Stowe wrote:

> Anyhow if you are interested in using a flat file structure for your data
> then you could do worse than look at Brent Michalski's column on this
> subject on WebReview <URL:wwww.webreview.com> which is a good starting
> point for this kind of thing.

You (the originarl poster, that is, not the person I am quoting) may also
want to look at Sprite.pm, which uses text files but works with a subset
of SQL, making it easy to transfer (I'm guessing) to a relational
database.  -Brian



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

Date: Sat, 9 Jan 1999 10:35:12 -0800
From: "Christopher Adams" <cadams@teleport.com>
Subject: Perl 5.005 installation question
Message-Id: <2FNl2.8657$W_.5223946@news1.teleport.com>

I was installing Perl 5.005 on a SunOS 4.13. I generated the config.sh file.
I am upgrading from Perl 5.000 Then I ran a 'make'. The operation failed and
gave me the following message:

hv.c:72: In function 'save-hek':
hv.c:72:Parse error before 'HEK'
hv.c:72:Parse error before ')'
hv.c:188:in function 'Perl_hv_fetch_ent':
hv.c:188: Parse error before 'HEK'
hv.c:188: Pars error before ')'
hv.c:1029:In function 'Perl_hv_internext':
hv.c:1029: Parse error before 'HEK'
hv.c:1029: Pars error before ')'
Make: Fatal Error Command failed for target 'hv.o'


Since I have no idea what this all means, I can't really do any
troubleshooting. Can anyone suggest what is going on and what I need to do?

Also, is there a website that has an installation troubleshooting FAQ or
searchable knowledge base that lists some of the problems that arise in
installation.

Christopher Adams
cadams@teleport.com




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

Date: Sat, 9 Jan 1999 09:26:53 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl Criticism
Message-Id: <tfs777.a0u.ln@magna.metronet.com>

TRG Software (chatmaster@c-zone.net) wrote:

: topmind@technologist.com wrote:
: > 
: > Subject: Perl Criticism
: > 
: <SNIP a great deal of stupidity>

: I see this 'wizard' of the "Perl language" That posts this nonsense, is
: literally claiming to "specialize" in it? If you can believe this:

[snip]

: Thank You. - topmind@technologist.com -
: (Note: I avoid using my real name on Usenet to reduce
: spam and other junk-mail.)
           ^^^^^


   Yet another display of insightful logic.

   
   All that is required to be spammed is an email address, whether
   incorporating your real name or an alias.

   Perlhaps he should have said "I avoid using my real name on 
   Usenet to reduce the probability of being thwacked on the
   head should we meet in the real world"  ;-)


   What member of the set of junk-mail is not also a member
   of the set of spam?...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 09 Jan 1999 18:08:01 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: regexp and broken MY reference
Message-Id: <36979CC9.7909C486@home.com>

[posted & mailed]

M.J.T. Guy wrote:

> Please restrict your quoting to the part(s) of the article you are
> actually replying to.

Huh?  I do not see enough difference between yours and Ala's original
replies in the form of quoted text to warrant such a remark.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Sat, 9 Jan 1999 10:24:11 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Remove vars from a foreach loop
Message-Id: <brv777.sku.ln@magna.metronet.com>

Eirik Johansen (webpages@email.com) wrote:


: Is it possible to do a foreach loop, but to remove some vars from the
: loop that you know the names of. (I do not know the names of the rest of
: the components, cause the user is supposed to chose his/her own
: components.


   Just don't print the array elements that you don't want to print  ;-)

   foreach (@stuff) {
      print unless /^From:/;
   }


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 9 Jan 1999 09:11:22 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: replacing <BR> with a physical carriage return
Message-Id: <qir777.a0u.ln@magna.metronet.com>

Clay Irving (clay@panix.com) wrote:
: In <369c0d03.108387050@news.cyberway.com.sg> pigs_can_fly@mindless.com (Jason Q.) writes:

: >How do I get perl to replace the <BR> with a carriage return so that
: >the textarea displays it like this:

: >I tried this:
: >$string =~ s/<BR>/\n/eg;

: >but got this result:
: >| Jack and JillSCALAR(0xb79640)Went up the hill	|



: You have to escape the brackets -- This:


   Eh?


:     #!/usr/local/bin/perl5 -w
:     
:     $string = "Jack and Jill<BR>Went up the hill";
:     
:     $string =~ s/\<BR\>/\n/;
:     
:     print "$string\n";
:     
: prints:

:     Jack and Jill
:     Went up the hill


----------------
#!/usr/bin/perl -w

$string = 'Jack and Jill<BR>Went up the hill';
$string =~ s/<BR>/\n/g;
print "$string\n";

$string = 'Jack and Jill<BR>Went up the hill';
$string =~ s/\<BR\>/\n/g;
print "$string\n";
----------------

prints:

Jack and Jill
Went up the hill
Jack and Jill
Went up the hill


   Angle brackets have no meta-meaning in a regex, and therefore
   do not need escaping...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 09 Jan 1999 17:31:05 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: Re: replacing <BR> with a physical carriage return
Message-Id: <369c9206.18429706@news.cyberway.com.sg>

It works perfectly without the 'e'.

Thanks guys for your help. Appreciated.


J


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

Date: Sat, 9 Jan 1999 10:14:02 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: System command in perl CGI
Message-Id: <a8v777.a0u.ln@magna.metronet.com>

dua12@my-dejanews.com wrote:

: I am working on a project where I m required to execute a prolog script
: (interpreter) and show the output generated thru  cgi and HTML.

: I am successful in generating the desired output but my problem is that
: output include the compilation stuff (error and worning) too.


   Since you don't tell us how to distinguish "compilation stuff"
   from the desired output, we cannot help you there.


: I just want to know is there anyway i can get rid of undesired output.

   If we knew what was undesired we might be able to help.


: Pls. have a glance of the code.

: #usr/bin/perl -w
  ^^
  ^^ aren't you missing two characters there?

   #!/usr/bin/perl -w
    ^^

: push(@INC,"/cgi-bin");
: require ("cgi-lib.pl");
: $ENV{'PATH'}.="/usr/local/bin";
: $ENV{'PATH'}.="/var/lib/httpd/cgi-bin";


   You don't need to mess with the path, since you are using
   the absolute path to the Prolog interpreter anyway...


: print "Content-type: text/html\n\n";
: $|=1;

: system("/usr/local/bin/pl -f sunny.pl") || print "Error using pl : $!";
                                          ^^
                                          ^^
    You will print the error message when there is *no* error,
    and remain silent when there *is* an error. Probably not
    what you want.

    Check up on what is returned by system(), and then

      tr/|/&/;


: open(OF,"<abc") || print "I/O Error : abc : $!";
                     ^^^^^

    What is the point of continuing if your program cannot open
    the file?

      s/print/die/;


: print "<HTML>
:        <HEAD></HEAD>
:        <BODY><P>";
: while(<OF>)
: {chop;

   chomp() is safer...


: print "$_<BR>";


   print "$_<BR>" unless (some expression that returns true if
                          the line is "compilation stuff")

: }
: close(OF);


: Pls. help me out. I shall be really greatful to you.

   You have not given us enough information to help you...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 9 Jan 1999 12:31:40 -0600
From: Brian Deitte <bdeitte@blue.weeg.uiowa.edu>
Subject: Re: using strict with CGI.pm
Message-Id: <Pine.A41.3.95.990109123021.17230A-100000@black.weeg.uiowa.edu>

On Fri, 8 Jan 1999, Xah Lee wrote:

> Yes. I ALWAYS use strict. CGI.pm is not very well designed, and its author
> apparently isn't a "strict nut" like I am. However, you can use CGI.pm with
> use strict while still using the functional interface. I've been doing
> exactly that for several months.

Hm, now I am confused.  I always get an "undefined subroutine call" for
param calls when I use the functional interface.  Am I doing something
else wrong?  -Brian



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4604
**************************************

home help back first fref pref prev next nref lref last post