[9238] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2833 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 10 18:07:12 1998

Date: Wed, 10 Jun 98 15:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 10 Jun 1998     Volume: 8 Number: 2833

Today's topics:
        "no blank line" error from all WinPerl scripts (williams)
    Re: Bitwise Operations <tchrist@mox.perl.com>
    Re: Certified Perl Programmers (Mark-Jason Dominus)
    Re: Command line substitution thru subdirectories (John Stanley)
    Re: Command line substitution thru subdirectories <upsetter@ziplink.net>
    Re: Command line substitution thru subdirectories (Abigail)
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories <xuming@email.unc.edu>
    Re: Command line substitution thru subdirectories (Allan M. Due)
    Re: Document contains no data? <barnett@houston.Geco-Prakla.slb.com>
    Re: Document contains no data? (Patrick Timmins)
    Re: Document contains no data? (Patrick Timmins)
    Re: Errno <tkil@scrye.com>
    Re: Errno (Abigail)
    Re: Eval questions. <postmaster@castleamber.com>
    Re: Eval questions. (Kevin Reid)
    Re: McCabe complexity analysis <tkil@scrye.com>
    Re: MODERATION: Time to Vote (Craig Berry)
    Re: Need to plot charts (gif format ?) from ascii data (Chris Nandor)
    Re: Need to plot charts (gif format ?) from ascii data (John Stanley)
    Re: newbie ques:  Here Documents <jev@newton.pconline.com>
        re: NT CGI with $string = `command`; <sam.berman@att.com>
    Re: Number of digits in a string (Matt Knecht)
    Re: Number of digits in a string (Joel Coltoff)
    Re: Number of digits in a string <probavm@cat.com>
    Re: Number of digits in a string (Matt Knecht)
        One output stream to two dests <josh@vellocet.insync.net>
        Perl on NT using iis 4.0 <yong@lynxhub.ho.att.com>
        Perl security on NT with IIS (David Staschover)
    Re: Perl security on NT with IIS (Todd Lehman)
        Problem with embedding on AIX (Sean McAfee)
    Re: Sorry for seperate posts <featheredfrog@geocities.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 10 Jun 1998 20:11:32 GMT
From: williams@email.uncc.edu (williams)
Subject: "no blank line" error from all WinPerl scripts
Message-Id: <357ee5c3.26584934@news.uncc.edu>

All the WinPerl scripts I have tried give this error when I access
them with my browser (Netscape):

Message: CGI output from D:/WebSite/cgi-shl/	filename
contained no blank line separating header and data (most
likely a broken CGI program)

There is probably a simple solution, but being a newbie at this
(Perl), I can't put my hands on it.

Anyone got the answer.....

TIA
Dewey Williams
williams@email.uncc.edu


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

Date: 10 Jun 1998 20:08:54 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Bitwise Operations
Message-Id: <6lmp4m$41u$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    jharris01@my-dejanews.com writes:
:I just dove into PERL and have a question that is not in the FAQ.
:
:I fully understand what takes place in a "bitwise and" or a "bitwise or" my
:problem is I can't visualize when you would use something like this.
:
:Any examples would be appreciated!

---------
    $mode = $stat{$_}->mode() & 07777;
---------
    flock (DB_FH, LOCK_SH | LOCK_NB) || die "flock: $!";
---------
    if ($n & 1) {  # odd number
    }
---------
    sub uncontrol {
        local $_ = shift;
        s/([\200-\377])/sprintf("M-%c",ord($1) & 0177)/eg;
        s/([\0-\37\177])/sprintf("^%c",ord($1) ^ 0100)/eg;
        return $_;
    } 
---------
    $echo     = ECHO | ECHOK | ICANON;
    $noecho   = $oterm & ~$echo;
---------
    my @output = `$cmd`;
    my $exit_value  = $? >> 8;
    my $signal_num  = $? & 127;
    my $dumped_core = $? & 128;
    printf $OUT "Program terminated with status %d from signal %d%s\n",
	   $exit_value, $signal_num, 
	   $dumped_core ? " (core dumped)" : "";
---------
    $string &= "\177" x length($string);
---------
    $mode &= 07777;           # discard file type
---------
    if (($signo = system(@arglist)) &= 127) {
---------
    mkdir($dir, 0777); # remember that (0666 &~ 027) == 0640
---------
    $a ^= $b;
    $b ^= $a;
    $a ^= $b;
---------

-- 
MSDOS is a Neanderthal operating system -- Henry Spencer


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

Date: 10 Jun 1998 16:19:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Certified Perl Programmers
Message-Id: <6lmpoc$ita$1@monet.op.net>
Keywords: Flemish foggy plagiarism prize

In article <6lk40e$55p@news-central.tiac.net>,
Mike Stok <mike@stok.co.uk> wrote:
>Are you willing to certify "perl engineers"?  

Why not?

> I've always wanted to be an engineer ;-)

Now's your chance.

mjd-perl-certification@plover.com


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

Date: 10 Jun 1998 20:00:23 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmokn$20a$1@news.NERO.NET>

In article <6lmnek$41u$1@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>    Scratchie <upsetter@ziplink.net> writes:
>:Did it ever occur to you that there might be Perl newbies on this group
>:who know next to nothing about Unix?
>
>That's not our fault.

But it is when you flame them for it.



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

Date: 10 Jun 1998 19:59:00 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmoi4$4t0@fridge.shore.net>

Tom Christiansen <tchrist@mox.perl.com> wrote:
:  [courtesy cc of this posting sent to cited author via email]

: In comp.lang.perl.misc, 
:     Scratchie <upsetter@ziplink.net> writes:
: :Did it ever occur to you that there might be Perl newbies on this group
: :who know next to nothing about Unix?

: That's not our fault.

Where did I say it was? What portion of my posting were you having trouble
understanding?

It still doesn't give you the right to abuse them and insult their
intelligence just because they don't know as much as you about Unix.

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
            http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------


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

Date: 10 Jun 1998 20:53:32 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmroc$oa0$1@client3.news.psi.net>

Scratchie (upsetter@ziplink.net) wrote on MDCCXLIV September MCMXCIII in
<URL: news:6lml3q$pd@fridge.shore.net>:
++ Abigail <abigail@fnx.com> wrote:
++ 
++ : Of course not. Otherwise, if we need to list all the requirements
++ : necessary to run a perl program, the actual answer to the question
++ : would be buried in a long list of requirements.
++ 
++ Look. He posted that he was running Perl on Windows 95 and asked a
++ question. Giving him a response that requires unix tool not usually
++ available on Win95 indicates either carelessness or malice on the part of
++ the respondant.
++ 
++ Did it ever occur to you that there might be Perl newbies on this group
++ who know next to nothing about Unix?


No, and I neither do I know much about Windows.

As I said, porting the OS specific stuff is left as an exercise
to the reader - if you need help with that, ask in a group
that's specific to your OS. That falls beyond the scope of this
group.



Abigail
-- 
perl -pwle '$_ .= reverse'


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

Date: 10 Jun 1998 20:45:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmr92$8gj$1@csnews.cs.colorado.edu>

[cc to sender]

Okay, I give up.  Despite my previous opinion to the contrary, you
have successfully convinced me that it would be a good to have a perl
group that specifically catered to the tool-challenged crowd after all.
I disagreed with that position before, but no longer.  Feel free to
launch an RFD.  I'll support you.

--tom
-- 
"Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in."
	--Larry Wall in <1994Jul21.173737.16853@netlabs.com>


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

Date: Wed, 10 Jun 1998 16:39:38 -0400
From: Xuming Wang <xuming@email.unc.edu>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <357EEF0A.6AC19EF9@email.unc.edu>

Abigail wrote:

> You have a Unix without find or xargs? Complain at your vendor.

whether my Linux (who's the vendor?) has find or xargs is not the problem.  the
original poster specified he's using windows95 and you (as well as Tom C.) gave
an answer which doesn't work on win95 without some "tools" not required by
perl.  I posted the result and got "10 tons of" something dumped on my head.

> As for canned solutions to emulate Unix tools on an MS platform,
> ask in an MS specific group. Not a Perl group.

thanks and yes please keep this group as a Perl group: don't give answers
requires Visual Basic (is this a programming tool?).

BTW, I would never say "I am so pityful cause noone told me I needed a computer
to run a perl program"?  because when you install perl you know a computer, an
OS are required: i.e. someone told me that.  find and xargs are not required to
install perl and run Perl scripts on Win95.

I am tired and won't answer anymore post, so feel free to dump more **** on my
head if anyone wants.  (no "courtesy cc" please).

--
Xuming Wang


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

Date: 10 Jun 1998 21:43:44 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lmumg$qu8$0@206.165.146.195>

In article <357DA4E9.DA495FD6@code80.npt.nuwc.navy.mil>, Bob Roklan 
(roklan_r@code80.npt.nuwc.navy.mil) posted...
| I am running Perl 5.003 on Windows 95. I would like to specify a
|substitution string for multiple files spanning specified directory and
|its subdiredirectories.
|
|I know that the following would work for the current directory....
|
|    perl -i.old -p -e "s/foo/bar/g" *.htm
|
|but how can I tell perl to do the same for a specified directory and
|down?
|
|Info would be greatly appreciated. While I am here can I ask another
|question? Ok, thanks. Does anyone know of a news server where I can at
|least read comp.lang.perl.misc thru a news reader? Ours does not allow
|you to search subjects.
|
|
Poor Bob.  He asked a simple Perl question in clear and concise way, 
violating none of the mores of the social structure (with the one possible 
exception of being a WinXX user).  He asked specifically for an solution 
in Perl, probably because he know that this is a newsgroup devoted to 
Perl.  He received some answers that did not meet the criteria of his 
post, and which were potentially not technically under the purview of the 
newsgroup.  These solutions were <shudder> not of a Perl nature.  Someone 
noted their lack of Perlishness, pointed this feature out, and then.... 

The heavens erupted, the lakes burned, locusts descended from on high.  
Cats and dogs living together!  A tempest of biblical proportions.

Poor Bob. A tragic, typhoid Mary, kind of figure.  Little did he know what 
his simple question would portend.  I wonder if he ever found what he was 
looking for.  I guess we will never know.

AmD


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

Date: Wed, 10 Jun 1998 14:48:38 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Document contains no data?
Message-Id: <357EE316.5687CE69@houston.Geco-Prakla.slb.com>

Dom Franco wrote:
> 
> I recently downloaded and installed the Omnihttpd server on my
> computer.  When I try to run simple Perl scripts locally I get the
> message "Document contains no data."  What does this mean?
> Thanks
Exactly what it says.

The file you attempted to open contains no data.  I.e. the file is
empty, not full, absent of content....

More than likely, you failed to put something like this before any other
code that prints information:
print "Content-type: text/html\n\n";

Note the double \n's!  It is very important.

If it is something other than that, several suggestions:
1.  Post a snippet of code that shows what you are having trouble with.
2.  Post to comp.infosystems.www.authoring.cgi asking in that group, as
they will probably be the best equipped to help you further.
3.  Check your error logs for important messages.

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: Wed, 10 Jun 1998 20:01:11 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Document contains no data?
Message-Id: <6lmom7$cpn$1@nnrp1.dejanews.com>

In article <357eb13e.9317170@news.inav.net>,
  dfranco@inav.net (Dom Franco) wrote:
>
> I recently downloaded and installed the Omnihttpd server on my
> computer.  When I try to run simple Perl scripts locally I get the
> message "Document contains no data."  What does this mean?
> Thanks
>

It's like a document with data, only smaller.

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 10 Jun 1998 20:06:01 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Document contains no data?
Message-Id: <6lmov9$d63$1@nnrp1.dejanews.com>

In article <357eb13e.9317170@news.inav.net>,
  dfranco@inav.net (Dom Franco) wrote:
>
> I recently downloaded and installed the Omnihttpd server on my
> computer.  When I try to run simple Perl scripts locally I get the
> message "Document contains no data."  What does this mean?
> Thanks
>

I'm sorry. Try looking at comp.infosystems.www.authoring.cgi Are you printing
out your content headers? You'll get that sort of error if you don't. You'll
also get that if your script crashes. Can we see samples of your code?

Thanks

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 10 Jun 1998 14:46:46 -0600
From: Tkil <tkil@scrye.com>
Subject: Re: Errno
Message-Id: <gd8chq91l.fsf@scrye.com>


[posted and cc'd to Mark]

>>>>> "Mark" == HtmlPlace Com <htmlmail@htmlplace.com> writes:

Mark> Is there any documentation anywhere that lists possible error
Mark> codes?  I am running a script I wrote and I am coming up with
Mark> errno 2 as an error in my error logs.

Mark --

Tom has already provided a valid answer, but since you're in perl, why 
aren't you using the string value of the variable "$!"?

| $ perl -le 'open FH, "/no/file" or die "open: $!";'
| open: No such file or directory at -e line 1.

if you're in C, (1) why are you asking on c.l.perl.misc, and (2) take
a look at "man perror".

note that you might also take a look at "man errno", which [on some
systems] gives a list of all error codes.  when in doubt, however,
please do use the source as Tom has suggested.

t.
-- 
Tkil * <URL: http://www.scrye.com/~tkil> * hopelessly hopeless romantic.
  "So amplify this little one 	|   She hears as much as she can see
   She's a volume freak       	|   And what she sees, she can't believe."
        -- Catherine Wheel, _Happy Days_, "Judy Staring At The Sun"


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

Date: 10 Jun 1998 21:20:19 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Errno
Message-Id: <6lmtaj$pau$1@client3.news.psi.net>

HtmlPlace.Com (htmlmail@htmlplace.com) wrote on MDCCXLIV September
MCMXCIII in <URL: news:357EBDDE.22BC@htmlplace.com>:
++ Hello,
++ 
++ Is there any documentation anywhere that lists possible error codes?
++ I am running a script I wrote and I am coming up with errno 2 as an
++ error in my error logs. 


perl -we 'print "${\($! = 2)}\n"'




Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 10 Jun 1998 19:39:15 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: Eval questions.
Message-Id: <01bd94a7$c98dbac0$02521e0a@tschai>



Charles DeRykus <ced@bcstec.ca.boeing.com> wrote in article
<EuAwrI.8KG@news.boeing.com>...
> In article <01bd93d1$ac777600$02521e0a@tschai>,
> John Bokma <john@castleamber.com> wrote:
>  > Hi,
>  > 
>  > I want to use a tekstfile to define macro's and expand macro's
>  > based on Perl.
>  > 
>  > Example:
>  > 
>  > \
>  > sub somesub ($)
>  > {
>  >    my ($var) = shift;
>  > 
>  >    return $var;
>  > }
>  > 
>  > "";
>  > \
>  > 
>  > \somesub("Expand me")\
>  > 
>  > the \somesub("Expand me")\ is replaced by
>  > Expand me.
>  > 
>  > I have this already working using:
>  > 
>  > s/\\([^\\]+\\/ eval $1 ./ meg;
>  > 
> 
> Hm, perl contradicts you:

Very funny (not). I typed it from memory, and yes
I forgot a closing ), and there is an accidental . before
the final /. (My email program doesn't 
do syntax checking ).

But after clearing this up, have you anything to
say that's on topic?


John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com

NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures



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

Date: Wed, 10 Jun 1998 17:45:04 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Eval questions.
Message-Id: <1dad5yb.xiyxyp17dx0juN@slip166-72-108-72.ny.us.ibm.net>

John Bokma <postmaster@castleamber.com> wrote:

> Hi,
> 
> I want to use a tekstfile to define macro's and expand macro's
> based on Perl.
> 
> Example:
> 
> \
> sub somesub ($)
> {
>    my ($var) = shift;
> 
>    return $var;
> }
> 
> "";
> \
> 
> \somesub("Expand me")\
> 
> the \somesub("Expand me")\ is replaced by
> Expand me.
> 
> I have this already working using:
> 
> s/\\([^\\]+\\/ eval $1 ./ meg;
> 
> But the problem is that when I've made a mistake
> in the definition of sub, there is no clear error message.

Try this:

s/\\([^\\]+)\\/my $temp = eval $1; $@ ? $@ : $temp/meg;

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: 10 Jun 1998 14:38:21 -0600
From: Tkil <tkil@scrye.com>
Subject: Re: McCabe complexity analysis
Message-Id: <gg1hdq9fm.fsf@scrye.com>

[posted and cc'd to cited authors]

>>>>> "Stefaan" == Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> writes:

Stefaan> Warning C4706: Assignment within conditional expression.

>>>>> "Stuart" == Stuart McDow <smcdow@arlut.utexas.edu> writes:

Stuart> I wonder why they feel like they need to do so much hand-holding.

because humans are fallible, and if nothing else we sometimes have
crappy keyboards.  gcc also generates similar warnings:

| $ cat foo.c
| #include <stdio.h>
| int main (int argc, char * argv [])
| {
|   int i;
|   if (i = 1) { puts("hi mom\n"); }
|   return i;
| }
| $ gcc --version
| pgcc-2.90.27 980315 (egcs-1.0.2 release)
| $ gcc -Wall -o foo foo.c
| foo.c: In function `main':
| foo.c:5: warning: suggest parentheses around assignment used as truth value

of course, i'm rather biased about this sort of warning (that is, i
like having them) because the lack of such a warning contributed to my 
team losing in a programming contest many years ago.  old grudges die
hard. 

t.
-- 
Tkil * <URL: http://www.scrye.com/~tkil> * hopelessly hopeless romantic.
  "So amplify this little one 	|   She hears as much as she can see
   She's a volume freak       	|   And what she sees, she can't believe."
        -- Catherine Wheel, _Happy Days_, "Judy Staring At The Sun"


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

Date: 10 Jun 1998 21:31:24 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: MODERATION: Time to Vote
Message-Id: <6lmtvc$mq7$1@marina.cinenet.net>

John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
: The vote is going on USENET wide, and you will find the CFV not only in
: news.groups, but in comp.lang.perl.misc, comp.lang.perl.announce, and
: news.announce.newgroups.
: 
: But before you do what it says, read it very carefully. Almost as
: important as what it says is what it leaves unsaid.

Care to explain that?

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 10 Jun 1998 20:35:09 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Need to plot charts (gif format ?) from ascii data
Message-Id: <pudge-1006981629280001@dynamic174.ply.adelphia.net>

In article <6lmohm$1rc$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
(John Stanley) wrote:

# In article <pudge-1006981424260001@dynamic174.ply.adelphia.net>,
# Chris Nandor <pudge@pobox.com> wrote:
# >If GIF is sufficient, then who cares?  What are you afraid of?
# 
# You mean, if GIF is sufficient, who cares that doing it with gnuplot is
# easier? And where did you get this crap about being afraid?

You (wrongfully) assume gnuplot is easier.  For you it may be.


# >Anyway, it is easier, more controllable, and more portable to call
# >libraries directly with modules/XS than to call external programs.
# 
# Sorry, but I found gnuplot and plotxy to be both much easier and more
# controllable.

You do.  Some may not.


# Portability is only an issue if you intend on moving
# something from platform to platform.

And many people use perl specifically because of this intention.


# It is ridiculous to avoid an easy
# solution that doesn't run on every platform if you are never going to
# run it on every platform.

You argue as though I am suggesting everyone use GIFgraph.  If gnuplot is
easier and better for your needs, then use it.


# >The point is that for some purposes, you CAN do it in Perl, and do it
# >well.  You denied this fact.  I was simply correcting you.
# 
# No, not denied. Just told him not to use perl.  And not for all
# purposes, but for the explicit one he was asking about.

Yes, you did deny it:

In article <6lmf66$r6a$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
(John Stanley) wrote:

# In article <6lk6gm$dvs$1@thefuture.qualcomm.com>,
# Vinit Jindal <vjindal@qualcomm.com> wrote:
# >Is there a freeware / shareware utility available that I can use to
# >plot charts from ascii data.
# 
# Not perl. Find thee gnuplot or plotxy. 

And yes, you are afraid of something, or else you would have no objection
to me mentioning to perfectly fine solutions.


# >Sure, if these solutions are insufficient, or if you like gunplot, then by
# >all means, use what works.  But you can do it in Perl, and you can do it
# >well, and easily.
# 
# You can do it in perl, but not easily. And not without reinventing the
# wheel. 

Of course it is easy.  Define a matrix and some labels.  Call the
function.  Wow, that was hard.

By your own admission you have not looked at them in awhile, so you have
no right to claim it is not easy, because you are ignorant, by your own
admission.

And what wheel?  By saying "reiventing the wheel", you make it sound like
gnuplot is good for all uses.  By your own admission, it is not
necessarily portable, so that is one case where it is not good, at the
least.  And if reinventing the wheel is so bad, why do you use gnuplot AND
plotxy?

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 10 Jun 1998 21:44:56 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Need to plot charts (gif format ?) from ascii data
Message-Id: <6lmuoo$4qq$1@news.NERO.NET>

In article <pudge-1006981629280001@dynamic174.ply.adelphia.net>,
Chris Nandor <pudge@pobox.com> wrote:
>In article <6lmohm$1rc$1@news.NERO.NET>, stanley@skyking.OCE.ORST.EDU
>(John Stanley) wrote:
>
># In article <pudge-1006981424260001@dynamic174.ply.adelphia.net>,
># Chris Nandor <pudge@pobox.com> wrote:
># >If GIF is sufficient, then who cares?  What are you afraid of?
># 
># You mean, if GIF is sufficient, who cares that doing it with gnuplot is
># easier? And where did you get this crap about being afraid?
>
>You (wrongfully) assume gnuplot is easier.  For you it may be.

You wrongfully assume that the modules you listed are easier. For you
they may be. I can't imagine a tool that would force me to define the
axes for just a simple plot to be easier. And something that deals with
non-monotonic data without jumping through hoops is certainly easier to
use.

># Sorry, but I found gnuplot and plotxy to be both much easier and more
># controllable.
>
>You do.  Some may not.

Someone asked for a recommendation. I made it. If you don't like it, too
bad. 

># Portability is only an issue if you intend on moving
># something from platform to platform.
>
>And many people use perl specifically because of this intention.

And many people use perl who have no intention like this. If you recall,
the original question concerned plotting Oracle data. I doubt that even
you would claim that Oracle is highly portable. I bet that gnuplot will
run on just about anything that runs Oracle.

># It is ridiculous to avoid an easy
># solution that doesn't run on every platform if you are never going to
># run it on every platform.
>
>You argue as though I am suggesting everyone use GIFgraph.  If gnuplot is
>easier and better for your needs, then use it.

So exactly why are you arguing with me about this? Oh, I know, it's
because I suggested that perl wasn't the proper tool for something.
Hammer dealers unite!

>And yes, you are afraid of something, or else you would have no objection
>to me mentioning to perfectly fine solutions.

Fine, Chris. The fact that I suggested a different tool instead of perl
is a sign that I am afraid of something. Whatever you say. I didn't
object to you mentioning "perfectly fine" solutions, I objected to you
saying that I was wrong for suggesting something besides perl.

># You can do it in perl, but not easily. And not without reinventing the
># wheel. 
>
>Of course it is easy.  Define a matrix and some labels.  Call the
>function.  Wow, that was hard.

I don't have to define a "matrix" with gnuplot. I don't have to tell it
where to put labels, or even define them if I don't want to. I don't
have to tell it what colors to use. I don't have to tell it what range
to put on the axes. I don't have to do a lot of things with gnuplot
that I was going to have to do with the modules you suggested. That
makes using gnuplot much easier.

>And what wheel?  

Plotting data.

>By saying "reiventing the wheel", you make it sound like
>gnuplot is good for all uses.  

No, only in your little world do I make it sound like that. Most people
would realize that a wheel is not the proper piece of hardware for all
uses, although you want to claim that I implied it was.

>By your own admission, it is not
>necessarily portable, so that is one case where it is not good, 

And like I said, avoiding an easy solution just because it is not
available on every computer on earth is ridiculous, unless you expect to
run your software on every computer on earth. Gnuplot is probably
available on as many systems as perl is, so if gnuplot is bad because it
isn't "highly portable", I guess perl is, too.

>And if reinventing the wheel is so bad, why do you use gnuplot AND
>plotxy?

Because they already exist and are designed to do the job that they are
asked to do. They are the wheel that doesn't need to be reinvented.
That seems like a simple concept. 

Are you going to react like this as a moderator anytime someone suggests
that using perl isn't the right thing to do for a certain situation?



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

Date: 10 Jun 1998 21:37:03 GMT
From: John Erjavec V <jev@newton.pconline.com>
Subject: Re: newbie ques:  Here Documents
Message-Id: <6lmu9v$v1s$1@bell.pconline.com>

Timothy Lowe <timlowe@u.washington.edu> wrote:
: Thanks a ton.. It was the leading white space.  I was under the impression
: that the whitepsace didn't really matter.  I'm also on my way to get the

In most cases, whitespace doesn't matter.  You just happened to hit one
that _did_ matter. *g*

-JEV
-- 
John Erjavec V	PGP fingerprint:
jev@pconline.com	7593 1B5A AE11 C0FE BA09  EB5E 8DE9 D2E5 BF5B 87AD
http://www.pconline.com/~jev/index.html
"I'll say it again for the logic impaired."  --Larry Wall


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

Date: Wed, 10 Jun 1998 16:15:46 -0400
From: sam berman <sam.berman@att.com>
Subject: re: NT CGI with $string = `command`;
Message-Id: <357EE972.22857DB9@att.com>

In a CGI on an NT server running IIS 4.0 I have a script that
has backquotes in it

$string = `cd`;

The item above does not populate $string when running via CGI although
it is populated
when run from the command line.  It also does not set $? in either case.

I changed the above to:

$string = `md abc`;
and the directory, abc, is created (although this time $string should
not be populated).

Any help would be appreciated.

--
thanks
sam



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

Date: Wed, 10 Jun 1998 20:11:54 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Number of digits in a string
Message-Id: <eMBf1.16$34.508414@news2.voicenet.com>

Joel Coltoff <joel@wmi0.wmi.com> wrote:
>In article <6lmkt8$2um1@eccws1.dearborn.ford.com>,
>Tom Harrington <tph@rmi.net> wrote:
>>if((length($thestring)==6) && ($thestring =~ /^\d+$/)) ...
                                               ^^^^^^^
>And doesn't check for commas as in 123,456. Of course some people
>on the other side of the pond use a different character to separate
>the digits of numbers greater than 999.

It does check for commas.  Actually, it checks and makes sure they
aren't there.

None of the solutions offered take into account punctuation, different
number bases or non-integer numbers.

Any exaustive solution to this question turns out to be more than a one
liner (Er... perhaps that should be "more than one semi-colon-er").

But, thankfully, for simple cases, it looks like all the solutions work.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Wed, 10 Jun 1998 20:24:46 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Number of digits in a string
Message-Id: <6lmq1j$7p3@netaxs.com>

In article <eMBf1.16$34.508414@news2.voicenet.com>,
Matt Knecht <hex@voicenet.com> wrote:
>Joel Coltoff <joel@wmi0.wmi.com> wrote:

>>And doesn't check for commas as in 123,456. Of course some people
>>on the other side of the pond use a different character to separate
>>the digits of numbers greater than 999.
>
>It does check for commas.  Actually, it checks and makes sure they
>aren't there.

That's exactly the point. The original question was about checking
if the number had exactly 6 digits. It wasn't about a string 6 digits
long. Numbers typed in by users can have commas in them. I don't really
care if he checks for them or not. For production code I would.

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


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

Date: Wed, 10 Jun 1998 15:35:11 -0500
From: "Vincent M. Probasco" <probavm@cat.com>
Subject: Re: Number of digits in a string
Message-Id: <357EEDFE.C053B191@cat.com>

Thanks to all who replied ! It was a big help.

Thanks again,

Vince





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

Date: Wed, 10 Jun 1998 20:58:04 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Number of digits in a string
Message-Id: <wrCf1.20$34.528410@news2.voicenet.com>

Joel Coltoff <joel@wmi0.wmi.com> wrote:
>>It does check for commas.  Actually, it checks and makes sure they
>>aren't there.
>
>That's exactly the point. The original question was about checking
>if the number had exactly 6 digits.

Not to be pedantic, but....

All integers, when displayed in base 10 consist of nothing but digits.

>It wasn't about a string 6 digits long.

Exactly.  It was about a number, not a string.

>Numbers typed in by users can have commas in them.

Then they are strings that represent numbers, not numbers.

>I don't really care if he checks for them or not.

Then why bring it up in the first place?

>For production code I would.

As would I.  But then, I'd make sure all my numbers were really numbers
and not strings before I tried to manipulate them.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: Wed, 10 Jun 1998 20:49:29 GMT
From: Josh Abrams <josh@vellocet.insync.net>
Subject: One output stream to two dests
Message-Id: <Pine.SOL.3.96.980610154254.27219L-100000@vellocet.insync.net>


How can I send one output stream to two destinations in PERL?

In UNIX Bourne/Born Again:

$ cat thisone 2>&1.

In this case, I want output to go to a file and to stdout.

Please email replies.

Thanks in advance.



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

Date: Wed, 10 Jun 1998 16:11:16 +0100
From: Yong Gao <yong@lynxhub.ho.att.com>
Subject: Perl on NT using iis 4.0
Message-Id: <357EA211.D4B088D0@lynxhub.ho.att.com>

Folks,

I used Perl 5.003 on NT 4.0 and IIS4.0 for CGI purpose.  Following code
works fine by using Perl xxx.pl but  under cgi directory in IIS4.0 it
didn't work from browser point of view, taking the back tick out, this
will work.  As I got more information, I tried using IIS2.0 and back
tick worked  Could someone help me?

Thanks

Young  my email is yong@lynxhub.att.com

select STDOUT; $|=1;

use strict;

print "Content-type: test/html\n\n";
print "<HTML> <BODY>";

my $information=`route print`;

if ($? != 0) {
    print "failed in exec\n";
}
else {
    print "directory is $information\n";
}

print"</BODY> <HTML>";

exit 0;
~



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

Date: 10 Jun 1998 16:40:51 -0400
From: das@panix.com (David Staschover)
Subject: Perl security on NT with IIS
Message-Id: <6lmr0j$ab4@panix.com>

We are running IIS3.0. We given CGI-BIN access to a few users. 
Unfortuntunatly, the user is able to write a perl script on the web which
can create/update a file anywhere on the NT server. 

How do I prevent this?

Thanks in advance

- David
das@panix.com





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

Date: Wed, 10 Jun 1998 21:29:54 GMT
From: lehman@visi.com (Todd Lehman)
Subject: Re: Perl security on NT with IIS
Message-Id: <mVCf1.633$bj2.3205125@ptah.visi.com>

In article <6lmr0j$ab4@panix.com>, David Staschover <das@panix.com> wrote:
> We are running IIS3.0. We given CGI-BIN access to a few users. 
> Unfortuntunatly, the user is able to write a perl script on the web which
> can create/update a file anywhere on the NT server. 
>
> How do I prevent this?
>
> Thanks in advance
>
> - David
> das@panix.com


I thought NT had the capability to restrict directories to user groups
using the User Mangler (icon is two little faces) program and the File
Mangler (yellow storage drawer icon).

But TMTOWTDI...you could also s/NT/Unix/  ;-)

--Todd


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

Date: Wed, 10 Jun 1998 19:57:06 GMT
From: mcafee@frogger.rs.itd.umich.edu (Sean McAfee)
Subject: Problem with embedding on AIX
Message-Id: <myBf1.394$Y3.2042222@news.itd.umich.edu>

I'm trying to add database functionality to a script which is called from a
C program.  However, I can't even get this short example to work:

> perl -e 'use DBI;'	# runs with no problem
> perl -MExtUtils::Embed -e xsinit -- -o xsinit.c
> cc -c xsinit.c `perl -MExtUtils::Embed -e ccopts`
> cat a.c
#include <EXTERN.h>
#include <perl.h>

main(int argc, char **argv, char **env)
{
	PerlInterpreter *perl;
	char *myargv[] = { "", "-e", "use DBI;" };
	extern void xs_init(void);

	perl = perl_alloc();
	perl_construct(perl);
	perl_parse(perl, xs_init, 3, myargv, env);
	perl_run(perl);
	perl_destruct(perl);
	perl_free(perl);
}

> cc -c a.c `perl -MExtUtils::Embed -e ccopts`
> cc -o test a.o xsinit.o `perl -MExtUtils::Embed -e ldopts`
> test
Segmentation fault(coredump)
>

If I change the "use DBI;" argument to, say, "print qq(Hello world!\n);",
the command is run as expected.

Can anyone shed some light on my predicament?  If it helps, here's what gdb
had to say after I recompiled with the -g flag:

(gdb) back
#0  0xd0f8f7b0 in ?? () from (unknown load module)
#1  0x1004f6e8 in Perl_pp_entersub ()
#2  0x1002c208 in Perl_runops ()
#3  0x10004ab0 in perl_call_sv ()
#4  0x10005d6c in Perl_call_list ()
#5  0x10046b08 in Perl_newSUB ()
#6  0x100423bc in Perl_utilize ()
#7  0x1002cd38 in Perl_yyparse ()
#8  0x1000310c in perl_parse ()
#9  0x10000290 in main (argc=1, argv=0x2ff22b60, env=0x2ff22b68) at a.c:17
#10 0x100001c8 in __start ()

Thanks in advance.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Wed, 10 Jun 1998 16:09:03 -0400
From: "Michael D. Hofer" <featheredfrog@geocities.com>
Subject: Re: Sorry for seperate posts
Message-Id: <357EE7DF.F76@geocities.com>

John Porter wrote:
> 
> HtmlPlace.Com wrote:
> >
> > I have searched all my local book store for "Programming Perl" "The
> > Camel Book" and "The Llama Book" and nobody in this little side street
> > town has them or can order them is there a place I can buy them directly
> > or indirectly through a phone number rather than giving my credit card
> > number online ?
> 
> Computer Literacy Bookshops:    800-789-8590
> 
> john Porter

or my favorite (no relationship) at http://www.vcss.com/, order, and
then you can call or fax your CC #...(or mail a check/mo)

-- 
Cian ua'Lochan /mka/ Michael D. Hofer
No Unsolicited Commercial Email: $500.00/Item for proofreading!
I'm not a medievalist - I just play one on weekends!
http://www.geocities.com/SoHo/Lofts/9800/


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

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


Administrivia:

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 2833
**************************************

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