[8627] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2244 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 3 17:07:38 1998

Date: Fri, 3 Apr 98 14:00:22 -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           Fri, 3 Apr 1998     Volume: 8 Number: 2244

Today's topics:
    Re: [SOURCE] rot90: New and better MIME format (Earl Hood)
    Re: [SOURCE] rot90: New and better MIME format (Earl Hood)
    Re: Checking saving Date for a file <rlcarro@escher.ppco.com>
        Help!! Perl install won't pass "make test"!! vidals@truepath.com
    Re: HELP, my PERL program isn't running... <mglenn@zbzoom.net>
    Re: HELP, my PERL program isn't running... <jdf@pobox.com>
    Re: Is there a "Newsgroup" for Newbies to Perl? smitty77@pacbell.net
        long complicated system() call doesn't want to work.... <jarviswalker@worldnet.att.net>
    Re: Looking for ANY Suggestions on parsing this line!! (David A. Black)
        Question on the dmake patch file <dblosse@uswest.com>
        SIGINT ? <prl2@lehigh.edu>
    Re: SIGINT ? <jdf@pobox.com>
    Re: structs (Gabor)
    Re: structs <jdf@pobox.com>
    Re: unpack vs. substr (was Re: Data Structure for Input (Jeffrey R. Drumm)
    Re: Weird Effects w/ "require" (Earl Hood)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Apr 1998 21:09:27 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: [SOURCE] rot90: New and better MIME format
Message-Id: <6g3j67$frb@news.service.uci.edu>

In article <6g2f9l$lup$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@perl.com> wrote:
>This is a multi-part message in MIME format.
> 
>------=_NextPart_000_0004_01BD5E9F.68E39C00
 ...
>------_NextPart_000_0004_01BD5E9F.68E39C00
-------^
If you post in MIME format, at lease get the boundaries right.

Sort of minimizes the effectiveness of the joke.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: 3 Apr 1998 21:15:32 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: [SOURCE] rot90: New and better MIME format
Message-Id: <6g3jhk$g38@news.service.uci.edu>

In article <86zpi3qdib.fsf@gwaihir.ethz.ch>,
Matthias Neeracher  <neeri@iis.ee.ethz.ch> wrote:
>tchrist@perl.com (Tom Christiansen) writes:
>
>> ------=_NextPart_000_0004_01BD5E9F.68E39C00
>> Content-Type: text/x-rot90; charset="iso-8859-1"
>
>I don't know too much about MIME, but shouldn't this be an Encoding: instead of
>a Content-Type?

No.  Content-Transfer-Encoding is designed to allow the transmission
of various types of data safely through mail gateways.  Although
rot90 is a "form of encoding" it is an application of textual
data.  It provides no use as a general data transfer encoding.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Fri, 03 Apr 1998 15:31:04 -0600
From: Bob Carroll <rlcarro@escher.ppco.com>
Subject: Re: Checking saving Date for a file
Message-Id: <35255518.217984FB@escher.ppco.com>

M Shakeel Qureshi wrote:

> Hello Everyone,
>
> Is there a way to check on which date a file was saved on a unix machine
> by using PERL ?

Use the stat() function.

>
>
> Regards,
> *Shakeel



--
Bob Carroll  (profs #3n4)
315 Information Center                       (918) 661-1569
Bartlesville, OK  74004                      (918) 662-2853 (fax)





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

Date: Fri, 03 Apr 1998 15:18:29 -0600
From: vidals@truepath.com
Subject: Help!! Perl install won't pass "make test"!!
Message-Id: <6g3jn4$mit$1@nnrp1.dejanews.com>

Hi,

I've been trying to install Perl 5.004_04 and cannot get the "make test" to
return "All tests successful". "Make minitest" passes all tests though.

The error I'm getting is beyond me. "Error 2" regarding posix.o. What does
that mean!!!!!!!????@#$#

Interestingly enough, I've successfully installed Perl before on this exact
same computer. the results of the Perl -V command are listed last:

Any help would be very much appreciated!

Gil

Making POSIX (dynamic)
make[1]: Entering directory `/usr/lib/perl5.004_04.failed.posix/ext/POSIX'
Makefile out-of-date with respect to ../../lib/Config.pm ../../config.h
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
 ../../miniperl "-I../../lib" "-I../../lib" Makefile.PL "INSTALLDIRS=perl"
"LIBPERL_A=libperl.a"
Note (probably harmless): No library found for -lposix
Note (probably harmless): No library found for -lcposix
Writing Makefile for POSIX
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command.  <==
false
make[1]: *** [Makefile] Error 1
make[1]: Leaving directory `/usr/lib/perl5.004_04.failed.posix/ext/POSIX'
make config failed, continuing anyway...
make[1]: Entering directory `/usr/lib/perl5.004_04.failed.posix/ext/POSIX'
Skip ../../lib/POSIX.pod (unchanged)
Skip ../../lib/POSIX.pm (unchanged)
 ../../miniperl -I../../lib -I../../lib ../../lib/ExtUtils/xsubpp -noprototypes
-typemap ../../lib/ExtUtils/typemap -typemap typemap POSIX.xs >POSIX.tc && mv
POSIX.tc POSIX.c
cc -c  -Dbool=char -DHAS_BOOL -I/usr/local/include -O2    -DVERSION=\"1.02\"
-DXS_VERSION=\"1.02\" -fpic -I../..  POSIX.c
POSIX.xs: In function `constant':
POSIX.xs:1714: `INT_MAX' undeclared (first use this function)
POSIX.xs:1714: (Each undeclared identifier is reported only once
POSIX.xs:1714: for each function it appears in.)
POSIX.xs: In function `XS_POSIX_localeconv':
POSIX.xs:2985: `CHAR_MAX' undeclared (first use this function)
make[1]: *** [POSIX.o] Error 1
make[1]: Leaving directory `/usr/lib/perl5.004_04.failed.posix/ext/POSIX'
make: *** [lib/auto/POSIX/POSIX.so] Error 2


Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=linux, osvers=2.0.30, archname=i586-linux
    uname='linux genesis 2.0.30 #3 fri nov 21 02:26:55 pst 1997 i586 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=n useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldb -lm -lc
    libc=/usr/lib/libc.a, so=none
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags=''
    cccdlflags='', lddlflags=''


Characteristics of this binary (from libperl):
  Built under linux
  Compiled at Jan  7 1998 09:37:52
  @INC:
    /usr/lib/perl5/i586-linux/5.00404
    /usr/lib/perl5
    /usr/lib/perl5/site_perl/i586-linux
    /usr/lib/perl5/site_perl
    .

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


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

Date: Fri, 3 Apr 1998 14:53:47 -0800
From: "Mike Glenn" <mglenn@zbzoom.net>
Subject: Re: HELP, my PERL program isn't running...
Message-Id: <6g3itp$9aq$1@news0-alterdial.uu.net>

This is a multi-part message in MIME format.

------=_NextPart_000_0070_01BD5F10.4E5BDAC0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The second will only work if first.pl is in your cgi-bin directory with =
the proper permissions. As to the first line you refered to and the way =
you said you directory structure is setup, I believe that you server is =
setup incorrectly, having access to /bin from your web server is a HUGE =
security risk. You should look at your access.conf and attempt to fix =
this. Then place all cgi scripts in the <HTTPD_SERVER_ROOT>/cgi-bin =
directory and access them with =
http://www.whatever.com/cgi-bin/<script_name> .

Also you will most likely get flamed by a bunch of (*** adjectives =
deleted ***) users from this group, about how you post is off topic, and =
how "they" don't have time to sort through all the "crap" that comes =
from new posters, like your self. IGNORE THEM!!! There are still a few =
people out here who will attempt to answer you questions.=20
    I find it funny how so many of them bitch and complain so much about =
newbies questions. If they would take the time they spend writing some =
of these letters, which are quite long, about how they don't have time =
for these kinda posts and use it to answer the questions, or NICELY =
point the users to the EXACT location of the answer ( ex: s/Check the =
Fucking FAQ's you stupid newbie/Look at the FAQ's at =
http://www.whatever.com/faq.html section 2.5.56 its all explained there/ =
).  Or if your time is SOOOOOO valued that you can't be bothered with =
questions, stop answering them all together. I think many of you have =
forgotten every  mothers first lesson to their kids: "If you don't have =
something nice to say, don't say anything at all!" That's it end of =
sermon, and my first and last post on the subject. Now can we get back =
to helping each other answer our Perl questions, Any Perl Question!

Mike Glenn
mglenn@if.your.so.busy.that.you.can't.remove.this.no.spam.don't.reply.to.=
me.cause.I.don't.have.time.or.the.patients.to.listen.to.your.complaining.=
about.us.newbies.and.our.inability.to.RTFM.zbzoom.net
    David Swain wrote in message <352539DA.702B0710@thetsn.com>...
    Hello, I am new but detirmined.  I need help!!!=20
    I am running a cgi-perl script on a RED HAT Linux server release 4.0 =
(colgate)=20
    KERNAL 2.0.28 on a i486=20
    with perl 5.003=20
    Ok, directory structure is like this=20

    /bin/first.pl=20
    /inetpub/intranet/first.html=20

    ...server admin said to put perl in bin directory as above, and html =
in intranet directory.=20
    perl is located in /usr/bin/perl=20

    the following is my code "copied letter for letter from teach =
yourself cgi in a week"=20

    CGI:=20
    #! /usr/bin/perl=20
    print "Content-type: text/html\n\n";=20

    print <<'ending_print_tag';=20
    <html>=20
    <head>=20
    <title>test 1 - CGI</title>=20
    <background=3D"#000000" text=3D"#FF0000">=20
    </head>=20
    </body>=20
    <h1>test 1 - CGI</h1>=20
    <em>hello</em>=20
    <hr noshade>=20
    this is boring=20
    </body>=20
    </html>=20
    ending_print_tag=20
     =20

    HTML:=20
    <HTML>=20
    <HEAD>=20
     <TITLE>test first cgi</TITLE>=20
    </HEAD>=20

    <BODY>=20
    <H2>Simple form</H2>=20
    <HR>=20
    <FORM METHOD=3D"GET" =
ACTION=3D"http://internal.thetsn.com/cgi-bin/first.pl">=20
    <INPUT TYPE=3D"submit">=20
    </form>=20
    <HR>=20

    </BODY>=20
    </HTML>=20

    Now, admin said NOT to use:=20
    <FORM METHOD=3D"GET" =
ACTION=3D"http://internal.thetsn.com/bin/first.pl">=20
    but to use:=20
    <FORM METHOD=3D"GET" =
ACTION=3D"http://internal.thetsn.com/cgi-bin/first.pl">=20

    on netscape, if I use the top one /bin/first.pl, then I get to view =
it in the browser when I push submit.  On the second one, I get this =
message:=20

    Server Error=20

    The server encountered an internal error or misconfiguration and was =
unable to complete your request.=20

    Please contact the server administrator, webmaster@omited.com and =
inform them of the time the error occurred, and anything=20
    you might have done that may have caused the error.=20

    Please help me...admin said I had to figure it out on my own, but =
I've spent 7 hours and I am getting nowhere.=20

    David Swain=20
    dswain@thetsn.com=20


------=_NextPart_000_0070_01BD5F10.4E5BDAC0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>The second will only work if =
first.pl is in your=20
cgi-bin directory with the proper permissions. As to the first line you =
refered=20
to and the way you said you directory structure is setup, I believe that =
you=20
server is setup incorrectly, having access to /bin from your web server =
is a=20
HUGE security risk. You should look at your access.conf and attempt to =
fix this.=20
Then place all cgi scripts in the &lt;HTTPD_SERVER_ROOT&gt;/cgi-bin =
directory=20
and access them with http://www.whatever.com/cgi-bin/&lt;script_name&gt; =

 .</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Also you will most likely get flamed by a bunch of =
(***=20
adjectives deleted ***) users from this group, about how you post is off =
topic,=20
and how &quot;they&quot; don't have time to sort through all the=20
&quot;crap&quot; that comes from new posters, like your self. IGNORE =
THEM!!!=20
There are still a few people out here who will attempt to answer you =
questions.=20
</FONT></DIV>
<DIV><FONT size=3D2><FONT color=3D#000000 face=3DArial=20
size=3D2></FONT></FONT>&nbsp;&nbsp;&nbsp; <FONT color=3D#000000 =
face=3D"Comic Sans MS"=20
size=3D2>I find it funny how so many of them bitch and complain so much =
about=20
newbies questions. If they would take the time they spend writing some =
of these=20
letters, which are quite long, about how they don't have time for these =
kinda=20
posts and use it to answer the questions, or NICELY point the users to =
the EXACT=20
location of the answer ( ex: s/Check the Fucking FAQ's you stupid =
newbie/Look at=20
the FAQ's at <A=20
href=3D"http://www.whatever.com/faq.html">http://www.whatever.com/faq.htm=
l</A>=20
section 2.5.56 its all explained there/ ).&nbsp; Or if your time is =
SOOOOOO=20
valued that you can't be bothered with questions, stop answering them =
all=20
together. I think many of you have forgotten every&nbsp; mothers first =
lesson to=20
their kids: &quot;If you don't have something nice to say, don't say =
anything at=20
all!&quot; That's it end of sermon, and my first and last post on the =
subject.=20
Now can we get back to helping each other answer our Perl questions, Any =
Perl=20
Question!</FONT></DIV>
<DIV><FONT color=3D#000000 face=3D"Comic Sans MS" =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Mike Glenn</FONT></DIV>
<DIV><FONT size=3D2><A=20
href=3D"mailto:mglenn@if.your.so.busy.that.you.can't.remove.this.no.spam.=
don't.reply.to.me.cause.I.don't.have.time.or.the.patients.to.listen.to.yo=
ur.complaining.about.us.newbies.and.our.inability.to.RTFM.zbzoom.net">mgl=
enn@if.your.so.busy.that.you.can't.remove.this.no.spam.don't.reply.to.me.=
cause.I.don't.have.time.or.the.patients.to.listen.to.your.complaining.abo=
ut.us.newbies.and.our.inability.to.RTFM.zbzoom.net</A></FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV>David Swain<DSWAIN@THETSN.COM> wrote in message &lt;<A=20
    =
href=3D"mailto:352539DA.702B0710@thetsn.com">352539DA.702B0710@thetsn.com=
</A>&gt;...</DIV>Hello,=20
    I am new but detirmined.&nbsp; I need help!!! <BR>I am running a =
cgi-perl=20
    script on a RED HAT Linux server release 4.0 (colgate) <BR>KERNAL =
2.0.28 on=20
    a i486 <BR>with perl 5.003=20
    <P>Ok, directory structure is like this=20
    <P>/bin/first.pl <BR>/inetpub/intranet/first.html=20
    <P>...server admin said to put perl in bin directory as above, and =
html in=20
    intranet directory. <BR>perl is located in /usr/bin/perl=20
    <P>the following is my code &quot;copied letter for letter from =
teach=20
    yourself cgi in a week&quot;=20
    <P>CGI: <BR>#! /usr/bin/perl <BR>print &quot;Content-type:=20
    text/html\n\n&quot;;=20
    <P>print &lt;&lt;'ending_print_tag'; <BR>&lt;html&gt; =
<BR>&lt;head&gt;=20
    <BR>&lt;title&gt;test 1 - CGI&lt;/title&gt;=20
    <BR>&lt;background=3D&quot;#000000&quot; =
text=3D&quot;#FF0000&quot;&gt;=20
    <BR>&lt;/head&gt; <BR>&lt;/body&gt; <BR>&lt;h1&gt;test 1 - =
CGI&lt;/h1&gt;=20
    <BR>&lt;em&gt;hello&lt;/em&gt; <BR>&lt;hr noshade&gt; <BR>this is =
boring=20
    <BR>&lt;/body&gt; <BR>&lt;/html&gt; <BR>ending_print_tag <BR>&nbsp;=20
    <P>HTML: <BR>&lt;HTML&gt; <BR>&lt;HEAD&gt; =
<BR>&nbsp;&lt;TITLE&gt;test first=20
    cgi&lt;/TITLE&gt; <BR>&lt;/HEAD&gt;=20
    <P>&lt;BODY&gt; <BR>&lt;H2&gt;Simple form&lt;/H2&gt; <BR>&lt;HR&gt;=20
    <BR>&lt;FORM METHOD=3D&quot;GET&quot; ACTION=3D&quot;<A=20
    =
href=3D"http://internal.thetsn.com/cgi-bin/first.pl">http://internal.thet=
sn.com/cgi-bin/first.pl</A>&quot;&gt;=20
    <BR>&lt;INPUT TYPE=3D&quot;submit&quot;&gt; <BR>&lt;/form&gt; =
<BR>&lt;HR&gt;=20
    <P>&lt;/BODY&gt; <BR>&lt;/HTML&gt;=20
    <P>Now, admin said NOT to use: <BR>&lt;FORM METHOD=3D&quot;GET&quot; =

    ACTION=3D&quot;<A=20
    =
href=3D"http://internal.thetsn.com/bin/first.pl">http://internal.thetsn.c=
om/bin/first.pl</A>&quot;&gt;=20
    <BR>but to use: <BR>&lt;FORM METHOD=3D&quot;GET&quot; =
ACTION=3D&quot;<A=20
    =
href=3D"http://internal.thetsn.com/cgi-bin/first.pl">http://internal.thet=
sn.com/cgi-bin/first.pl</A>&quot;&gt;=20
   =20
    <P>on netscape, if I use the top one /bin/first.pl, then I get to =
view it in=20
    the browser when I push submit.&nbsp; On the second one, I get this =
message:=20
   =20
    <P><FONT size=3D+2>Server Error</FONT>=20
    <P>The server encountered an internal error or misconfiguration and =
was=20
    unable to complete your request.=20
    <P>Please contact the server administrator, webmaster@omited.com and =
inform=20
    them of the time the error occurred, and anything <BR>you might have =
done=20
    that may have caused the error.=20
    <P>Please help me...admin said I had to figure it out on my own, but =
I've=20
    spent 7 hours and I am getting nowhere.=20
    <P>David Swain <BR>dswain@thetsn.com </P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0070_01BD5F10.4E5BDAC0--



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

Date: 03 Apr 1998 16:25:14 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: David Swain <dswain@thetsn.com>
Subject: Re: HELP, my PERL program isn't running...
Message-Id: <afa2simd.fsf@mailhost.panix.com>

         [posted and mailed to cited author] 

David, I have a few comments for you that I hope you'll take to heart.

David Swain <dswain@thetsn.com> writes:
> --------------D5E2A61BFB4C5AED17EFB15D
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

First of all, it's considered contrary to etiquette in this newsgroup
to post using anything other than plaintext.  MIME is right out.  You
may not be aware that your newsreader is posting in MIME and including
a second copy of your message in HTML (a hanging offense), but it is.
Please find the setting in your reader's preferences and change it to
post only in text.

> Hello, I am new but detirmined.  I need help!!!

Your determination will come in handy, because you have perhaps a
longer road ahead of you than you might have hoped!

> with perl 5.003

That is an old version of perl.  There are many reasons to upgrade to
the newest.  You'll find it and many other things of value at

   http://www.perl.com/

> Ok, directory structure is like this
> 
> /bin/first.pl
> /inetpub/intranet/first.html

Issues of website deployment (including what directories things go in)
are outside of the scope of this newsgroup, which exists for the
discussion of the Perl language, and that alone.

> the following is my code "copied letter for letter from teach yourself
> cgi in a week"

I myself have not examined that book, but others have characterized it
not too favorably.  Judging from the example you provide, I can see why.

> Server Error

There are roughly a zillion possible reasons for this error.  I won't
even begin to go into it, because someone else already has done so.

   http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html

(Keep in mind that I didn't name it.)

That book has misled you: There is no shortcut to learning the many
things you have to know in order to use Perl as a scripting language
for *any* purpose, including CGI.  You really must learn Perl in order
to use it.  I therefore recommend that you buy the O'Reilly book
_Learning Perl_, and that you read it from cover to cover, doing all
of the exercises.  You'll also need to learn about how Unix works,
which is a complicated thing, no question.  You'll also have to learn
the specifics of whatever web server you're running on your RedHat
box.  I sincerely hope this helps.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
Who obviously is not all that busy today.


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

Date: 3 Apr 1998 12:31:06 -0800
From: smitty77@pacbell.net
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6g3gua$8a8@co-op.newsguy.com>

In article <fl_aggie-0304981449540001@aggie.coaps.fsu.edu>,
fl_aggie@thepentagon.com says...
>
>In article <6g34ak$ah2@co-op.newsguy.com>, smitty77@pacbell.net wrote:
>
>+ In article <fl_aggie-0304980949250001@aggie.coaps.fsu.edu>,
>+ fl_aggie@thepentagon.com says...
>
>And that's the point: its no sin to be a newbie. Its no sin to be
>confused. It is a sin, however, to bug someone without attempting
>to do your homework.

Ok, James, for the sake of getting this resolved, I'll offer one last post and
then be done with it (at least between you and I).  I see your point, I really
do.  And I understand that if the same person keeps coming back expecting to be
spoon fed answers that they could simply find easily in the FAQ, that person
should probably be dealt with a little more harshly than the average novice. 
Fair enough.

For the average novice, who may be asking for the first time or simply might
need and expect more than "go look it up in the FAQ", I offer this.  If someone
came up to me at work and asked a question which I knew could easily be answered
in a book that was sitting on a shelf, I wouldn't tell that person "your answer
is in that book over there" and then go back to what I was doing.  I would
probably go get the book, find the place in the book where the information was
and point it out to them, perhaps even going so far as to explain the answer
over and above what the book said.  That way, I've not only told them that a
book existed that might help them, but I showed them where the book was and
showed them where in the book the answer was.  Common courtesy.  I don't think
that's too much to ask.  Especially in here, since you can simply not respond at
all if you don't want to be bothered with these nuisance posts.

I hope that we understand each other.  I certainly don't advocate spoon feeding
someone who takes advantage of it, but at the same time, I understand what it's
like to be the novice who's simply trying to solve an immediate problem.

Regards,

Dave


>James
>
>-- 
>Consulting Minister for Consultants, DNRC
>The Bill of Rights is paid in Responsibilities - Jean McGuire
>To cure your perl CGI problems, please look at:
><url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Fri, 3 Apr 1998 16:16:14 -0500
From: "Human Resource Management" <jarviswalker@worldnet.att.net>
Subject: long complicated system() call doesn't want to work....
Message-Id: <6g3juj$m76@bgtnsc03.worldnet.att.net>

I'm trying to use metasend in batch mode to email a file that has been
uploaded to a particular address.  I've got a copy of metasend in my cgi-bin
dir and it has world-execute permissions.  I'm sending it like this:

system("metasend -b -f \"$oufile\" -F \"website\" -i
\"application/msword\" -m \"application/msword\" -t \"$email\" -s
\"$outfile\" ");

The syntax above works great from the command line, but when I try to submit
the upload over httpd, it won't mail the file.

Any ideas?




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

Date: Fri,  3 Apr 1998 16:29:46 EST
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: Looking for ANY Suggestions on parsing this line!!
Message-Id: <6g3kca$cis$1@earth.superlink.net>

Hello -

colink@latticesemi.com (Colin Kuskie) writes:

>A much easier approach would be to try any of the following:

>1) read the perl FAQ list, available at:  YOUR COMPUTER
>  (personally, I would read perlfaq4 and grep/find for
>   Comma-separated files)

>2) Try looking at CPAN:

>Text::
>::CSV          adpO  Manipulate comma-separated value strings     ALANCITT

>This exercise took me about 90 seconds, although I am somewhat familiar
>with the FAQ and the module list because I get to answer so many
>questions from people who either aren't aware that it exists or don't
>bother to take the time.

I'd be interested in seeing the code you wrote in those 90 seconds.
I can't find anything in the FAQ about comma-separated records which
include unquoted American-style thousands separators, nor does Text::CSV
handle those.  (One of the author's "Caveats": "A field within CSV must 
be surrounded by double-quotes to contain a comma.")

Mind you, whoever came up with this format:

"MGORDON",$1,860.65,"STAR","$539.35","$1,139.35","$1,739.35",0,$1,860.65

was asking for trouble.  I wouldn't expect the parsing of such a line
to be addressed in a FAQ (and indeed it seems not to be), nor should
the implementor of a CSV-handing module be expected to anticipate it.
The original poster's question seems a perfectly reasonable one,
given a misbegotten and unwieldy format with which, I gather, he
was stuck.

Repairing the lines with something like

s/(^|,)(\$(\d+)(,\d{3})*\.\d{2})/$1"$2"/g;

would make the records available to Friedl- and/or Citterman-based processing.


David Black
dblack@saturn.superlink.net


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

Date: Fri, 03 Apr 1998 14:41:55 -0700
From: David Blosser <dblosse@uswest.com>
Subject: Question on the dmake patch file
Message-Id: <352557A3.72A4A80@uswest.com>

Hi,

        I had a question about the Dmake patch that is shown in the
Install directory (filename =
        dmake-4.1-win32.patch), for installing in the Win32
Environment.  Should the patch file
        exist in the same directory, "before" we perform the make
(dmake) command?  Is there some
        process we need to perform, or is it simply a matter of having
this file around?


Thanks for your assistance,
Dave (dblosse@uswest.com)



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

Date: Fri, 3 Apr 1998 15:41:44 -0500
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: SIGINT ?
Message-Id: <6g3hib$1sf0@fidoii.cc.Lehigh.EDU>

In the following test script, I try to catch an interrupt signal and put
myself back in main().  It works only once.  Then, if I issue another
interrupt signal, ^C is written to the console and no signal is even
recognized!  Why?  What can I do so that ^C will always send me back to
main()?

________________________
#!/usr/local/bin/perl -w
use diagnostics;
use strict;

sub int_handler {
    print "Handled!\n";
    main();
}
$SIG{"INT"} = \&int_handler;

sub main {
    while (1) {
        print "In main!\n";
        my $x = <STDIN>;
    }
}

main();
__________________________

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Phil R Lawrence               phone: 610-758-3051
Programmer / Analyst      e-mail: prl2@lehigh.edu
194 Lehigh University Computing Center
E.W. Fairchild - Martindale, Bldg. 8B
Bethlehem, PA  18018
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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

Date: 03 Apr 1998 16:39:51 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: SIGINT ?
Message-Id: <4t0ashy0.fsf@mailhost.panix.com>

"Phil R Lawrence" <prl2@lehigh.edu> writes:

> In the following test script, I try to catch an interrupt signal and put
> myself back in main().  It works only once.  Then, if I issue another
> interrupt signal, ^C is written to the console and no signal is even
> recognized!  Why?

> sub int_handler {
>     print "Handled!\n";
>     main();
> }

The perlipc doc suggests that on SYSVish systems (and therefore in
the minds of all portability-minded scripters) you'll need to
reinstall the signal handler, e.g.,

   sub HANDLE_SIGINT {
      print "Ouch, that smarts.\n";
      $SIG{INT} = \&HANDLE_SIGINT;
   }

Read perlipc.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 3 Apr 1998 21:11:17 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: structs
Message-Id: <slrn6iak8m.kmq.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Brian <brian@structure.student.umd.edu> wrote :
# How does one represent structs in perl?
# I heard there's some way to do it.

use a hash

struct foo {
    int len;
    char data[128];
    int more_data[32];
};

%foo = (len => 4,data => 'feel',more_data => [1,5,6]);
$foo{data} = 'hello';
$foo{len} = length $foo{data};
$foo{more_data}->[0] = 7;


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

Date: 03 Apr 1998 16:32:12 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Brian <brian@structure.student.umd.edu>
Subject: Re: structs
Message-Id: <7m56siar.fsf@mailhost.panix.com>

       [posted and mailed to cited author]

Brian <brian@structure.student.umd.edu> writes:

> How does one represent structs in perl?
> I heard there's some way to do it.

There are indeed many ways to create arbitrarily complex data
structures in Perl, especially since hard references were added in
version 5.  You'll want to buy the book _Learning Perl_, which will
teach you the fundamentals of our beloved scripting language, and will
start you on the road towards thinking Perlishly.  Also, go ahead and
download the latest version of perl.  This will provide you with a way
to do the exercises in the book, and (equally important) with the
complete docs for perl, which are extensive and clear.  Your
particular question, for example, is answered at great length in the
documents perldata, perllol, perldsc, and perlref.  I hope this helps.

   http://www.perl.com

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: Fri, 03 Apr 1998 21:01:47 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: unpack vs. substr (was Re: Data Structure for Input File)
Message-Id: <352549d1.187009775@news.mmc.org>

On Fri, 03 Apr 1998 18:46:54 GMT, Clinton Bodine <Clinton.Bodine@mci.com>
wrote:

>Jeffrey R. Drumm wrote:
>
>> 
>> The ones I've dealt with mostly are padded, but I see your point. 
>> Thanks for bringing that up.
>
>Unfortunately, I don't.  Could someone quickly clue me in?

If you've got to strip the nulls out of the variables you've extracted with
substr(), there's an extra, somewhat expensive operation required (a tr/\0//d,
for example).

A quick benchmark on the previously posted Sbstr2Sclr example with the required
null stripping included added enough processing time to the routine as to
actually negate much of substr()'s advantage (although the substr/tr combo was
still a bit faster than an unpack using the 'a' template character).

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: 3 Apr 1998 20:57:51 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Weird Effects w/ "require"
Message-Id: <6g3igf$fj2@news.service.uci.edu>

In article <3525A3B8.CBD9FC94@ibm.net>,
Jerome Bradenbaugh  <bradenb@ibm.net> wrote:
>
>I've writen an application that utilizes subroutines from several
>libraries I've written, and subsequently "require"d into the script. Two
>of these libraries "require" another (the same) library. For some
>reason, if the library is "require"d more than once, the original
>script, which contains the following read function:
>
>read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
>fails to read form data passed in. If I only "require" the library once,
>all is well. The workaround is self explanatory, but I'd like to know
>why.

Perl remembers what you have "require"d.  Hence if you try to
require the same file/module you have required before, it acts
as a noop.  There are two approaches to your problem:

    o   Do not rely on require as a way of executing a set of
	statements like a subroutine call.  Have the file you require
	define a subroutine that contains the statements you want
	executed, and call the subroutine after the require.  Example:

	    require "file.pl";
	    required_subroutine();


    o	Explicitly delete the entry in the %INC hash to force
	Perl to redo the require.  Example:

	    delete $INC{'file.pl'};
	    require "file.pl";


You may also want to look at "use" if dealing with packages of
different namespaces.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

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

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