I couldnt help admiring Bill for that nice answers.  Enlightened me as well
:).

Karthikeyan B

----- Original Message -----
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To: "Perl" <[EMAIL PROTECTED]>
Sent: Saturday, July 05, 2003 10:06 PM
Subject: Re: Newbie Question


>
> karthikeyan.balasubramanian wrote:
> > Hi,
> >
> >
/---------------------------------------------------------------------------
> > -\
> >
> >>First, can any one suggest a good technique for debugging that would
show
> >>more verbosely what is failing.  If I run a script in a command window
and
> >>it says "bad command or filename" three times before the script runs;
how
> >>might I find out which commands run and which fail?  I know the hard way
> >
> > to
> >
> >>do that (write a bunch of code after each command to decide if it ran or
> >>not), I am looking for a simple way.
> >
> >
\---------------------------------------------------------------------------
> > -/
> >
> > try putting
> >
> > use strict;
> >
> > In your code. The above may give you more detailed error.
>
> Also try perl -w myscript.pl to pick up any warnings.  Then you could
> try perl -d myscript.pl and run the debugger on it (see perldebtut and
> perldebug man pages).
>
> >
/---------------------------------------------------------------------------
> > -\
> >
> >>Also, can anyone tell me why many programs seem to run in a command
window
> >>but not from a browser.  The command windows outputs the Content-type
> >>header, couple CRs, <HTML> tags and so on, but when I run that same
script
> >>from a browser, the browser thinks and thinks and eventually says "done"
> >>without ever showing anything.  Why does this happen so often?
> >
> >
\---------------------------------------------------------------------------
> > -/
> > Perhaps browser may not render incomplete document.  Whereas  its not
the
> > case
> > on the command line mode.
>
> Try doing a show source in the browser and see what it's getting - you
> could be sending bad HTML code that can't be rendered.
>
> >
/---------------------------------------------------------------------------
> > -\
> >
> >>And, I can't find a discussion of this on the web.  When I have lines of
> >>code that reference /usr/something/date or whathaveyou, what do I change
> >>that to on windows?  Do I use \www\this\that or can i use
> >
> > c:\www\this\that?
> >
> >>I think I've gotten www/this/that to work --is this the correct format?
> >
> >
> >
\---------------------------------------------------------------------------
> > -/
> >
> > Windows : c:\perl\bin\perl
> > Unix : /usr/bin/perl
>
> /www/this/that will work on both systems unless shelling out.
> You may have to add the <drive>: depending on what drive you are running
> from.  When shelling out, you may have to replace your /'s with \'s.  I
> prefer to always use /'s and then do a s#/#\\#g on it just before shelling
> out - that way you can make your script more portable and only have one
> line that needs to be Win32.
>
> $cmdline =~ s#/#\\#g if $^O =~ /Win32/;
>
> >
/---------------------------------------------------------------------------
> > -\
> >
> >>And, I have a command like usr/bins/sendmail  --what do I put in its
> >
> > stead?
> >
> >>Is this a ActiveState Perl command that is somewhere in the activeperl
> >>directory?  What about the "date" command?  I have a scrfipt invoking
that
> >>and am not sure that its working.  Is this supposed to be a unix command
> >
> > or
> >
> >>is it a perl command?
> >
> >
> >
\---------------------------------------------------------------------------
> > -/
> > Windows : Use smtp
> > Unix : Use sendmail
>
> Net::SMTP (simple email) or MIME::Lite (more complicated email) will
> work on both systems.  Or you could use conditional code or you could
> find a sendmail program that runs on Win32.
>
> > "date" command?
> > yes its available in both Unix and Dos
> >
> > $date
> > Thu Feb 8 16:47:32 MST 2001
> > c:> date
> > The current date is: Sat 07/05/2003
> > Enter the new date: (mm-dd-yy)
>
> Depending on what you want to do with it, localtime/gmtime will
> handle date without shelling out.  Generally I avoid shelling out
> whenever possible.
>
> --
>   ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
>  (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
>   / ) /--<  o // //      Castle of Medieval Myth & Magic
http://www.todbe.com/
> -/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (Free site for
Perl/Lakers)
>
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to