[11630] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5230 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 25 21:01:56 1999

Date: Thu, 25 Mar 99 18:00:18 -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           Thu, 25 Mar 1999     Volume: 8 Number: 5230

Today's topics:
        :t/85s*) 8j.F59%~<F=F;s <yahoo@forfree.at>
    Re: :t/85s*) 8j.F59%~<F=F;s (Bob Trieger)
    Re: Commercial use of Perl ?'s <Go-Ravens@Baltimore.Com>
    Re: Date/Time calculation: % through current month? <cassell@mail.cor.epa.gov>
    Re: Date/Time calculation: % through current month? <cassell@mail.cor.epa.gov>
    Re: Date/Time calculation: % through current month? (Larry Rosler)
        Do you get the same duplicate results? (Bill Moseley)
    Re: HELP: Confused about Hash Table. (KEhlar)
    Re: Help: Displaying Database search results <staffan@ngb.se>
    Re: need help getting started! (Tad McClellan)
    Re: Problem writing a file... file permissions ok on co <dbrobins@uwaterloo.ca>
    Re: Reading results of external commands (Sam Holden)
    Re: regular expression <cassell@mail.cor.epa.gov>
        remote user password <markd@netwater.com>
    Re: remote user password <eric.schwartz@acm.org>
    Re: Running a perl script as a daemon.... (Greg Bacon)
        Sorting multidimensional arrays <NOSPAMpenner@jps.net>
    Re: STDOUT to HTML (Bob Trieger)
        system behaving strangely (Win32) <dbrobins@uwaterloo.ca>
        Tcl/2k : The 7th USENIX Tcl/Tk Conference Call for Pape (Jennifer Radtke)
    Re: Using Win32::Perms <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
        Want to hire someone to make changes to Perlshop <chambers@HATESPAMdfw.net>
    Re: Where to start with Perl (Chris Tremblay)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 26 Mar 1999 09:08:49 +0800
From: "$p$p&L%J" <yahoo@forfree.at>
Subject: :t/85s*) 8j.F59%~<F=F;s
Message-Id: <36fade3c.0@ruby.hknet.com>

9o-x&m &p*G'Z,JCD%X$#*~&X3o-S8s2U
$W,P4A$-D11oftp logon &30]CD &Visp ,d8_+a5o2{passwordB`
'Z*:isp ;!(S&3's'o'Z*:pssword 'Z&[$v$](S&3's'o9L
*l.I%g&3(GCh:C +a(S*>9D7spassword +a $@$A%?1` +K(S&3%h2z7|
,Q$i&b,Y-S:t/8,](l&3$@-S&[:Y,O-;4d3L&n7j/A>9*::t/8
&n)_$_EX(O$U(+%h,],] $@,]$'$U $~5o2{&[$v*::t/83Q'[$F
;!'[$#&p;!0= 5{&!$@<K 8j.F$@<K 3s*)-13]-p3#>G(,
$#,O3Q0=$F8j.F AY&3(d%L%i/`)J6\ 'Z2{.I$]%?3BCh:C*:6%,q
)R%H=P&U&l(S,0'Z$@$@$@?k ,],],O'Z,]?y$F AY,O/u&3(d(F
&p*G,O'Z'K?y$F =P$j.a-l=L !!
3o,O'Z*::t'} http://yayawoo.com
Ch:C&3(F*::t'}  http://www.hkonly.com
7m5M$#&P$F  +\$#)/'Z$w%~-1's7s$F%D-6 3s5{&!$]4+$F&h$V
&n1m*:,O 'ZAY&3BB*:@I.W%i%H59$j.a,],]
http://yayawoo.com/search/Business/
http://www.hkonly.com/search/Business/
$q8{%H$W*::t'} $#,O'9'9%~%~$@<K6\ 0#$F%L*::t/8&h$F(G7s8j.F%~
&A,],](d%L%X?}'a @38S$j&\,[&P*:

5{&!7m5M$],O$@<K0U 3#,O'Z*:9@
&3$@BIAY%i%H5})z*:,O $j.a=P%Nnetscape ,]$@,](b-S:t-6%k$W($*:7s/8;E
&n)zEc,O$@$j$@$p*: 3o,O'Z&b3]-p.I&#$F%Nnetscape4z8U)R&\ &}D11o$p0]CD
)R%H(S&32z7|

&U&l&p*GD11o$=2z$467&s&b *>CQ*)Ev$467:{E@ $N$,Ap:t$W*:*v&w$467:{+y*:8\
=P1P'Z$@&3$0;r$h*k%i%H(z&^D])s&[$v*:*F&h 'Z2{&b&3$0;r%i%H05*: 'ZAY&3$0;rEv'Q
$#3Q(d%L$H&b$@)]6!4N'b'Z<F$k*:$_&e5s(+$F
&p*G'A,O&3Cv$h-1*:$H%K $]=P'A@0@0&# AY'Z$@-S$=9D!!





-'d4M&P0O ,F&\&P&~&P$k&P$i*::t$M
-;4dicqAp7y
http://yayawoo.com/icq/
-----------------------------------------------------------
* $#7Q'A:k$_;s'@*::t-6.x%")s:t.|$$
* &3:t-66X&-5n?}
* $]$]/Q !! 7j4M$^@:
* http://yayawoo.com/
* admin@yayawoo.com
-------------------------------------------------------
---------------------------------------------------








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

Date: Fri, 26 Mar 1999 01:32:06 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: :t/85s*) 8j.F59%~<F=F;s
Message-Id: <7deo44$nl0$1@oak.prod.itd.earthlink.net>

In article <36fade3c.0@ruby.hknet.com>, "$p$p&L%J" <IA'r&n3%> wrote:
>9o-x&m &p*G'Z,JCD%X$#*~&X3o-S8s2U
>$W,P4A$-D11oftp logon &30]CD &Visp ,d8_+a5o2{passwordB`
>'Z*:isp ;!(S&3's'o'Z*:pssword 'Z&[$v$](S&3's'o9L
>*l.I%g&3(GCh:C +a(S*>9D7spassword +a $@$A%?1` +K(S&3%h2z7|

>> snippety <<

What we have here folks is the 1999 obscure code winner, hands down!



Bob Trieger
sowmaster@juicepigs.com       



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

Date: Thu, 25 Mar 1999 19:22:52 -0500
From: Raven513 <Go-Ravens@Baltimore.Com>
Subject: Re: Commercial use of Perl ?'s
Message-Id: <36FAD35C.346D@Baltimore.Com>

David L. Cassell wrote:
> 
> Tad McClellan wrote:
> >
> > Krusty276 (krusty276@aol.com) wrote:
> > : Hey our company is using ActivePerl to develop some software, there is no
> > : licencing fee you need to pay for commercially selling our software that was
> > : developed in active Perl 5 is there ?
> >
> >    What did the license say?
> 
> I.e., Perl comes with full (and very generous) licensing information,
> and you really need to read it.  No one should be using products
> whose licensing agreements they have not read, when doing commercial
> software development.  Perl is very forgiving (as is Larry :-), but
> other software authors/companies would have you in a legal headlock
> faster than you can say 'copyleft'.
> 
> David
> --
> David L. Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician


Be very careful here... ActiveState requires signing an agreement from
them that is full of requirements over and above the Artistic and GPL
licenses included in the Perl Source package.  There is no mention of
these details until you actually send an e-mail to ActiveState and get
the agreement in hand.  Items like providing 5 licenses and copies of
the system you are building are in this agreement.  

The good news is if you have a standard C compiler for Windows (Borland
or MS), you can build your own Perl distribution from the source code. 
I have.

Raven513


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

Date: Thu, 25 Mar 1999 16:09:53 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Date/Time calculation: % through current month?
Message-Id: <36FAD051.EC7721F9@mail.cor.epa.gov>

Tony Bowden wrote:
> David L. Cassell <cassell@mail.cor.epa.gov> wrote:
> : This was answered yesterday, with a very nice piece of code.  I'm going to
> : assume this re-post a day later is a glitch with your news software, and
> : that you have already checked that thread for the answer.  If not, here's
> : a hint: localtime in scalar context returns all the info you need.
> 
> My newsreader reported that the first post didn't go through, so I posted again
> from a different machine! It them seems both did go through ...
> 
> However, I'm unsure if you're referring to the article I replied to, which
> suggested using Time::Local, but only dealt with half the question (I still
> need the best way to get the start and end of the month ...)

No, there was a follow-up that gave you what you needed, using timelocal()
and the first day of the current month, vs the first day of the next month.
But I can't get DejaNews to cooperate at the moment, and as I think about
it, the code I saw didn't cover moving from December to January.

Well, an easy way to do end_of_month - start_of_month is to populate an array 
with the number of seconds in each month.  That way you won't have to use
timelocal() and localtime() so often.  This could be done more succintly, but
this way you can see the logic flow [assuming I have any logic right now]:

@end_to_start=(31,28,31,30,31,30,31,31,30,31,30,31);  # number of days
$end_to_start[1]=29 if ($year % 4 == 0);   # works between 1901 and 2099
@end_to_start *= 24*60*60;                 # and now it's in secs

You then want $end_to_start[$mon] as your denominator.

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 25 Mar 1999 16:13:54 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Date/Time calculation: % through current month?
Message-Id: <36FAD142.28CD09D2@mail.cor.epa.gov>

Tony Bowden wrote:
> 
> dana watanabe <dwatanab@uci.edu> wrote:
> : Try Time::Local
> : specifically the 'timelocal' function
> 
> interesting ...
> 
> : $sec=$min=$hour=0;
> : $day=1;
> : $month=2; #2=March
> : $year=1999;
> : $march1st=timelocal($sec,$min,$hour,$day,$month,$year);
> : $april1st=timelocal($sec,$min,$hour,$day,$month+1,$year);
> 
> Is there an easy way of working this out though .. I don't want to hardcode
> the date, and I want it to work all the time ... this code will start
> breaking nastily in December ...

Yes.  Odd that I recalled that from a couple days ago, isn't it?
Well, you can use this for the numerator and my just-posted suggestion 
for the denominator.

> : $now=time;
> : $equation=($now-$march1st)/($april1st-$march1st);

It's still a nice piece of code.  You could fix it simply by testing
whether $month=11 (December), and if so use $month=1 and $year+1 .

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 25 Mar 1999 17:34:00 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date/Time calculation: % through current month?
Message-Id: <MPG.116483e21083cbb89897d1@nntp.hpl.hp.com>

In article <36FAD142.28CD09D2@mail.cor.epa.gov> on Thu, 25 Mar 1999 
16:13:54 -0800, David L. Cassell <cassell@mail.cor.epa.gov >says...
> Tony Bowden wrote:
 ... 
> It's still a nice piece of code.  You could fix it simply by testing
> whether $month=11 (December), and if so use $month=1 and $year+1 .
                                                     ^
                                                     0

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 25 Mar 1999 16:20:04 -0800
From: moseley@best.com (Bill Moseley)
Subject: Do you get the same duplicate results?
Message-Id: <MPG.1164728d592d4a3e9896f4@206.184.139.132>

#!/usr/local/bin/perl5.005 -w
use strict;

print "\nTesting 123 - ", scalar localtime(),"\n";

my $ret = send_mail_via_sendmail( 'cat', 'hello there' );



use FileHandle;
use IPC::Open3;

sub send_mail_via_sendmail {

    my ($sendmail, $body) = @_;

    my $params = $sendmail;

    my $in  = new FileHandle;
    my $out = new FileHandle;
    my $err = new FileHandle;


    open3( $in, $out, $err, $params )
        or return "Failed open of sendmail:$sendmail:$!";

    ## the $in->print() & $in->close() stuff removed to simplify here.

    0;
}

And the results:

152) ~/cgi-bin/moseley %./dup1.pl

Testing 123 - Thu Mar 25 08:31:23 1999  <- One line output

153) ~/cgi-bin/moseley %./dup1.pl > x   <- now redirect
154) ~/cgi-bin/moseley %cat x

Testing 123 - Thu Mar 25 08:31:28 1999

Testing 123 - Thu Mar 25 08:31:28 1999  <- two copies!

158) ~/cgi-bin/moseley %perl -v

This is perl, version 5.005 built for sun4-solaris

-- 
Bill Moseley mailto:moseley@best.com


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

Date: Thu, 25 Mar 1999 09:32:08 -0500
From: KEhlarQUASH@SPAMMERtheglobe.com (KEhlar)
Subject: Re: HELP: Confused about Hash Table.
Message-Id: <MPG.116412f291d30286989797@nntpd.bb.dec.com>

In article <jc5bd7.3a3.ln@magna.metronet.com>, tadmc@metronet.com says...
> KEhlar (KEhlarQUASH@SPAMMERtheglobe.com) wrote:
> 
> : I can create a hash table with code like this one:
> 
> :  $index = 0;
> :  foreach $element (@list1) {
> :   $hash1{$index} = $element;
> :   $index++;
> :  }
> 
> 
>    Well OK, but that looks like an array (indexed by a number)
>    masquerading as a hash (indexed by a string) to me.
> 
> 
> : OR like this one:
> 
> :  %hash1 = ('1', 'element1', '2', 'element2'....so on);
> 
> 
>    The first one defined $hash1{0}, this one does not...

I only used above as examples of ways to create a hash table.  The code that I 
actually wrote is more complicated and contained names and email addresses as 
key/value, so an array would not be an appropriate type to use.  Of course if I 
wanted to write a code like above (where the key is basically the index) I would 
use an array instead of a hash table.

> : In the latter, I can actually split the hash using the "," as the delimiter.  
>
>    Eh?

That was my mistake, I should have had the second hash shown as below:

 %hash1 = ('1,element1', '2,element2'....so on);

Then I can split it:

 foreach (@hash1) {
    ($num,$ele)=split /,/;
        print "$num has $ele\n";
 }

Is it more clear what I mean now?

My question is basically WHAT would I use (if I can at all) to split the hash 
table created with the first method the way I did with the one created with the 
second method.

>    Are you processing Perl source code or something?

I don't understand your question.  I hope this was not meant as a condecending 
remark coming from a professional consultant.  If it was, it was uncalled for.  
I'm new at Perl and simply needed some help.  Everyone started from the buttom, 
even those who are experts today.

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

Novey Chou
-- 
remove QUASH SPAMMER from email address.


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

Date: Fri, 26 Mar 1999 02:33:02 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Help: Displaying Database search results
Message-Id: <36FAE3CE.1A890E2A@ngb.se>

slamda@hotmail.com wrote:
> Hi,
> I've successfully written some code to use a HTML form to query a SQL
> database and return the results as an HTML page, however I would like
> to display only a certain range of the result set each time (ie
> matches 1-10 on 1st page, 10-20 on the second etc, etc)

I also replied to this question before. Check

http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=453057977

>Posted via Deja News, The Discussion Network

It's interesting when people post from Deja News without checking the
archives. 

Staffan


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

Date: Thu, 25 Mar 1999 12:59:09 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: need help getting started!
Message-Id: <dhtdd7.to.ln@magna.metronet.com>

sheela tiwary (stiwar1@gl.umbc.edu) wrote:

: I have a simple perl script that works fine when I run it in the UNIX
: environment.  However it won't run on the web-page, the web page just
: displays the contents of the file instead of the results.

: I would appreciate any suggestions on how to fix this problem.


   I would suggest seeing your Frequently Asked Question in
   the Perl FAQ, part 9:

      "My CGI script runs from the command line but not the browser.
       (500 Server Error)"


   Another suggestion is that there is some sort of server
   configuration problem, or you are not doing what you
   are supposed to do for the server to recognize your
   CGI program.

   ... but Perl doesn't *have* any "server", so you have landed
   in the wrong newsgroup.

   You have a better chance of getting server/CGI questions
   answered in a newsgroup that is in some way connected
   to servers/CGI (this newsgroup is not one of those):

      comp.infosystems.www.authoring.cgi
      comp.infosystems.www.servers.mac
      comp.infosystems.www.servers.misc
      comp.infosystems.www.servers.ms-windows
      comp.infosystems.www.servers.unix


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


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

Date: Thu, 25 Mar 1999 20:27:13 -0600
From: David Robins <dbrobins@uwaterloo.ca>
Subject: Re: Problem writing a file... file permissions ok on computer
Message-Id: <36FAF081.246E39E3@uwaterloo.ca>

William Flanagan wrote:
> 
> All-
> 
> I'm trying to write a perl script that takes a structured text file, and
> converts it to a comma delimited file.  The problem that I am having is that
> I can't get it to write the file.  I've tried everything.  I'm writing 

Think about what happens when the output file doesn't exist: what is
$mode?  (Answer below, if you really need it :).

> if ( -e $outfile) {
>     print STDERR "Output file $outfile exists!\n";
>     until ($ans eq 'r' || $ans eq 'a' || $ans eq 'e' ) {
>         print STDERR "replace, append, or exit? ";
>         $ans = getc(STDIN);
>         }
>     if ($ans eq 'e') {exit}
>     }
>     if ($ans eq 'a') {$mode='>>'}
> 
>     else {$mode='>'}
> 
> open(OUTPUT,"$mode$outfile") ||
>     die "Can't create $outfile file, ensure that it does not exist $!";

$mode is undefined UNLESS the file exists and the user selects an
option.  If the file doesn't yet exist, $mode is never set.  Default to
opening for write/create by inserting "$mode = '>';" before the 'if(-e
 ...' test.  (That also lets you leave off the final else in the inner if
block above).

Dave
Isa. 40:31


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

Date: 26 Mar 1999 00:28:41 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Reading results of external commands
Message-Id: <slrn7fll5p.gfu.sholden@pgrad.cs.usyd.edu.au>

On Thu, 25 Mar 1999 14:51:19 -0800, Matt Riggsby <mriggsby@sybex.com> wrote:
>
>I'd like to run a shell command (say, through the system command) and
>read the results of that command into a variable.  For example, I'd like
>to be able to have perl run a line like:
>
>command('ipconfig');
>
>...and get back my IP address, subnet mask, and default gateway, or at
>least get back data in a variable or array that I can parse to extract
>the desired data.  Ultimately, I want to use this with some command-line
>utilities to do some reverse DNS fun and games that will be a little
>more far-reaching than what I can get out of gethostbyaddr. 
>Suggestions?  I'm using perl 5 on an NT box, if that matters.

You could try reading the documentation that comes with perl.

Sine you mentioned the 'system command' why don't you try reading the
documentation for it.

perldoc -f system

No it isn't the function you want, but it does contain the sentence :

This is NOT what you want to use to capture the output from a command,
for that you should use <snipped since you can read your own docs> ...

Which may be of use to you.

-- 
Sam

So I did some research. On the Web, of course. Big mistake...
	--Larry Wall


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

Date: Thu, 25 Mar 1999 16:18:05 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: regular expression
Message-Id: <36FAD23D.A2696E97@mail.cor.epa.gov>

Larry Rosler wrote:
> 
> In article <36FA945D.B14016AD@mail.cor.epa.gov> on Thu, 25 Mar 1999
> 11:54:05 -0800, David L. Cassell <cassell@mail.cor.epa.gov> says...
> ...
> > You can just write this as:
> >      print HH "$value";
> 
> Let's not get people into the bad habit of double-quoting simple scalar
> strings.  It is unnecessary and misleading.
> 
>        print HH $value;

DOH!  Man, what was I thinking?  Oh yeah, I was just cut-and-pasting
the sample code and probably not being careful enough with my
editing.  Now you know why I *have* to use -w and 'use strict'.  :-)

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 25 Mar 1999 20:07:39 -0500
From: "Mark David!" <markd@netwater.com>
Subject: remote user password
Message-Id: <36FADDDB.243@netwater.com>

is there a way in perl that when you use the basic authorization over
the web that generates the authorization dialog box, asking for user
name and password (.htaccess & .htpasswd), that when the REMOTE_USER
enters a password that is incorrect, to have that information passed
into a log?

Basically, I have a logging system on my domain that logs 404's, 403's
and 401's.  What I want when it logs 401's is to have the password the
user tried also passed along to the log in addition to the REMOTE_USER
variable.

Is this possible?

Thanx
mark

P.S.  While I'll check this forum for responses, emailing me would be
the best bet.  Thanx.


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

Date: 25 Mar 1999 18:52:20 -0700
From: Eric The Read <eric.schwartz@acm.org>
Subject: Re: remote user password
Message-Id: <xkf1zidhvaj.fsf@valdemar.col.hp.com>

"Mark David!" <markd@netwater.com> writes:
> is there a way in perl that when you use the basic authorization over
> the web that generates the authorization dialog box, asking for user
> name and password (.htaccess & .htpasswd), that when the REMOTE_USER
> enters a password that is incorrect, to have that information passed
> into a log?

Er, unless, I'm sorely mistaken, perl doesn't generate any authorization
dialog boxes, and doesn't have a log.

> Basically, I have a logging system on my domain that logs 404's, 403's
> and 401's.  What I want when it logs 401's is to have the password the
> user tried also passed along to the log in addition to the REMOTE_USER
> variable.
> 
> Is this possible?

Pelr doesn't have 404's, 403's, or 401's, and doesn't log them either.
This sounds like a web server problem, for which you should consult your
web server documentation (if it's apache, it's all online at
<URL:http://www.apache.org/docs/>).  If you can't find it there, one of
the comp.infosystems.www.servers.* newsgroups would be infinitely more
appropriate.

> P.S.  While I'll check this forum for responses, emailing me would be
> the best bet.  Thanx.

Sorry.  Ask it here, it gets answered here.

-=Eric


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

Date: 26 Mar 1999 01:59:32 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Running a perl script as a daemon....
Message-Id: <7depm4$gcf$1@info2.uah.edu>

In article <7dedl5$ti0$1@reader1.reader.news.ozemail.net>,
	"Diggy Tim" <tim@diggy.com> writes:
: How do I go about running a perl script from the command line and have it
: sit in the background and not die when I log out.

I wonder whether this should go in the FAQ.

This is a transliteration of Stevens[1].

    use POSIX qw( setsid );

    sub daemon_init {
        my $pid;

        return unless defined($pid = fork);

        exit 0 if $pid != 0;  # parent goes bye-bye

        # child continues
        setsid;     # become session leader

        chdir "/";  # change working directory

        umask 0;    # clear our file mode creation mask

        1;
    }

[1] Stevens, W. Richard. _APUE_. Program 13.1. pg. 418.

Hope this helps,
Greg
-- 
People who comprehend a thing to its very depths rarely stay faithful to it
forever. For they have brought its depths into the light of day: and in the
depths there is always much that is unpleasant to see. 
    -- Nietzsche


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

Date: Thu, 25 Mar 1999 17:46:42 -0800
From: "Nathan" <NOSPAMpenner@jps.net>
Subject: Sorting multidimensional arrays
Message-Id: <36fb5ce8.0@news1.jps.net>

Hello,

I was wondering how to sort a multidimensional array.  What I will need to
do is take a 2-dimensional array, and be able to sort the elements of the
first dimension in the order of any of the second dimensions.  For example,
say i have an array, called array.

array[0][0] = B, array[0][1] = 3, array[0][2] = X
array[1][0] = A, array[1][1] = 2, array[1][2] = Z
array[2][0] = C, array[2][1] = 1, array[2][2] = Y

What I need to do is sort the array by one of the sub-items.  For example,
If I sorted the array by element 0, array[1] would become array[0], array[0]
would become array[1], and array[2] would stay array[2].  So in the new
array, array[0][0] would be A, array[1][0] would be B, and array[2][0] would
be c.

When put in use, each of the first level of the array would be a site to
link to, and each sub-element would be a piece of information about the site
(Title, URL, author, etc..).  Ultimately, the end result would be to sort
the list of sites by any of these elements (Title, URL, author, etc..).


I would appreciate it if any replies could also be sent to
NOSPAMpenner@jps.net (take out the NOSPAM).

Thank you in advance,
Nathan P.




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

Date: Fri, 26 Mar 1999 00:19:10 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: STDOUT to HTML
Message-Id: <7dejre$hdg$1@oak.prod.itd.earthlink.net>

domat6905@my-dejanews.com wrote:
>I want to execute a system command (e.g. "ls directory") and show otput on the
>Web page. What would be the proper way to to this?
>I'm trying following code but it doesn't appear in the browser:
>
>#!/usr/bin/perl
>
>require "cgi-lib/cgi-lib.pl";
>
>@pag = 'radlist';
>....
>print &PrintHeader;
>print "<html><body>@pag</body></html>";
>....

perldoc -f opendir
perldoc -f readdir
perldoc CGI


#!/usr/bin/perl -w
use strict;
use CGI qw( :standard );
opendir DIR,"/path/to/directory" 
        or die "Open crapped out: $!";
print header,start_html(Directory listing");
print map { "$_<br>\n" } readdir(DIR);
print end_html;
closedir DIR;

HTH

Bob Trieger
sowmaster@juicepigs.com       



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

Date: Thu, 25 Mar 1999 20:34:27 -0600
From: David Robins <dbrobins@uwaterloo.ca>
Subject: system behaving strangely (Win32)
Message-Id: <36FAF232.8B590939@uwaterloo.ca>

I'm running a script that uses system() to run a program and process its
output.  It works fine when I run it from the command line (NT) but when
the Windows (NT) scheduler runs it, it runs the program specified by
system() then the script exits.

Using ActivePerl (5.005 or so), NTsp4, Scheduler from the MS IE tools
web page.  The scheduler runs a .cmd file which runs Perl as follows:

c:
cd\scripts
perl c:\scripts\myscript.pl -cblank.cfg >> myscript.log

Any help appreciated (please cc: to dbrobins@uwaterloo.ca).

Thanks,
Dave


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

Date: Fri, 26 Mar 1999 01:20:07 GMT
From: jennifer@usenix.org (Jennifer Radtke)
Subject: Tcl/2k : The 7th USENIX Tcl/Tk Conference Call for Papers
Message-Id: <F96H1J.Gy0@usenix.org>
Keywords: USENIX, Tcl/TK, Tcl, TK, conference, tutorials, training,  Invited Talks, research, Refereed Papers, Unix, Cross-Platform Development, CGI Scripting, Object Oriented Programing, [incr Tcl], Mega Widgets, Database, Client/Server Applications, extension Building, SWIG, C, Debugging, testing, Packaging, Java, HTTP Tcl Daemon, CGI-BIN, mapping, embedding, applications, commands, Data Objects, Tycho Slate, WinACIF, Iclient/Iserver, Distributed, language, management, Yacc, Corba, Novell, extensions, designing, supporting, developing, portable, opensource GUI, rapid-development, extensible, X11 Windows

Tcl/2k : The 7th USENIX Tcl/Tk Conference
   February 14-18, 2000
   Austin, Texas, USA

Sponsored by USENIX, The Advanced Computing Systems Association

================================================================
Important Dates
Paper, Demonstration, and Panel Proposals due: September 1, 1999
Poster submissions due: December 8, 1999
================================================================

The 7th USENIX Tcl/Tk Conference is a forum to:
         * bring together Tcl/Tk researchers and practitioners
         * publish and present current work involving Tcl/Tk
         * learn about the latest developments in Tcl/Tk
         * plan for future Tcl/Tk related developments

The conference program will include formal paper and panel
presentations, poster and demonstration sessions, works in progress
(WIP) sessions, Birds of a Feather (BOF) sessions, and tutorials.  All
forms of participation provide an opportunity to report on original
Tcl/Tk research. Formal papers should address topics of interest to
experienced Tcl/Tk programmers; posters and informal demos may be geared
to any level of user from beginner to expert.

Best Paper Awards will be given for the best paper and best student
paper at the conference.
=======================================================================
USENIX is the Advanced Computing Systems Association.  Our international
membership includes engineers, system administrators, scientists, and
technicians.  Our conferences are recognized for delivering pragmatic,
technically excellent information in a highly interactive,
vendor-neutral forum.





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

Date: Thu, 25 Mar 1999 16:58:54 -0800
From: "Dave Roth" <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Subject: Re: Using Win32::Perms
Message-Id: <PXAK2.5822$_47.6143@news2.giganews.com>

keydet89@yahoo.com wrote in message <7dbekh$lmq$1@nnrp1.dejanews.com>...
>Has anyone got any experience using Dave Roth's Win32::Perms?  I tried
>emailing 'roth@roth.net' and got a 'user unknown' error message...
>
>Anyway, I am using ActivePerl build 509, and Dave's Win32::Perms module.
>I have no trouble creating a Perms object, and can get the array of hashes
>that describe the ACEs.  However, I need to know the specific Index,
>Account, Mask, Type, etc...the same stuff that's displayed by the Dump
>method, but I don't want it sent to STDOUT...


Once you have a Win32::Perms object and have dumped it into an array:
  $Perm->Dump( \@List );

You can extract the Mask, Flags and other stuff by accessing the data in the
@List array. Each array element is an anonymous hash containing the
following
values:
  DB<13> X List
@List = (
   0  HASH(0x9b9d5c)
      'Access' => 'Allow'
      'Account' => 'Rothd'
      'Domain' => 'ROTH.NET'
      'Entry' => 'DACL'
      'Flag' => 2
      'Mask' => 268435456
      'SID' => 'S-1-5-21-143984352-578909669-1869494990-1001'
      'Type' => 0
   1  HASH(0x9b9dd4)
      'Access' => 'Audit'
      'Account' => 'Rothd'
      'Domain' => 'ROTH.NET'
      'Entry' => 'SACL'
      'Flag' => 64
      'Mask' => 268435456
      'SID' => 'S-1-5-21-143984352-578909669-1869494990-1001'
      'Type' => 2
   2  HASH(0x9b9e4c)
      'Account' => ''
      'Domain' => ''
      'Entry' => 'Owner'
      'SID' => ''
   3  HASH(0x9b9e94)
      'Account' => ''
      'Domain' => ''
      'Entry' => 'Group'
      'SID' => ''

Notice that you can access the permission mask for user ROTHD with:
  $Mask = $List[0]->{Mask};

You can now decode the mask (break it into human readable strings):
  Win32::Perms::DecodeMask( $Mask, \@Perms );

With the next release you will be able to do this (to make things just
a tad easier):
  Win32::Perms::DecodeMask( $List[0], \@Perms );

Remember that this is a beta release and some functions may change.
dave

--
=================================================================
Dave Roth                                ...glittering prizes and
Roth Consulting                      endless compromises, shatter
http://www.roth.net                     the illusion of integrity
Win32, Perl, C++, ODBC, Training
rothd at roth dot net

Our latest Perl book is now available:
"Win32 Perl Programming: The Standard Extensions"
http://www.roth.net/books/extensions/
 .dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Thu, 25 Mar 1999 18:28:29 -0600
From: "Randy Chambers" <chambers@HATESPAMdfw.net>
Subject: Want to hire someone to make changes to Perlshop
Message-Id: <7dekal$lo6$1@fnord.nationwide.net>

Looking to pay someone to make some changes in the Perlshop script. Simple
for a programmer minor changes.

Please contact via e-mail at address below. (remove IHATESPAM from address)

--
Randy Chambers
chambers@IHATESPAMdfw.net
Guess what to remove.....




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

Date: Fri, 26 Mar 1999 01:37:16 GMT
From: anne@NOstormSPAM.ca (Chris Tremblay)
Subject: Re: Where to start with Perl
Message-Id: <36fae3d9.342466@news.storm.ca>

I used Sams book for learning Java and it is pretty good.
For Perl I personally used Discover Perl 5. It explains the basics of
Perl but doesn't go into powerusing. (Leave that for another book i.e
O'Reillys ) but it is a great starter. That may be what you need.
Something to start to get you running and then once you got the hang
of that get something with more advanced stuff. Although it has a bit
on CGI, which is handy it also covers it if you are running it on
Win95. Thing it doesn't have is from an administration point of view
for example setting up environmental variables.

On Sun, 21 Mar 1999 15:25:48 -0800, Ed Wolfe <ewolfe@involved.com>
wrote:

>Rick Poleshuck wrote:
>
>[snip]
>
>> If you have the time, _Teach Yourself Perl 5
>> in 21 Days_ from Sams is an unlikely, but excellent book. I have used this
>> book to teach Perl in training seminars.
>
>Would you recommend that book to someone with no programming experience
>or knowledge at all? (Not counting what I did at home with a TI back in
>'82.)
>
>There are a lot of resources online and in print, but everything I've
>seen so far assumes pre-existing programming knowledge, EVEN when it
>specifically says it doesn't assume such.
>
>The closest thing I've found so far to an introduction to Perl for
>non-programmers is at:
>
>http://www.netcat.co.uk/rob/perl/win32perltut.html
>
>It goes great until I get to accessing arrays and then I start losing
>it.  The next section is on for loops and all  hope is lost.
>
>Example:
>
>@names=("Muriel","Gavin","Susanne","Sarah","Anna","Paul","Trish","Simon");
>
>for ($x=0; $x <= $#names; $x++) {
>        print "$names[$x]\n"; 
>}
>
>$x has the value of 0 and there's an end of line semicolon. But then it
>says lesser than equals the array "names" then increment 0 one time??
>Then print the name Muriel??
>
>So, I'm looking for a way to learn Perl that doesn't assume I know
>how to program already or know Unix. I'm using the latest release of
>Perl from Active State on Win95.
>
>I read a review that said Perl For Dummies has some really bad
>technical errors so that scared me out of buying what would probably
>be the most introductory thing I could find.
>
>I also have Learning Perl but after page 12 it starts turning
>into Greek.
>
>Does anyone have any online or print recommendations for a total
>beginner?
>
>Thanks.
>
>Ed



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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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