[7991] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1616 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 11 00:07:35 1998

Date: Sat, 10 Jan 98 21: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           Sat, 10 Jan 1998     Volume: 8 Number: 1616

Today's topics:
     'flock'ing - what if I'm renaming/unlinking? (Zach Bagnall)
     Re: 52 character string to be broken...any suggestions? (Tad McClellan)
     Re: A newbie's substitution question (Tad McClellan)
     Re: A newbie's substitution question (Eric Albert)
     Bug with perl -i ??? <a@nettown.com>
     Re: Clever way to trash a bunch of global variables? (Shishir Gundavaram)
     Re: CRYPT() <anonymous@whatever.com>
     Re: dbmopen from two different linux distributions <rootbeer@teleport.com>
     Re: Getopt::Long caveat? <efinch@vais.net>
     Re: help Exec format error (8) <rootbeer@teleport.com>
     Re: Help with "target=" anyone? <rootbeer@teleport.com>
     Re: How to send parameters to a perl script. (Michael Budash)
     Re: Need REDIRECT Help!!! <rootbeer@teleport.com>
     new module - evaluate (Gabor)
     Re: PERL & IIS 4 (final) hanging - help!! <rootbeer@teleport.com>
     Re: Perl to Binary? <tchrist@mox.perl.com>
     Re: Perl to Binary? <merlyn@stonehenge.com>
     perl under windows95 cwtalbot@intellex.com
     Re: serious post about gmtime and year-1900 <tchrist@mox.perl.com>
     Re: sorting problem (Tad McClellan)
     Re: sorting problem <jefpin@bergen.org>
     Re: Taint, open, and a pipe... <rootbeer@teleport.com>
     Tree::Fat 0.04 <pritikin@mindspring.com>
     What do you get when you cross a mission-critical enter <pritikin@mindspring.com>
     Re: WWW-pages generated by Perl-scripts (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 11 Jan 1998 03:26:37 GMT
From: bagnallWRINKLES@ihug.co.nz (Zach Bagnall)
Subject: 'flock'ing - what if I'm renaming/unlinking?
Message-Id: <699e5d$nmf$1@newsource.ihug.co.nz>

Hi All,

I have a perl program, which stores info in an ascii text file,
and a typical modify procedure goes something like:

###########################################################################
$newline=join('|',@_);
$TempFileName=$ENV{'REMOTE_ADDR'}.time;
open(TEMPFILE,">$TempFileName") or die "Can't open file $TempFileName: $!";
open(DATAFILE,"$ComFileName") or die "Can't open file $ComFileName: $!";
foreach $line (<DATAFILE>) {
   chomp($line);
   @fields = split(/\|/,$line);
   if (uc($fields[0]) eq uc($_[0]) && uc($fields[1]) eq uc($_[1])) {
      print TEMPFILE $newline."\n";
   }
   else {
      print TEMPFILE $line."\n";
   }
}   
close(DATAFILE);
close(TEMPFILE);
unlink($ComFileName);
rename($TempFileName,$ComFileName);
###########################################################################

However this system may be used by many people at once, so I need to do 
some flocking but I don't know where/what to flock because of the 
renaming & unlinking. I need to use the TEMPFILE because the file will 
grow quite large.

Oh yeah - this will probably go on an NT server.

Zach.
-- 
Take the WRINKLES out of my email address to email me
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 "Ooooh.. Floor Pie!"    http://shell.ihug.co.nz/~bagnall/
-----------------------------------------------------------



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

Date: Sat, 10 Jan 1998 19:04:59 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: 52 character string to be broken...any suggestions?
Message-Id: <rr5996.u61.ln@localhost>

cj5xvv@hotmail.com wrote:
: Please reply directly to my hotmail address - cj5xvv@hotmail.com


That's a rather selfish attitude. 

If I do that, then anyone else reading the newsgroup won't know how to do it.

Please get the answer in the same place that you asked the question.


: This is not an internet question - and I am throwing it out to the
: newsgroup as a last resort.  I have a 52 character string which has to
: be broken and sorted.  It represents 52 weeks.  Typically it looks like
: this:
: 1000100010001000100010001000100010001000100010001000

: You can probably guess that this is playing out of a system scheduling
: weekly events.

: I want to transfer this to :

: 1
: 0
: 0
: 0
: 1
: 0
: 0
: etc...


  foreach (split //) {print "$_\n"} # split on null pattern to get each char


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


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

Date: Sat, 10 Jan 1998 18:27:13 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: A newbie's substitution question
Message-Id: <1l3996.511.ln@localhost>

Eric Albert (ejalbert@leland.stanford.edu) wrote:
: I'm new to both Perl and regular expressions (yeah, I know that's not a
: great combination, but you've got to learn them sometime), and I've found
: a way to do something rather inefficiently that I'd like to think can be
                               ^^^^^^^^^^^^^

What kind if inefficiency?

Size of executable?

Speed of executable?

Ease of maintenance?

Memory usage?


I guess I'll just go with execution speed (think Benchmark module)...


: improved on:

: I'm trying to convert text that either is surrounded by underscores (_) or
: starts with two capital letters to bolded text in HTML.  In other words,
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Your program does not match your specification.

I would expect 'TExt' to end up as <b>TExt</b>, according to what you
said there. Your program doesn't do that.


I guess I'll go with the spec being wrong, and the program being right.

The spec should say instead:

   "is all upper case, and is more than one character long"


: TEXT would become <b>TEXT</b>, and _Text_ would become <b>Text</b>.  Also,
: if the text fits both qualifications, _TEXT_ would become <b>TEXT</b>.

: I think that it works with the following two lines:
: $count=($line=~s[_(.+?)_][<b>$1</b>]g);
: $line=~s{([A-Z][A-Z]+?)}{<b>$1</b>}g if !$count;

: I'd think that it could be done in one line, as the replacement expression
                             ^^^^^^^^^^^^^^^^

Number of lines of source code has little to do with execution speed,
so maybe you mean a different kind of efficiency after all?


: is the same for both matches.  Thing is, if I write
: $line=~s[([A-Z][A-Z]+?)|_(.+?)_][<b>$1</b>]g; then $1 only seems to match
: whatever matches the first set of parens and therefore comes up blank in
: the case of _Text_.  Any ideas?


I can get it to be one line:

   s[([A-Z][A-Z]+?)|_(.+?)_][defined($1) ? "<b>$1</b>" : "<b>$2</b>"]ge;
                 ^
                 ^ use greedy match to handle the case I give at the bottom...


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

use Benchmark;

$_ = '_Text_';

timethese(100000, {
    'one line' => 
    '$_ = q/_Text_/;
     s[([A-Z][A-Z]+?)|_(.+?)_][defined($1) ? "<b>$1</b>" : "<b>$2</b>"]ge',

    'two lines' => 
    '$_ = q/_Text_/;
     $count=(s[_(.+?)_][<b>$1</b>]g);
     s{([A-Z][A-Z]+?)}{<b>$1</b>}g if !$count'

});
-------------------------

outputs:

Benchmark: timing 100000 iterations of one line, two lines...
  one line: 10 secs ( 9.78 usr  0.00 sys =  9.78 cpu)
 two lines:  9 secs ( 8.34 usr  0.00 sys =  8.34 cpu)


But "one line" works out to be _slower_ (no, make that <b>slower</b>  ;-)



Note also that with:

   $line = '_text_  TEXT';

only the first one gets marked by your program, since the "upper case" 
ones don't get done if there were _any_ "underscored" ones.


This is a Hard Problem. Good luck!


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


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

Date: Sat, 10 Jan 1998 18:38:28 -0800
From: ejalbert@leland.stanford.edu (Eric Albert)
Subject: Re: A newbie's substitution question
Message-Id: <ejalbert-1001981838280001@ejalbert.stanford.edu>

In article <1l3996.511.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:

> : a way to do something rather inefficiently that I'd like to think can be
>                                ^^^^^^^^^^^^^
> 
> What kind if inefficiency?

I suppose I didn't quite say what I wanted to there, which was, "Perl can
do all kinds of things really quickly and compactly (code-wise, that is),
so how can this be done in one line?"  Sorry 'bout that!

> Your program does not match your specification.
> 
> I would expect 'TExt' to end up as <b>TExt</b>, according to what you
> said there. Your program doesn't do that.

Actually, I want 'TExt' to become <b>TE</b>xt.  I can assume that cases
like _TExt_ and '_text_ TEXT' will never occur -- the former will show up
as _TE_xt and the latter just won't happen.

> I can get it to be one line:
> 
>    s[([A-Z][A-Z]+?)|_(.+?)_][defined($1) ? "<b>$1</b>" : "<b>$2</b>"]ge;

Hmm...I guess that would work, though I was hoping that it wouldn't
require a construct like that which effectively just takes the two lines
and kind of squishes them into each other.

> But "one line" works out to be _slower_ (no, make that <b>slower</b>  ;-)

True; I guess I'll just stick with the two-line solution after all.  Oh,
well....

BTW, thanks!

-Eric

------------------------------------------------
Eric Albert         ejalbert@leland.stanford.edu
http://www-leland.stanford.edu/~ejalbert/


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

Date: Sat, 10 Jan 1998 21:34:41 -0600
From: "A. Poindexter" <a@nettown.com>
Subject: Bug with perl -i ???
Message-Id: <34B83DD1.7BD51942@nettown.com>


When I run perl -i -pe 'do something' filename
and filename is a symbolic link,
the "new" file is has the same name as the symbolic link,
the symbolic is erased (overwritten),
and the file pointed to by the orignal symbolic link is unchanged.
Which is not how vi filename works if filename is a sym link.
Isn't this counter intutive to the meaning of -i, which is inplace?

The reason this is a problem for me is I like to keep
versions and a pointer to the latest, e.g.:
index.0.cgi
index.1.cgi
index.2.cgi
index.cgi -> index.2.cgi

and I forget and use index.cgi as the filename
in the perl command line above.




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

Date: 11 Jan 1998 01:00:52 GMT
From: shishir@ruby.ora.com (Shishir Gundavaram)
Subject: Re: Clever way to trash a bunch of global variables?
Message-Id: <6995k4$do7$1@amber.ora.com>

Dean Pentcheff (dean@tbone.biol.sc.edu) wrote:
: I'm looking for a quick'n'dirty solution to a small problem.  I've got
: a Perl program that runs fine as a CGI script (NO, this is NOT a CGI
: problem, please read on...).  I'd now like to run it under mod_perl
: (which, if you aren't aware of it, compiles the program once using a
: perl interpreter in the WWW server itself, then reinvokes the program
: for each incoming request).

How about hacking the symbol table directly. Untested code follows:

    BEGIN { %globals = (); map { $globals{$_}++ } keys %main:: }

    $name = 'john doe';
    @ids  = qw (10 50 75);
    %args = (first => 'john', last => 'doe');

    print "Now, we have the globals...\n";
    print "name = $name, ids = @ids, args = @{[ %args ]}\n";

    while (($var, $value) = each %main::) {
        next if ($globals{$var});

        *glob = $value;
        undef $glob, undef @glob, undef %glob;

        delete $main::{$var};   # Bad!
    }

    undef %globals;

    print "Now, we don't have the globals...\n";
    print "name = $name, ids = @ids, args = @{[ %args ]}\n";

Good luck!

--Shishir


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

Date: Sat, 10 Jan 1998 19:19:24 -0800
From: "Shawn M. Nelson" <anonymous@whatever.com>
Subject: Re: CRYPT()
Message-Id: <699e1u$5lq$1@ha2.rdc1.sdca.home.com>

Well, I'm glad that somebody knew what I was talking about! :)

Someone gave me a win32 .dll that let me pass a string and it returned the
encryted string based on the crypt() algorithim.

Thats all I needed.

Thanks,
Shawn

Nathan V. Patwardhan wrote in message <695rtv$8mq@fridge.shore.net>...
>Shawn M. Nelson (anonymous@whatever.com) wrote:
>
>: No, I am not.  What group would you post to if you were trying to update
an
>: .htpasswd file by first creating the file in VFP and the FTPing the file
to
>: an NCSA server?
>
>Well, I'd probably post to a FoxPro group, or even a webserver group
>where users were discussing htpasswd stuff.  Unless, of course, you
>were really trying to ask about crypting passwords like the htpasswd
>program and how you'd do it in Perl.
>
>But I didn't parse that question from your question.  Is that the
>question you were trying to ask?
>
>--
>Nathan V. Patwardhan
>




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

Date: Sat, 10 Jan 1998 15:50:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: beryte@leb.net
Subject: Re: dbmopen from two different linux distributions
Message-Id: <Pine.GSO.3.96.980110154427.26607N-100000@user2.teleport.com>

On Sat, 10 Jan 1998 beryte@leb.net wrote:

>  I was using dbmopen (perl) under RedHat 4.2. The extension of the files
> were *.db  I then upgraded to RedHat 5.0 and now I cannot open and use my
> *.db files  Perl creates instead two files with *.dir and *.pag
> extensions.

dbmopen is implemented as a call to the more-sophisticated tie() call,
which allows you to choose which database module to use. Check out the
AnyDBM_File module to find out about the different modules available. 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: Sat, 10 Jan 1998 22:06:50 -0500
From: Ed Finch <efinch@vais.net>
To: darlenem@PAS.DE.SPAM.flash.net
Subject: Re: Getopt::Long caveat?
Message-Id: <34B8374A.17482E20@vais.net>

Jeeves wrote:

> Am I missing something? GetOpt::Long lets you specify that options
> have
> an optional integer argument. But, what happens if that option is
> specified,
> but no integer supplied?
>
> use GetOpt::Long;
> %optctl = ( 'n' => \$num,);

I haven't used this syntax (yet) so I can't comment on it.

> &GetOptions(%optctl);
> # lots_of_code
>
> Suppose the above snippet was run with '-n 10'. That's nice, $num is
> now 10.
> But if no number is given? I cannot find an example of this *anywhere*
> in the
> Camel book! I can only assume that it would set $num to 1. But what if
> the
> script was run with 'n=1'? Am I missing something? If not, how do I
> deal with
> that?

If you want an optional integer, use ("number|n:i"). If you want a
mandatory integer, use ("number|n=i").

HTH,
Ed





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

Date: Sat, 10 Jan 1998 18:25:28 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Trajen <trajen@worldnet.att.net>
Subject: Re: help Exec format error (8)
Message-Id: <Pine.GSO.3.96.980110182434.26607c-100000@user2.teleport.com>

On Sat, 10 Jan 1998, Trajen wrote:

> I'm attempting to run a perl script but get this error:
> 
> CGIwrap Error: System Error: execv() failed
> Error: Exec format error (8)

That's not a Perl error; that's an error message from CGIwrap. If the docs
for CGIwrap don't help, then a newsgroup about CGI scripting would be the
place to ask. Good luck!

-- 
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: Sat, 10 Jan 1998 15:56:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: L Elyea <lelyea@freeway.net>
Subject: Re: Help with "target=" anyone?
Message-Id: <Pine.GSO.3.96.980110155439.26607P-100000@user2.teleport.com>

On Sat, 10 Jan 1998, L Elyea wrote:

> print "<a href = \"http://shareware2001.com/cgi-bin/winner.pl\">Try
> Again</A><BR>\n";

Yep, that's valid Perl.

> I want this line to cause a reload of my frame - however anytime I add
> anything to do with "target=" I get a perl error. 

Really? What error would that be, and does the perldiag manpage tell you
anything helpful about it?

Of course, we can help you with the Perl code to print whatever you want,
but if you're trying to find out what to print to get this "target=" 
thing to work, that's not Perl. If you can't find the answer in the specs
for the protocol you're using, you may need to ask in a newsgroup about
the protocol (or about servers or browsers or something). Good luck! 

-- 
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: Sat, 10 Jan 1998 17:41:22 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: How to send parameters to a perl script.
Message-Id: <mbudash-1001981741220001@d178.pm12.sonic.net>

>> Dico Reyers wrote:
>> 
>> > how can I let the script know which one the person clicked on? and
>> > finally, how does this show up when the script is run?  in other
>> > words, what line of code is needed to for me to know which icon they
>> > pressed.
>> >

Try this. E.g.:

<a href="bin/xxxx.cgi?icon1"><img src="icon1.gif"></a>

Then, in the xxxx.cgi script, the $ENV{'QUERY_STRING'} variable will
contain "icon1".

Or did I miss something here?

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Sat, 10 Jan 1998 16:02:35 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Dane S. Udenberg" <dsuden@netnet.net>
Subject: Re: Need REDIRECT Help!!!
Message-Id: <Pine.GSO.3.96.980110160101.26607Q-100000@user2.teleport.com>

On Fri, 9 Jan 1998, Dane S. Udenberg wrote:

> TABNET told me I need a redirect file to point those arriving via the
> second domain to the appropriate html file. 

If you can't find the answer from your server's docs, and if TABNET won't
give you the answer (shame on them!) you should probably ask in a
newsgroup about your server. Good luck!

-- 
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: 11 Jan 1998 00:31:35 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: new module - evaluate
Message-Id: <6993t7$4gl$1@news1.teleport.com>

Hi,

I have written, what is in my humble opinion, an improved version of
Text::Warp.  It is done as an object so it is thread safe and does not
die when the longest word plus leading whitespace is longer than
column width.  It also has a center subroutine along with wrap and
fill and subs to set the config vars.  Also, it puts a newline at the
end of the paragraph which Text::Wrap does not do.  And it puts two
spaces after a period.
It allows you to right align text or fill the right side with spaces
out to width.  Becuase it does not die when width is less than longest
word it can be used to make a word list, either left or right aligned.
I hope that people would comment on it's performance/bugs before it
goes on CPAN.  It is right now version 0.1.
You can find it at
www.vmunix.com/~gabor/perl/Manip.pm

gabor.
--
    In general, they do what you want, unless you want consistency.
        -- Larry Wall in the perl man page




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

Date: Sat, 10 Jan 1998 15:53:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: nospam@XX.co.uk
Subject: Re: PERL & IIS 4 (final) hanging - help!!
Message-Id: <Pine.GSO.3.96.980110155111.26607O-100000@user2.teleport.com>

On Thu, 8 Jan 1998 nospam@XX.co.uk wrote:

> We are running PERL (build 315) and IIS 4 (the final release).  When
> we call a simple perl script, the browser shows server contacted,
> waiting for reply, but just hangs forever.  

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. 

   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/

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: 11 Jan 1998 00:54:32 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl to Binary?
Message-Id: <699588$5bp$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, jwbacon@ix.netcom.com (J. Bacon) writes:
:There is a shareware Perl compiler available (cost is $35, it works on the 
:ActiveState port build 3.13+ and has at least one 'bug').  

I'm virtually certain that this is not a real compiler.  If
it claims that, they're either prevaricating or I'm very
highly confused.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

MAGIC*  xmg_magic;  /* linked list of magicalness */
    --Larry Wall, from sv.h in the v5.0 perl distribution


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

Date: 10 Jan 1998 21:00:12 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Perl to Binary?
Message-Id: <8coh1j4q43.fsf@gadget.cscaper.com>

>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:

Tom>  [courtesy cc of this posting sent to cited author via email]
Tom> In comp.lang.perl.misc, jwbacon@ix.netcom.com (J. Bacon) writes:
Tom> :There is a shareware Perl compiler available (cost is $35, it works on the 
Tom> :ActiveState port build 3.13+ and has at least one 'bug').  

Tom> I'm virtually certain that this is not a real compiler.  If
Tom> it claims that, they're either prevaricating or I'm very
Tom> highly confused.

Well, it *is* a "compiler" in the sense of "bring together". :-)

But certainly not at all what most people try to mean when they say
compiler, nevermind that Perl has been a compiler even by that
definition since 1987 with version 0.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 233 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@teleport.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: Sat, 10 Jan 1998 22:02:02 -0600
From: cwtalbot@intellex.com
Subject: perl under windows95
Message-Id: <884490586.235143175@dejanews.com>

I recently loaded perl5 and am having trouble running it. I tried the
Start menu then Run,typed "perl ProgramName.pl", but that doesn't work.
Any ideas how to launch perl and run my program?

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 11 Jan 1998 01:57:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: serious post about gmtime and year-1900
Message-Id: <6998uv$9ps$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Tom Phoenix <rootbeer@teleport.com> writes:
:>     Tom, you should find software that indicates when you have mailed
:>     a copy of a post, 
:I already do. There should be a 'Newsgroups:' header on this message, for
:example. Hope this helps!

Sadly, that does not suffice.   Some newsreaders maintain that
header even in private mail replies.

--tom

-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "For it, that's now" --Larry Wall


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

Date: Sat, 10 Jan 1998 18:34:18 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: sorting problem
Message-Id: <a24996.511.ln@localhost>

Tom Phoenix (rootbeer@teleport.com) wrote:
: On Sat, 10 Jan 1998, TechMaster Pinyan wrote:

: > sort (@menu);

: That's a useless use of sort in a void context. 


But he must have already know that Tom.

Since everybody knows that you should ALWAYS, that's right, ALWAYS
use the -w switch, and the -w switch points out that the above
is not doing anything useful.

That -w switch sure does do a lot of debugging for you, if you
are lazy enough to use it...


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


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

Date: Sat, 10 Jan 1998 22:09:48 -0800
From: TechMaster Pinyan <jefpin@bergen.org>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: sorting problem
Message-Id: <Pine.PCW.3.96.980110220901.3782A-100000@techmaster.bergen.org>

> > sort (@menu);
> 
> That's a useless use of sort in a void context. 

I figured he would know to say @array = sort @array

          -- Jeff TechMaster Pinyan --
-- "Crummy .sig file?  Must be using PCPine!" --
 -- PCPine is to Pine as MSIE is to Netscape --
   -- Junior at AAST (www.bergen.org/AAST) --




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

Date: Sat, 10 Jan 1998 18:22:44 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: jhelt@preferred.com
Subject: Re: Taint, open, and a pipe...
Message-Id: <Pine.GSO.3.96.980110181441.26607b-100000@user2.teleport.com>

On Sat, 10 Jan 1998 jhelt@preferred.com wrote:

> I am editing a perl script to meet my ISP's requirements of passing
> Taint checks, use strict, and use diagnostics. 

Good! Except that 'use diagnostics' explains only the error messages which
your code shouldn't generate. :-)  IMHO, you shouldn't want or need those
explanations on finished code. 

> My script compiles correctly, but hangs at the following command ONLY WHEN
> TAINT CHECKING IS ENABELED:
> 
> open(MAIL,"|$mailprog $mailto" || die "Can't open $mailprog\n";

(Did you leave out a parenthesis? :-)

If either $mailprog or $mailto is tainted, or if you have some insecure
variables in certain places in %ENV, that line is supposed to fail. The
error message should be one of the ones which 'use diagnostics' will help
you with, though!

If $mailto is (as it seems) a destination address, you're probably taking
the wrong road. It's very (very!) bad to put a user-supplied email address
into a command line; check out your mail program's other ways of
specifying a destination address. Or maybe you should be using a module to
send the mail?

> It seems that taint checking is stripping out the pipe precedeing
> $mailprog.

I'm sure that that's not what's happening! :-)

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: 11 Jan 1998 00:28:55 GMT
From: Joshua Pritikin <pritikin@mindspring.com>
Subject: Tree::Fat 0.04
Message-Id: <6993o7$4ba$1@news1.teleport.com>

Name           DSLI  Description                                  Info
-----------    ----  -------------------------------------------- -----
Tree::Fat      adcO  Embeddable F-Tree Algorithm Suite            JPRIT

Implements object-oriented trees using algorithms adapted from b-trees
and AVL trees (without resorting to yucky C++).


The reasons for another tree implementation are as follows:

- Publically available code is the best tested.  Buggy trees are
completely unacceptable.  This module includes test coverage analysis.

- The algorithms have been completely separated from any notion of a
database; the code is tweaked for easy embedding into other
applications.


Get it via http://www.perl.com/CPAN/authors/id/JPRIT/ !






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

Date: 11 Jan 1998 00:29:50 GMT
From: Joshua Pritikin <pritikin@mindspring.com>
Subject: What do you get when you cross a mission-critical enterprise-class database with a camel?
Message-Id: <6993pu$4bj$1@news1.teleport.com>

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

# SQL Challenge
#
# 1. Create a new database or use the existing one.
# 2. Populate a table with questions.
# 3. Print them out in the general pattern: 1 1,2 1,2,3 ...

use ObjStore;
use ObjStore::Config;

my $db = ObjStore::open(TMP_DBDIR . "/challenge", 'update', 0666);

begin 'update', sub {
    $db->root('questions' => sub {
        my $i = new ObjStore::Index($db);
        $i->configure(path => 'msg', unique => 1);

        $i->add({ msg => "Do you want some orange juice?" });
        $i->add({ msg => "Are you hungry?" });
        $i->add({ msg => "How about pizza?" });
        $i->add({ msg => "SQL is the best language ever!" });
        $i;
     });
};

begin sub {
    my $c = $db->root('questions')->new_cursor;
    for (my $e=1; $e <= $c->count; $e++) {
      $c->moveto(-1);
      for (1..$e) { print $c->each(1)->{msg}."\n"; }
      print "\n";
    }
};


Name           DSLI  Description                                  Info
-----------    ----  -------------------------------------------- -----
ObjStore       Rm+O  ObjectStore OODBMS Interface                 JPRIT

- Requires ObjectStore OODBMS (http://www.odi.com) & perl 5.004_04.
- Perl 5.004_54 or better recommended.

Get it via http://www.perl.com/CPAN/authors/id/JPRIT/ !


##################
# RE@ENT CHAN@ES #
##################


** 01-06-98 RELEASE 1.22 - HAPPY NEW YEAR!

- Real indices!  Queries such as /date between qw(Nov97 Jan98)/ are
now easy!  And you can index on multiple keys: $index->configure(path
=> "last_name, first_name").

- No longer ignores -MCarp=verbose!

- posh: both cd & ls now use the same path resolver.

- Builds via Makefile.PL.  Ported to Digital Unix 4.0 (Alpha).

- The stargate no longer destroys data as it is copied.

- 'new_cursor' now defaults to transient memory.


** 12-13-97 RELEASE 1.21

- THE TUTORIAL IS DONE!  See ObjStore::Tutorial!

- Fixed numerous minor bugs; fixed ObjStore::UNIVERSAL::isa;
significant changes to posh; NOREFS invokation optimized out unless
the method is present; re-organized the stargate; moved CSV stuff to
ObjStore::CSV; untested support for kernel threads.

- 'Table' redesigned for performance.  See ObjStore::Table2.

- The documentation is updated & re-written!





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

Date: Sat, 10 Jan 1998 18:52:45 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: WWW-pages generated by Perl-scripts
Message-Id: <t45996.351.ln@localhost>

Honza Pazdziora (adelton@fi.muni.cz) wrote:
: "Paul Weingarten" <paulweingarten@hotmail.com> writes:


: > $filename = "data.txt";

: No use strict and no my.


 ... and using double quotes when there is nothing to interpolate.


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


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

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

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