[7973] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1598 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 7 21:32:35 1998

Date: Wed, 7 Jan 98 18:00:23 -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           Wed, 7 Jan 1998     Volume: 8 Number: 1598

Today's topics:
     Re: arrays as parameters in subroutines <ajayc@xilinx.com>
     Blank rows, Data is missing. <cr@mayers.de>
     Re: CGI Bin Locked????? HAY-ELP!! <ric@megsinet.net>
     Re: CGI y comandos SSI (Martien Verbruggen)
     Re: CgiWrap - perl: can't map file error <rootbeer@teleport.com>
     Re: file glob restrictions?! (Martien Verbruggen)
     Re: HELP ME How I can to compare two date 01/12/1997>=0 <rootbeer@teleport.com>
     Re: Help on C++ extension <cxiong@internetMCI.com>
     How do I read input from a serial port with perl on lin (Allen Bolderoff)
     Re: How do I read input from a serial port with perl on (Martien Verbruggen)
     Re: how I can extract n character in x position on a st (John Moreno)
     Re: invalid IO handle <rootbeer@teleport.com>
     Re: Markees (Martien Verbruggen)
     Re: Markees (brian d foy)
     Re: Newbie: Problem with file handling under WindozeNT  <rootbeer@teleport.com>
     Perl poetry <amallan@enterprise.net>
     Re: perldsc q: complex data from file <rootbeer@teleport.com>
     Re: Q: search matching "(" and ")" (Craig Berry)
     regex to escape {, } except in TeX commands (Michael Friendly)
     Re: sending email (Net::SMTP).. problem <Jacqui.Caren@ig.co.uk>
     Re: sending email (Net::SMTP).. problem <Jacqui.Caren@ig.co.uk>
     Re: Something equivalent to open("|foo|")? <merlyn@stonehenge.com>
     suid unix help (WebService)
     Re: Testing for valid RegExps? (Greg Bacon)
     Re: Testing for valid RegExps? (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Text->HTML script (Raz Uri )
     Re: Trimming blanks (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: Unix perl shell ??? (Martien Verbruggen)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 07 Jan 1998 15:35:35 -0800
From: ajay chankramath <ajayc@xilinx.com>
To: Brian <brian@birdsong.cudenver.edu>
Subject: Re: arrays as parameters in subroutines
Message-Id: <34B41147.D5708EBB@xilinx.com>

Brian wrote:

> I'm trying to send a sub two arrays, but only the first array's values
>
> are being
> read.
>
> Here's the code:
> ($update_statement, $insert_statement, $error_statement) =
> &create_stmt($table_name, @values, @column_info);
>
> &create_stmt gets the values for @values but @column_info is empty.
>
> Any ideas and/or suggestions would be greatly appreciated!
> Brian


try passing references...

($a1, $a2, $a3, $a4) = &create_stmt($b1, \@b2,  \@b3);

sub create_stmt
{
my ($b1, $b2, $b3) = @_;

print "b1 is $b1\nb2 is @$b2\nb3 is @$b3\n";
}



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

Date: Thu, 08 Jan 1998 14:16:16 +1300
From: Christian Roth <cr@mayers.de>
Subject: Blank rows, Data is missing.
Message-Id: <34B428E0.E0A4D9E5@mayers.de>

Hi!

I got a little bit further.
Now I am able to read out of my database! BUT all
I get out of it are blank rows. I inserted a $count to count my rows.
The number at the end is correct and matches the number of records in
the database. But my table is filled with blank rows. NO DATA? WHERE IS
THE DATA?

Thanks for all of your help

Christian

Here my code:

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";

use Win32::ODBC;
$db = new Win32::ODBC("members");

if (!($db = new Win32::ODBC($db))){
    print "Error connecting to $db.\n";
    print "Error: ".Win32::ODBC::Error()."\n";
    exit;
}

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs) {
        ($name, $value) = split(/=/, $pair);
        #Split the pair up into individual variables.
        $name =~ tr/+/ /;
        $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $FORM{$name} = $value;
    }

$action = $FORM{'action'};
$keyword = $FORM{'keyword'};
$search = $FORM{'search'};

if ($action eq "showall") { &showall; }
        else { &search; }

sub showall {
    $rc = $db->sql("SELECT DISTINCT * FROM hera, name order by
company");

    print "<html><head><title>All Entries</title></head>\n";
    print "<body>\n";
    print "<table border=0 bgcolor=#9C9C9C>\n";
    print
"<tr><td><b>Company</b></td><td><b>Postaddr</b></td><td><b>Locality</b></td><td><b>Town</b></td>
<td><b>Phone</b></td><td><b>Fax</b></td><td><b>Mobile</b></td><td><b>Title</b></td><td><b>Name</b></td>
<td><b>First Name</b></td><td><b>Heracode</b></td></tr>\n";

    $count = 0;

    while ($db->fetchrow) {
            $company   = $db->data(COMPANY);
            $postaddr  = $db->data(POSTADDR);
            $locality  = $db->data(LOCALITY);
            $town      = $db->data(TOWN);
            $phone     = $db->data(PHONE);
            $fax       = $db->data(FAX);
            $mobile    = $db->data(MOBILE);
            $title     = $db->data(TITLE);
            $name      = $db->data(NAME);
            $fname     = $db->data(FIRST NANE);
            $heracode  = $db->data(HERACODE);

            $count = $count + 1;

            print
"<tr><td>$company</td><td>$postaddr</td><td>$locality</td><td>$town</td>
<td>$phone</td><td>$fax</td><td>$mobile</td><td>$title</td><td>$name></td><td>$fname</td>
<td>$heracode</td><tr>\n";
    }


print "</table>\n";

print "No of Records: $count\n";

print "</body></html>\n";

}

$db->Close();

Christian

http://www.mayers.de/~cr

4 Olive Cres
Papatoetoe, Auckland
New Zealand

Tel.: +64-9-278 4810
Fax bei HERA: +64-9-262 2856


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

Date: Wed, 07 Jan 1998 17:07:49 -0600
From: Ricky <ric@megsinet.net>
To: sean@dcdX.net
Subject: Re: CGI Bin Locked????? HAY-ELP!!
Message-Id: <34B40AC5.EFE2536B@megsinet.net>

Sean O'Dwyer wrote:

> Thanks folks, for the replies. I don't have a shell account so I can't
> put
> your suggestions into practice, but I'm learning all the same. (I'm
> working on a Mac and using Anarchie to xfer files to my www and cgi
> dirs
> on a virtual server.)
>
> Sean

   hey Sean.  i'm a newbie as well and i can relate to your dilemma.  i
encountered the same problem.  although i knew the chmod method to
changing the permission, i didn't have access to the command line and
being a newbie, i didn't know any other way.  so i slept on it and tried
to figure it out the next day.  i use an ftp program called CuteFTP.  i
resorted to looking at every feature of the program and found what i was
looking for.  i don't know what Anarchie is like but i found the answer
under a menu called "commands" right up there with file edit etc.  one
of the options was "change file attributes".  i clicked and lo, there it
was.  read, write, execute.  you may already know this, but not assuming
anything i'll explain what the permission codes are.

you have 3 digits, lets call them  ABC for now.  digit A represents the
owner (you).  digit B a group and C the world (public).  read=4 write=2
execute=1 okay.  so, to make the script readable by everyone (owner,
group and world) the 3 digit permission code would be 444.  to make it
readable only by the A and B, the permission code would be 440.  now,
someone mentioned that it would usually be 705.  this means that the
owner(A) has permission to read, write and execute (4+2+1=7), the group
(B) doesn't have permission to either read, write or execute ( 0 ), and
the public (C) has permission to read and execute ( 4+1=5 ) but not
write. hence, ABC = 705.  if you find the option on your ftp program,
with this information, it should be as easy as pie.

well, i for one sometimes need things explained in great detail when i'm
new to them.  unfortunately, not many people who post answers go to that
extent for newbies.  not to say that they provide bad answers.  this
newsgroup is great and i learn from everyone in here, but sometimes
assuming someone knows what chmod means is not sufficient.  then again,
i may be insulting your intelligence.  but i just mean well.  so on that
note, i hope this sheds light on your situation.  happy programming!

ricky



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

Date: 7 Jan 1998 22:59:25 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CGI y comandos SSI
Message-Id: <6911cd$er0$3@comdyn.comdyn.com.au>

In article <34B3EEE8.3D23477D@megsinet.net>,
	Ricky <ric@megsinet.net> writes:
> 
> --------------0A83274018467CE7E6E79D1F
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: 8bit

Please don't post multipart MIME stuff. Just post plain text.

> The translation to this question is in bold.  If anyone has any

It's not. Part of the message was enclosed in <B> </B> tags,
which my news reader, which was designed to read news and not display
html, doesn't recognise as anything else but distracting ascii
characters.

> To make a CGI script execute automatically when a WEB page is loaded,
> you would do it via the SSI :

[SNIPPED a load of CGI and SSI specific questions]
[SNIPPED a HTML copy of this post]

This all is about CGI and SSI. You should ask these questions on a
news group that is devoted to discussions about these issues.
comp.lang.perl.misc is for discussions of the perl language, not CGI
or SSI.

Try one of the comp.infosystems.www.* groups.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: Wed, 7 Jan 1998 17:18:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Piotr Klaban <makler@man.torun.pl>
Subject: Re: CgiWrap - perl: can't map file error
Message-Id: <Pine.GSO.3.96.980107171745.28668D-100000@user2.teleport.com>

On 6 Jan 1998, Piotr Klaban wrote:

> Subject: CgiWrap - perl: can't map file error

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. Hope this helps!

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 7 Jan 1998 22:54:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: file glob restrictions?!
Message-Id: <691135$er0$2@comdyn.comdyn.com.au>

In article <Pine.OSF.3.95.980107135322.10991C-100000@ermine.ox.ac.uk>,
	Jakob Fix <jakob@ermine.ox.ac.uk> writes:

> which are about 200 or so, it works.  Is there, after all, a size limit
> in Perl, or is this just my ignorance and I am doing sth wrong?

>From the perlop man page:

    chmod 0644, <*.c>;

Because globbing invokes a shell, it's often faster to call readdir
yourself and do your own grep on the filenames. Furthermore, due to
its current implementation of using a shell, the glob routine may get
``Arg list too long'' errors (unless you've installed tcsh as
/bin/csh).

In other words: You're running into limitations of your shell.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.       | accept as reality - Calvin
NSW, Australia                      | 


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

Date: Wed, 7 Jan 1998 17:29:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jose Carrasco Clemente <jcc@sodefesa.es>
Subject: Re: HELP ME How I can to compare two date 01/12/1997>=01/01/1997
Message-Id: <Pine.GSO.3.96.980107172905.28668H-100000@user2.teleport.com>

On Mon, 5 Jan 1998, Jose Carrasco Clemente wrote:

> Help me i can not to compare two date.

Use one of the Date modules from CPAN. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 08 Jan 1998 01:36:03 GMT
From: Chuyu Xiong <cxiong@internetMCI.com>
Subject: Re: Help on C++ extension
Message-Id: <34B42E43.2A9C@internetMCI.com>

Yesterday, I posted the following. Today, I think I found a solution.
It is quite simpler than I thought. Just recompile perl with C++
compiler (to do this, I have to do it manually, I think for next
version, the config script should ask a question on which compiler
for main program, which will be much easier). Then, everything works
fine. I just name the main perl to another name, perlcpp.
 
Chuyu Xiong wrote:
> 
> I just posted this to comp.lang.perl. I forgot comp.lang.perl.misc.
> So, here goes.
> >
> > We have a large C++ library. I want to build some perl objects
> > to drive those C++ objects. Perl has XS utilities, which is
> > helpful. But, if in the library there are some static C++ classes,
> > then, I can noly get segment fault.
> >
> > I think this is a quite foundamental problem: since perl is compiled
> > by C compiler, it has no way to handle static C++ classes, so do any
> > extensions of perl. Maybe I am wrong. So, how can I get around this
> > problem? Of course, I can consider to get rid of all static C++ classes,
> > which is very hard (cout, for example, needs static classes), or, I
> > can consider to compile perl by using CC (can I do it?). These are
> > not good solutions. Any help?
> >
> > Please email me a copy of your post to cxiong@internetmci.com.
> > Thanks a lot.


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

Date: 8 Jan 98 00:59:44 GMT
From: allen@harper.gist.net.au (Allen Bolderoff)
Subject: How do I read input from a serial port with perl on linux?
Message-Id: <34b42500.0@proxy.gist.net.au>

(please include my email in the reply as my newsfeed is poor)
2 Questions  

first:

I have to get a perl script to interact with a device connected to a serial port
of a linux machine.

This device outputs a display menu, that I need to select an Item from, and then
read the information from the subseqent screen of information. This screen of
info updates every 30 seconds or so. The menu only needs to be parsed if a reset
happens or something on the external device.

At the moment we are accessing this external unit using minicom, and reading the
information by sight.

We wish to read this by a perl script chatting directly to the serial port and
reading the required information and placing it on a web page.

any help/ideas/code would be greatly appreciated

Second: - is there a general perl mailling list for this kind of question?


TIA


--
Allen Bolderoff
allen@gist.net.au


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

Date: 8 Jan 1998 01:25:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
To: allen@harper.gist.net.au (Allen Bolderoff)
Subject: Re: How do I read input from a serial port with perl on linux?
Message-Id: <6919th$fqf$2@comdyn.comdyn.com.au>

[Posted and Mailed]

In article <34b42500.0@proxy.gist.net.au>,
	allen@harper.gist.net.au (Allen Bolderoff) writes:

> We wish to read this by a perl script chatting directly to the
> serial port and reading the required information and placing it on a
> web page.

If there is such a thing, you can find it on CPAN, most likely:

http://www.perl.com/CPAN
http://www.perl.com/CPAN/modules/00modlist.long.html

> Second: - is there a general perl mailling list for this kind of
> question?

If you have a look at 

http://www.perl.com/CPAN/authors/00whois.html

and go to the bottom of the page, you'll find a list of mailing lists.
This group is not a bad place to ask questions like this, though.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Wed, 7 Jan 1998 19:24:58 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: how I can extract n character in x position on a string?
Message-Id: <1d2hipx.6v8cwi1nmrvgiN@roxboro-170.interpath.net>

[Posted and Mailed]

Claudio Villa Santa <claudio@crpweb.com> wrote:

> Messaggio a piy sezioni in formato MIME.
> 
> ------=_NextPart_000_0029_01BD1AD0.002B4F40

Don't do this.

If you want a answer to a question, the first thing NOT to do is annoy
the people who will be answering.  Mime in discussion groups is
annoying.

Ask the question again without the MIME junk.

-- 
John Moreno


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

Date: Wed, 7 Jan 1998 17:42:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Buxx <buxx@buxx.com>
Subject: Re: invalid IO handle
Message-Id: <Pine.GSO.3.96.980107174204.28668K-100000@user2.teleport.com>

On Tue, 6 Jan 1998, Buxx wrote:

> Upgraded to slakware k ver 2.0.29 and now my FTP module gives a 
> invalid IO handle when I try to execute in a previouly working  
> script.  

Probably need to recompile Perl for the different libraries you now have
(or something like that). Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 7 Jan 1998 22:46:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Markees
Message-Id: <6910kl$er0$1@comdyn.comdyn.com.au>

In article <34B38708.5515@ameritech.net>,
	Scott Vetter <svetter@ameritech.net> writes:
> Is there a Perl program out there that will put out a markee to the
> netscape/I.E. browser?  This markee would be shown on the browser line
> that shows "Document: Done" in Netscape.

This cannot be done directly with perl. You might want to try this
with javascript. Check one of the newsgroups devoted to javascript,
and maybe www.gamelan.com.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Wed, 07 Jan 1998 21:00:57 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Markees
Message-Id: <comdog-ya02408000R0701982100570001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6910kl$er0$1@comdyn.comdyn.com.au>, mgjv@comdyn.com.au (Martien Verbruggen) posted:

>In article <34B38708.5515@ameritech.net>,
>        Scott Vetter <svetter@ameritech.net> writes:
>> Is there a Perl program out there that will put out a markee to the
>> netscape/I.E. browser?  This markee would be shown on the browser line
>> that shows "Document: Done" in Netscape.
>
>This cannot be done directly with perl. You might want to try this
>with javascript. Check one of the newsgroups devoted to javascript,
>and maybe www.gamelan.com.

perl can produce the javascript and the page in which it lives though :)

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 7 Jan 1998 17:26:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Richard Locke <Richard.Locke@sni.nl>
Subject: Re: Newbie: Problem with file handling under WindozeNT and UNIX
Message-Id: <Pine.GSO.3.96.980107172148.28668F-100000@user2.teleport.com>

On Wed, 7 Jan 1998, Richard Locke wrote:

> I forgot to mention what the problem is. The problem occurs at this line
> 
> "         } elsif (($words{$somename} || "groucho") eq $someguess) {"
> 
> Under I run this under NT and use the name of 'fred' and enter the
> correct secret word of 'camel', everything is fine. Under UNIX, when I
> enter 'fred' and the secret word 'camel' I get the 'Wrong answer' string
> and can only enter 'groucho' (which is the default secret word for names
> other than richard, fred or barney) as the secret word.

Could there be some whitespace characters in the file along with the
secret words? That would prevent it from matching, but might be hard to
see when you print out the data. (And if you've used a non-text transfer
mode between the NT machine and Unix, that would cause it.)

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 07 Jan 1998 22:57:16 +0000
From: Richard Allan <amallan@enterprise.net>
Subject: Perl poetry
Message-Id: <34B4084C.CFB7064B@enterprise.net>

Does anyone have any Perl poems (like those in the Programming Perl
book) as I am looking for some to do a review on for an English folio at
school.

Richard A

Richard.A@Torguish.com



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

Date: Wed, 7 Jan 1998 17:27:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: eric <mehu@deepblue.chubrock.com>
Subject: Re: perldsc q: complex data from file
Message-Id: <Pine.GSO.3.96.980107172701.28668G-100000@user2.teleport.com>

On 6 Jan 1998, eric wrote:

> open(FILE,$tv_db);

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 7 Jan 1998 23:54:49 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Q: search matching "(" and ")"
Message-Id: <6914k9$evm$1@marina.cinenet.net>

Eli the Bearded (*@qz.to) wrote:
: Craig Berry <cberry@cinenet.net> wrote:
: > Ilya Zakharevich (ilya@math.ohio-state.edu) wrote:
: > : Yes you can with the latest RE engine, one of the tests in t/op/pat.t
: > : is doing exactly this.  But this is still not "easily" - though very
: > : quick.  To make it "easy" several other changes to RE engine should
: > : materialize first.
: >
: > Wow...this rather blows my mind.  I'd always thought that "balanced pair
: > matching"  like this was beyond the scope of regexes by definition.  Can
: 
: It is. Beyond the scope of mathematically pure regular expressions, that
: is. Pure REs don't have back references either.

Ah, true enough...I typed ahead of my brain (hate it when that happens).  
But I'd meant to make the assertion that *Perl* regexes couldn't do 
balanced pair matching.

: > you provide an example regex, useable under 5.004, which will match a
: > sequence of characters starting with '(' and ending with the balancing
: > ')', for arbitrarily nested parens? 
: 
: It is not in the "release" versions of 5.004, but this will be coming to
: a later relase version. For now you can use 5.004_55. There is a sample
: included in the test scripts for that. (I believe Ilya posted it a
: while ago too, check DejaNews.)

OK, I feel better, if it's been impossible until now (I'd hate to think I 
missed something that important).  I'll dig around DejaNews, perhaps grab 
_55, and prepare to be impressed. :)

---------------------------------------------------------------------
   |   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: 7 Jan 1998 23:01:22 GMT
From: friendly@hotspur.psych.yorku.ca (Michael Friendly)
Subject: regex to escape {, } except in TeX commands
Message-Id: <6911g2$dqv$1@sunburst.ccs.yorku.ca>

I need a regex to escape braces, {}, translating them to \{, \},
except when they are part of a TeX command like \texttt{stuff}.

Can anyone help?

--
Michael Friendly     Internet: friendly@hotspur.psych.yorku.ca (NeXTmail OK)
Psychology Dept
York University      Voice: 416 736-5118  Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA


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

Date: Wed, 7 Jan 1998 11:07:07 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <EMEuvy.7G0@ig.co.uk>

In article comp.lang.perl.misc:<34B2E841.4D5F0C75@spam.spam>, catty <spam@spam.spam> writes:
>Jacqui Caren wrote:
>
>> So, catty - unless your can explain just what you mean, please
>> take your flame bait and ...
>> 
>> A happy new year to all - except catty and other spam artists :-)
>
>Flamer was your friend Graham. Try re-reading the thread.
>My code works well, and no one has filtered my mail just because
>it did not go through a relay site, as Graham wishes it would.
>It is just a silly, retrograde opinion of his.

Funny having re-read his comments I cannot see where he says
not to use Net::SMTP to send mail to him. 

>Email spammers usually relay and falsify headers, but they
>cannot prevent the last "received" line from being accurate.

Bzzzt!!!
The MTA is responsible for this and some MTA accept HELO
unverified so in some cases (usually edu's :-[ ) you could
generate an untracable message.

>That isn't what I filter by; I filter those that have obviously
>false header lines or lack the usual to/from/subject.

Date is supposed to be mandatory and our mailgate (PP) has a
strict option which requires a valid Date: header. I cannot
even enable this as many emails have broken or missing Date:
headers. to/from/subject is a good start but does not cover
all spam.

Some people such as Perl's TomC and myself block whole domains.
This sometimes leads to lost valid email - Tom blocked a domain
used by one of the p5p team not that long ago :-)

>It is more convenient for me to send directly.
>I like seeing the results immediately.
>As a last resort my code would relay through my ISP,
>but that hasn't happened yet. My code is not suited
>to a mailing list because I rarely even cc anybody.
>I follow the RFC, it works, I'm happy with it.

If you have read the RFC (and understand it) then
your message will get through to Graham. I doubt he
rejects email that is consistent.  Generating consistent
mail via SMTP is not hard - I used to do this via telnet
for a good few years when testing a 822<->X.400 gateway.
I just wish his Net::SMTP and perl were available in
those days...

>And no, I don't wish to reveal my email address on usenet,

That is your choice, I personally detest this practice
- if you have something to say I believe you should put
your name to it.  I hope you do not extend this practise
to email...

>because I hate spam and spammers.

Then expect to be blocked by more and more people if you
extend this practise to email.

>Also I hate flamers.

Then why do it. I believ in constrictive criticism and
sometimes get carried away but 

>Shove your smiley.

Ouch - that stings! :-)

-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: Wed, 7 Jan 1998 10:40:04 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <EMEtMw.7Do@ig.co.uk>

newsgroups trimmed to those locally valid.

In article comp.lang.perl.misc:<qz$9801061633@qz.little-neck.ny.us>, Eli the Bearded <*@qz.to> writes:
>Jacqui Caren  <Jacqui.Caren@ig.co.uk> wrote:
>>  catty <spam@spam.spam> writes:
>> >Graham Barr wrote:
>> >> The I would suggest you read up a bit more on mail, before
>> >> you start flaming people.
>> >Good advice ... you should take it.
>> Having worked with mailsystems for over six years I know a
>> reasonable amount about email - Graham is one of those
>> people I look up to...
>> 
>> His postings wrt SMTP NNTP etc indicate a significant knowledge
>> of the relevant standards and his perl modules are well written
>> unlike some I have seen.
>
>Graham, in this thread, has recommended that people *not* use his
>own SMTP module to send him mail because it does not add headers
>he wants to see when filtering. catty's comment is misplaced, but
>it is easy to find Graham's advice disingenuous.

This is probably because many people have not read and digested the
contents of the relvant RFC's (mainly 821 and 822). Many would
create broken/faked headers which would be rejected by his
spam detector. This is not a problem with his software, but
with thier use of it.

The MTA not the MUA is usually responsible for Received: (trace)
lines. I (like graham) detect analyse and reject spam and inconsistent
trace lines are a common criteria for such rejections.

If anyone want some examples of spam (and the replies I get)
I have a rather copious archive. :-) As can be seen it takes quite
a lot before they move from block to blocked...

jacqui   staff    1845571 Jan  7 09:38 /home/jacqui/Mail/spam/block
jacqui   staff     190854 Dec 15 16:54 /home/jacqui/Mail/spam/blocked

a few points 

1) our o/g mail includes internal trace headers.  Our internal domain
name is unregistered and inaccessible from the internet.  Anyone
trying to validate such CNAMES/MX recs will get errors.  Our new
mailgate will be configured such that it will remove trace lines
prior to the mailgate trace for external mail...

2) we have many customers who send email direct to thier ISP's SMTP
port. The headers remain consistent, because none are faked.

3) wrt tracing remember that many users do NOT have MX recs pointing
to thier mailgate but to a mail forwarder.

4) wrt to faked headers I often have to fake a mailing list subscription
as we do NOT join mailing lists as individuals but have thier output
routed to a mail->news gateway...

conclusion

Even with all of the above I have had no problem in emailing graham
in the past.  Faked headers, timestamps etc in spam tend to be quite
obvious and the program logic behind detection and rejection of a
significant proportion of spam is not complex.

Jacqui

-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: 07 Jan 1998 16:32:49 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: quixote@shell2.bayarea.net (Quixote Digital Typography)
Subject: Re: Something equivalent to open("|foo|")?
Message-Id: <8cu3bf3lni.fsf@gadget.cscaper.com>

>>>>> "Quixote" == Quixote Digital Typography <quixote@shell2.bayarea.net> writes:

Quixote> I would find it helpful to be able to do have a perl program
Quixote> send data to a program's stdin and get its stdout back. I
Quixote> have a vague recollection that this may have been discussed
Quixote> in the past, but alas, I forgot to make a note of what the
Quixote> answer was.

Dejanews is your friend, in these cases. :-)

Quixote>  I guess I'm looking at something along the lines
Quixote> of named pipes perhaps? Or is there something simpler & more
Quixote> direct?

If you *think* it might be something in the standard Perl distribution,
look at "perldoc perlmodlib", which after a brief scan reveals this
nice nugget:

     IPC::Open2  open a process for both reading and writing

     IPC::Open3  open a process for reading, writing, and error
                 handling

So that'd be good.  If it isn't in the standard distribution,
it's likely in the CPAN, which a simple:

	perl -MCPAN -eshell

will be able to tell you about.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 236 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 8 Jan 1998 01:11:08 GMT
From: webservice@aol.com (WebService)
Subject: suid unix help
Message-Id: <19980108011100.UAA19658@ladder01.news.aol.com>

trying to write a simple one line script
that connects to a database.
I am trying to get it to run as the owner, but
perl says it wants a C wrapper on it.

I ran perl -T 
and it told me my $ENV{PATH} is 
tainted, tried a few things from the book
but no cigar.

Any ideas

perl -v
says I have the suidperl security patch installed.
can i get rid of it or work aroud it.

Thanks in advance.



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

Date: 7 Jan 1998 23:25:38 GMT
From: gbacon@adtran.com (Greg Bacon)
To: tchrist@mox.perl.com (Tom Christiansen)
Subject: Re: Testing for valid RegExps?
Message-Id: <6912ti$ms2$1@info.uah.edu>

[Posted and mailed]

In article <690u9j$d2$1@csnews.cs.colorado.edu>,
: In comp.lang.perl.misc, gbacon@adtran.com (Greg Bacon) writes:
: :    sub is_valid_regex {
: :        my $pat = shift;
: :        eval { local $_ = ''; /$pat/, 1 };
: :    }
: 
: No, sir.    That zaps your //g state.  local doesn't preserve that.

Is there a reason local() shouldn't preserve pos()?

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Wed, 07 Jan 98 19:10:37 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: Testing for valid RegExps?
Message-Id: <34b41abd$6$ofn$mr2ice@speaker>

In <690u9j$d2$1@csnews.cs.colorado.edu>, on 01/07/98 at 10:06 PM,
   Tom Christiansen <tchrist@mox.perl.com> said:
+-----
| Tactical?  TACTICAL!?!?  Hey, buddy, we went from kilotons to megatons
| several minutes ago.  We don't need no stinkin' tactical nukes. (By the way,
| do you have change for 10 million people?) --lwall
+--->8

 ...and like that quick knock-off getcwd() clone now preserved for all eternity
as a standard Perl module, some things I do never get to die in peace.  :-)

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



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

Date: Wed, 7 Jan 1998 11:26:30 GMT
From: s2845543@techst02.technion.ac.il (Raz Uri )
Subject: Text->HTML script
Message-Id: <EMEvs6.Apw@discus.technion.ac.il>

 I've written a simple perl script which converts a text file into a web
 page, and can insert a couple of useful META headers, as well as a counter.

 The configuration file accepted by the script should be of the following
 format [all headers optional, except for Title] :
 
Title = <text - appears at the browser's top> 
Header_1 = <text> 
Header_2 = <text>
Header_3 = <text> 
ICount = <ICount counter number, visit http://www.icount.com/ to get one.>
ICount_Date = <Date when counter was issue/last cleared> 
Description = <text description displayed by search engines> 
Keywords = <text keywords, seperated by commas, for search engines indexing> 

 I've written the script to HTMLize the FAQ I maintain [in text format], and
 thought some other people might find some use to it.

====================== START ========================

#!/usr/local/bin/perl

#
# Get input & output files.
#
if ($#ARGV  > -1) {$Text_File = $ARGV[0] ;}
else              {die "No files specified !\n" ;}

if ($#ARGV  >  0) {$CNFG_File = $ARGV[1] ;}
else              {$CNFG_File = $Text_File.".cnfg" ;}

if ($#ARGV  >  1) {$HTML_File = $ARGV[2] ;}
else              {$HTML_File = $Text_File.".html" ;}

#
# Initialize default values
#
$Title = "Untitled" ; 

#
# Read configuration file 
#
if (-e $CNFG_File)
  {
   open (CONFIG, "<$CNFG_File") ;

   while (! eof(CONFIG))
     {
      $_ = <CONFIG> ;
      chop $_ ;

      if ($_ =~ /^Title = /i)
        {
         s/^Title = //i ;
         $Title = $_ ;
        }
      elsif ($_ =~ /^Description = /i)
        {
         s/^Description = // ;
         $Description = $_ ;
        }
      elsif ($_ =~ /^Keywords = /i)
        {
	 s/^Keywords = // ;
         $Keywords = $_ ;
        }
      elsif ($_ =~ /^Header_1 = /i)
        {
	 s/^Header_1 = //i ;
         $Header_1 = $_ ;
        }
      elsif ($_ =~ /^Header_2 = /i)
        {
         s/^Header_2 = //i ;
         $Header_2 = $_ ;
        }
      elsif ($_ =~ /^Header_3 = /i)
        {
         s/^Header_3 = //i ;
         $Header_3 = $_ ;
        }
      elsif ($_ =~ /^ICount = /i)
        {
         s/^ICount = //i ;
         $ICount = $_ ;
        }
      elsif ($_ =~ /^ICount_Date = /i)
        {
         s/^ICount_Date = //i ;
         $ICount_Date = $_ ;
        }
     }

   close (CONFIG) ;
  }

#
# Start convertion
#
open (INPUT, "<$Text_File") || die "Cant open input file" ;
open (OUTPUT,">$HTML_File") || die "Cant open output file" ;

print OUTPUT "<HTML>\n" ;

print OUTPUT "<HEAD>\n" ;
print OUTPUT "\n" ;
print OUTPUT "<TITLE> $Title </TITLE>\n" ;
print OUTPUT "\n" ;

#
# Write heading HTML lines
#
if (defined($Description))
  {
   print OUTPUT "<META NAME=\"description\" CONTENT=\"$Description\">\n" ;
   print OUTPUT "\n" ;
  }

if (defined($Keywords))
  {
   print OUTPUT "<META NAME=\"keywords\" CONTENT=\"$Keywords\">\n" ;
   print OUTPUT "\n" ;
  }

print OUTPUT "</HEAD>\n" ;
print OUTPUT "<BODY>\n" ;
print OUTPUT "<PRE>\n" ;

if (defined($Header_1))
  {
   print OUTPUT "\n" ;
   print OUTPUT "<CENTER><H1> $Header_1 </H1></CENTER>\n" ;
  }

if (defined($Header_2))
  {
   print OUTPUT "\n" ;
   print OUTPUT "<CENTER><H2> $Header_2 </H2></CENTER>\n" ;
  }

if (defined($Header_3))
  {
   print OUTPUT "\n" ;
   print OUTPUT "<CENTER><H3> $Header_3 </H3></CENTER>\n" ;
  }

if (defined($ICount))
  {
   print OUTPUT "\n This page has been accessed " ;
   print OUTPUT "<a href=\"http://www.icount.com/$ICount.stats\">" ;
   print OUTPUT "<img src=\"http://www.icount.com/$ICount.cgif\"></a>" ;

   if (defined($ICount_Date))
     {
      print OUTPUT " times since $ICount_Date.\n\n" ;
     }
   else
     {
      print OUTPUT " times.\n\n" ;
     } 
  }

#
# Start converting the text file into HTML
#
while (! eof(INPUT))
   {
    $_ = <INPUT> ;

    s/&/&amp/g ;
    s/</&lt/g ;
    s/>/&gt/g ;
    s/(http:\/\/[:a-zA-Z0-9%?,#\@\.\/~\-_]+[:a-zA-Z0-9%#\/\-_])/<a href="$1">$1<\/a>/ ;
    s/(wais:\/\/[:a-zA-Z0-9%?,#\.\/~\-_]+[:a-zA-Z0-9%#\/\-_])/<a href="$1">$1<\/a>/ ;
    s/(gopher:\/\/[:a-zA-Z0-9%\.\/~\-_]+[:a-zA-Z0-9%\/\-_])/<a href="$1">$1<\/a>/ ;
    s/(ftp:\/\/[:a-zA-Z0-9\.\/~\-_]+[:a-zA-Z0-9\/\-_])/<a href="$1">$1<\/a>/ ;
    s/(news:[a-zA-Z0-9\@\.\<\>\-]*)/<a href="$1">$1<\/a>/ ;
    s/(mailto:[a-zA-Z0-9][[a-zA-Z0-9_\.\-]*\@[a-zA-Z0-9][a-zA-Z0-9\-]*(\.[a-zA-Z0-9][a-zA-Z0-9\-]*)*)/<a href="$1">$1<\/a>/ ;
    s/RFC([0-9]+)/<a href="http:\/\/www.internic.net\/rfc\/rfc$1.txt">RFC$1<\/a>/ ;

    print OUTPUT "$_" ;
   }

close (INPUT) ;

print OUTPUT "</PRE>\n" ;
print OUTPUT "</BODY>\n" ;
print OUTPUT "</HTML>\n" ;

close (OUTPUT) ;

================================== END =============================

--
 +---------+-----------------------------------+-------+-----+-----+
 | Uri Raz | mailto:s2845543@t2.technion.ac.il | Noire | :-) | :-( |
 |              Schroedinger's cat is alive and dead.              |
 +-----------------------------------------------------------------+


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

Date: Wed, 07 Jan 98 19:16:50 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: Trimming blanks
Message-Id: <34b41b3c$7$ofn$mr2ice@speaker>

In <34B415B6.4124@hotmail.com>, on 01/07/98 at 03:54 PM,
   canugi Yorugua <canugi@hotmail.com> said:
+-----
| $str =~ s/^\s*(.*?)\s*$/$1/;   # Get rid of surrounding blanks
| in our Sequent box.
| Now we have ported to a HP box and the @#!?&#&!! is not working properly 
+--->8

I bet your HP box runs an outdated Perl... the ? modifier (in ".*?" above)
didn't exist until relatively recently.

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



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

Date: 7 Jan 1998 23:02:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Unix perl shell ???
Message-Id: <6911j0$er0$4@comdyn.comdyn.com.au>

In article <69069p$klu$1@winter.news.erols.com>,
	"Robert Jenks" <eat@joes.nospam.deli> writes:

> Anyone written or writing a UNIX perl shell?

# perldoc perlfaq3
/Is there a Perl shell?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

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

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