[7024] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 649 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 24 01:07:20 1997

Date: Mon, 23 Jun 97 22:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 23 Jun 1997     Volume: 8 Number: 649

Today's topics:
     Re: "odd number of elements" warning with {} (Tad McClellan)
     Re: a perl mode in emacs that does a better job with qu (Ilya Zakharevich)
     Re: back quote problem <rootbeer@teleport.com>
     Re: can one check external ports ? <rootbeer@teleport.com>
     Re: CGI Programming using PERL <rootbeer@teleport.com>
     Re: code/module for Fisher Exact Test <rootbeer@teleport.com>
     Re: CSV Files <wesley@woais.com>
     Help with pushing user to a page (Philip Wagnert)
     Help with script (Eric Blessner)
     Re: Help: Reading in from a pipe <rootbeer@teleport.com>
     Re: interprets as shell instead of perl <rootbeer@teleport.com>
     Re: leading zeroes <justinb@cray.com>
     Re: leading zeroes <rootbeer@teleport.com>
     Re: Ordinary user id <rootbeer@teleport.com>
     Re: Perl 5.003... <rootbeer@teleport.com>
     Re: print statement question <rootbeer@teleport.com>
     Random access files in PERL <donb@wcnet.org>
     Re: Random access files in PERL <merlyn@stonehenge.com>
     Re: reading a data file? (Bob)
     Re: Recursion <rootbeer@teleport.com>
     Re: Setting a script's user ID <rootbeer@teleport.com>
     Re: uc function for PERL4 <rootbeer@teleport.com>
     Uploading in Perl 5 <program@mindless.com>
     Re: URGENT HELP! Need to add function to script <rootbeer@teleport.com>
     Re: Verifying the modules version number <rootbeer@teleport.com>
     Re: what is my, lc and etc and where to learn it? <rootbeer@teleport.com>
     Re: what is my, lc and etc and where to learn it? <merlyn@stonehenge.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 21 Jun 1997 20:44:38 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: "odd number of elements" warning with {}
Message-Id: <620io5.205.ln@localhost>

mike mah (esupu@warwick.ac.uk) wrote:
: On 19 Jun 1997, Brian Wheeler wrote:

: > 	It odd, though.  You're assigning the hash foo to a _hash reference_,
: > which is a single item, therefore odd.  If you want to assign an empty hash,
: > just use %foo=().


: > 
: 	There is no reason why you need to initialise associative array.
                 ^^
                 ^^

What if you already have a bunch of stuff in %foo and you want
to empty it out?

I would call that a reason...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 24 Jun 1997 01:10:29 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: a perl mode in emacs that does a better job with quotes?
Message-Id: <5on6q5$8mf@agate.berkeley.edu>

In article <omen9ugtqg.fsf@tees.cs.ualberta.ca>,
Vladimir Alexiev  <vladimir@cs.ualberta.ca> wrote:
> In article <wriuz9vhp4.fsf@esrin.esa.it> Simon Marshall <Simon.Marshall@esrin.esa.it> writes:
> 
> > Ilya added the low-level support for per-character syntax to Emacs

 ..

> With per-char syntax, one can go even further! Now we can overload the space
> following the ` on the next line to mean "cout", and the dot after it to mean
> operator<<, so ` ."blorf"' would mean "print" pretty much like Forth.
> 
> And the space-dot on thes line would mean "read": ` .foo'. Now every
> programmer can create their own argot! We don't need to stinkin PGP!
> 
>  ."yep"

Your joy is greately misplaced, what you want is already there in
19.33 (? or around).  You need only input/output filters for C++ mode
of emacs.

Ilya


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

Date: Sat, 21 Jun 1997 15:34:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tony Arnold <Tony.Arnold@mcc.ac.uk>
Subject: Re: back quote problem
Message-Id: <Pine.GSO.3.96.970621153021.24220Z-100000@kelly.teleport.com>

On 20 Jun 1997, Tony Arnold wrote:

> I am running Perl 5.001 on a Windows 95 system both in the office and on
> my home machine and they behave differently!

Same version and build? There are more recent builds available; maybe you
should try one.

> $cd = `cd`;
> print "CD = $cd\n";
> 
> On the Cirix system it does just what you would expect. On the 166
> system, the cd command gets executed but its output goes to the screen
> and the $cd variable gets assigned an empty string. 

Maybe the system's cd command is doing something different on the two
machines. Try running it from the shell with output redirected to a file
and see whether it's the same. (That is, on both machines, this should
send to the file the same thing that Perl is seeing from the backticks.
Anything sent to the screen is something that would be sent to the screen 
when the command is called from Perl.)

     cd >tempfile.txt

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/



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

Date: Sat, 21 Jun 1997 15:53:43 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: tony@toners.com
Subject: Re: can one check external ports ?
Message-Id: <Pine.GSO.3.96.970621155236.24220f-100000@kelly.teleport.com>

On Thu, 19 Jun 1997, Tony Reeves wrote:

> I have an assignment to check all our ip addresses for web servers. 
> is there an easy way to use perl to go out and check known IP addresses
> for ports 80, 8080, 81 and etc?

Sure. Install SATAN. :-)  

But maybe you want to use LWP (from CPAN) to make a socket connection.
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/



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

Date: Sat, 21 Jun 1997 15:47:10 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: email.my@usa.net
Subject: Re: CGI Programming using PERL
Message-Id: <Pine.GSO.3.96.970621154458.24220d-100000@kelly.teleport.com>

On Sat, 21 Jun 1997 email.my@usa.net wrote:

> I want to learn cgi programming using perl, can any body help me. I have
> C programming experience of 7 years.

You should first learn Perl, then see about how to do CGI programming in
it. I teach classes in both, and I occasionally have open-enrollment
classes which you might be able to sign up for. Let me know by private
e-mail if you're interested. 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/



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

Date: Sat, 21 Jun 1997 14:52:56 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Marc Weeber <marc@farm.rug.nl>
Subject: Re: code/module for Fisher Exact Test
Message-Id: <Pine.GSO.3.96.970621145223.24220Q-100000@kelly.teleport.com>

On 20 Jun 1997, Marc Weeber wrote:

> I'm looking for perl code or a perl module for a Fisher Exact test for
> contingency tables. Does anyone have it/knows something about it? If
> you do, please post or mail a message.

If it's not in the Perl modules list, you're welcome to write one and
submit it to CPAN. :-)  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/



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

Date: Sat, 21 Jun 1997 19:17:31 -0500
From: Wesley Miaw <wesley@woais.com>
To: Christopher Kings-Lynne <chriskl@tartarus.uwa.edu.au>
Subject: Re: CSV Files
Message-Id: <33AC6F1B.23E5@woais.com>

Christopher Kings-Lynne wrote:
> 
> Has anybody got a Perl script which can read in CSV files?
> 
> Otherwise, can anybody tell me what the syntax error in the following code
> is? (Near the if apparently)
> 
>     while (($line eq &read_file("FILE1"))) {
>       # split the fields at the , character
>       @tabledata = split(/,/,$line);
> 
>           if ( ($tabledata[0] ge $start) && ($tabledata[0] le $stop) ) {
>             print "<TR>\n";
>             foreach $data (@tabledata) {
>               print "<TD><B>$data</B></TD>\n";
>             }
>             print "</TR>\n";
>             $counter++;
>           }
>     }

Well, 'eq' is a comparison operator, not an assignment, so whatever you
read in is not being stored in $line.
-- 
Wesley Miaw                               wesley@woais.com
World of Artists Internet Services        http://www.woais.com/
71 Middlesex Drive                        Tel: 518-439-0412
Slingerlands, NY 12159                    FAX: 518-439-9722


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

Date: Sat, 21 Jun 1997 22:53:54 GMT
From: pwagnert@algonet.se (Philip Wagnert)
Subject: Help with pushing user to a page
Message-Id: <33ac5b6c.2665987@news.algonet.se>

Hi there all helpers!


I'm kind of new to perl but have worked with it a bit the last months.
But now I would like a script for pushing to a page if some certain
criteria are met.
The criteria in this case is the time. If the time on the server is
BEFORE 13.00, a user is sent to a certain page - let's call it
"before.html". If the time is between 13.00 and 14.00, the user will
be sent to page "now.html", and if the time is past 14.00, then the
user will be sent to page "toolate.html".
This should probably, with your expertise in this kind of things, be
very easy...

But... If it is possible, I would also like it to be a little bit
improved...
I only want this thing to happen certain days. The file for each day
is unique, so the files names follow this pattern: "YY-MM-DD.html".
I want the script to first see if the appropriate date is found in a
little text-file containing information in this way:

97-06-20
97-06-22
97-06-23
97-06-26

If the script finds the date in the text-file, it will run the routine
with the before and after 13.00-14.00 I described above. Then if the
time is before, the user will be sent to "before.html", if it is in
the right time-period - the user will be sent to "YY-MM-DD.html" and
if the user is too late - the page will be "toolate.html".

I know this is pretty much, but I certainly hope someone will help me!
That would be really nice of you!

Thank you very much in advance.
An answer to my e-mail address is appreciated a lot!

Regards
Philip Wagnert
pwagnert@algonet.se


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

Date: Mon, 23 Jun 1997 21:25:49
From: edb105@psu.edu (Eric Blessner)
Subject: Help with script
Message-Id: <edb105.1.00156ECB@psu.edu>

Hello, I dont really know alot about perl but I do need help with a script.  
Someone wrote this script for me and Im almost there but I would really 
appreciate any help.

Here is what I have.   The script pulls the data out of a flat file and loop 
through until finished.   My problem is I dont know how to do a if else 
statement.   I want the first if to run and just output the data.  If it does 
not qualify I want it to run the next senerio.   Everytime I try it with the 
if and else I get a server area.  Please help

Code before.


while (<F>) {    
    
        &getfields();

       if($JobCategory eq "Development and Fund Raising"){
              &listitem3();	      
    
}
       next if ($jobcat ne $JobCategory); 
       &listitem();
     }
} elsif ($command eq "jobcode")  {


rest of code

Eric Blessner


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

Date: Sat, 21 Jun 1997 15:29:26 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: hankster <hankster@magmacom.com>
Subject: Re: Help: Reading in from a pipe
Message-Id: <Pine.GSO.3.96.970621152729.24220Y-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, hankster wrote:

> I'm trying to open a process using a pipe and reading in the output from
> the process. When I run the process from the command line, the output is
> fine, however when I try to run it from within a perl script I am unable
> to read any output from the process. 
> 
> Here is an example of what I'm trying to do.
> 
> open(PROC,"pipe.pl |");
> while($input = <PROC>)
> {
>    print $input;
> }

First, let's fix that up a little.

    open PROC, 'pipe.pl |'
	or die "Can't fork: $!";
    while (defined($input = <PROC>)) {
	print $input;
    }
    close PROC
	or die "pipe.pl reports error status $?";

Now, that won't fix everything, but it's a start. Does that tell you
anything interesting when you run 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/



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

Date: Sat, 21 Jun 1997 15:38:37 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: AtaruM76 <atarum76@aol.com>
Subject: Re: interprets as shell instead of perl
Message-Id: <Pine.GSO.3.96.970621153544.24220a-100000@kelly.teleport.com>

On 20 Jun 1997, AtaruM76 wrote:

> I am having a problem, I have the following test cgi:

> #!/usr/bin/perl

[ remainder snipped ]

> and what is happening is that the os keeps trying to interpret it as a
> shell script, and doesn't call perl! 

Sounds like a problem with the way your system is set up. Check the docs
for your system and your webserver; it's not Perl's fault, since perl is
never being executed! :-)  But see the hack for getting the Bourne sh to
run your script; it's in the Camel or online docs.

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/



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

Date: Sun, 22 Jun 1997 11:09:16 -0500
From: Justin Banks <justinb@cray.com>
Subject: Re: leading zeroes
Message-Id: <33AD4E2C.446B@cray.com>

Trey Valenta wrote:
> 
> In <33a96f4f.0@amhnt2.amherst.edu> bgjohnso@unix.amherst.edu (Brad Johnson) writes:
> 
> >: Mariana Wuerz <mariana.wuerz@fernuni-hagen.de> writes:
> 
> >: > $four=04
> >: >
> >: > How can I get $four=4?
> >:         } # end sub nozeros
> 
> Or $four *= 1; and convert it to a number from a sting.
> --
> Trey Valenta    trey@zipcon.net


$four =~ s/0+(\d+)/$1/o;

--
Justin Banks
Silicon Graphics Cray Research
Eagan, Minnesota


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

Date: Sun, 22 Jun 1997 11:08:39 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Justin Banks <justinb@cray.com>
Subject: Re: leading zeroes
Message-Id: <Pine.GSO.3.96.970622110755.23485H-100000@kelly.teleport.com>

On Sun, 22 Jun 1997, Justin Banks wrote:

> $four =~ s/0+(\d+)/$1/o;

I don't like what that does when $four is 1000. :-)

-- 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/



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

Date: Sat, 21 Jun 1997 15:42:07 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: David Cross <davidc@wrs.com>
Subject: Re: Ordinary user id
Message-Id: <Pine.GSO.3.96.970621153912.24220c-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, David Cross wrote:

> Newsgroups: comp.lang.perl.misc

> Apologies for cross-posting a cgi question, 

You didn't cross-post it. You posted it only to the Perl newsgroup. (You
may have also posted it only to another newsgroup, but that's multiply
posting, not cross-posting. And you shouldn't do that.) If you thought it
was more appropriate for another newsgroup, why did you post it here
anyway?

> but here is the situation:
> 
> I need a cgi script to handle check-out, un-checkout, and check-in of
> documents (not code) to the ClearCase revision control system. The
> machine with our web server (or maybe a CC default?) won't permit CC
> processes to run for user "nobody." I need those scripts to run as _ME_
> and not as "nobody". No wide open barn doors, no root passwords. What is
> the best way to give a Perl cgi script the id and group id of an
> ordinary user?? I hope it isn't a C wrapper, but any advice is welcome.

Sounds like you want to make it setuid, if your system (and possibly
whoever compiled perl) lets you do that with scripts. Read perlsec(1)
before you do that, though. 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/



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

Date: Sat, 21 Jun 1997 15:16:06 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: John Sanabria <josanabr@calvin.univalle.edu.co>
Subject: Re: Perl 5.003...
Message-Id: <Pine.GSO.3.96.970621151111.24220U-100000@kelly.teleport.com>

On 20 Jun 1997, John Sanabria wrote:

> Subject: Perl 5.003...

Please read the frequent posting about choosing good subject lines.

> Hi, i have a problem. Why i can't run scripts, with options.

I don't know, why can't you? :-)

> #!/usr/bin/perl -w  # don't work
> #!/usr/bin/perl     # work...
> 
> obviously i can't see the warn messages, and the others thing.

Saying that it "don't work" isn't clear. Does it do nothing? Does it give
you a warning message? Is the message listed in perldiag(1)? Does smoke
come out of your computer? 

I think you're saying that you aren't successful in putting the -w option
at the top of your script, but that's still unclear. Are you saying that
perl doesn't give you warnings when you ask for them, or that you don't
know why Perl is giving you those particular warnings? 

If your warning messages are listed in perldiag(1), that could be all you
need. 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/



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

Date: Sat, 21 Jun 1997 15:21:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Gary Ebert <garye@iname.com>
Subject: Re: print statement question
Message-Id: <Pine.GSO.3.96.970621151900.24220W-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, Gary Ebert wrote:

> print TEMPFL "\nThere are $modem_counter out of ${MAXDIALINS} modems
> being used\n";

> $moden_counter and $count are initiliazed to 0.

You _do_ mean $modem_counter there, don't you? If you're initializing the
wrong variable, that might cause something like the behavior you're
seeing. 

> If $modem_counter is still zero at the end of my script I get the
> following output:
> 
> There are   out of 7 modems being used

That shouldn't be the case. If that's your output, then $modem_counter
seems to have been set to a single space. Could you check your script to
be certain that you didn't do that somehow? 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/



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

Date: Mon, 23 Jun 1997 16:58:18 -0400
From: Don Botten <donb@wcnet.org>
Subject: Random access files in PERL
Message-Id: <33AEE36A.7EA9@wcnet.org>

I want to read and write to Random access files.  For example, I want to
be able to change only one record of a file, or goto a particular spot
to read some data.  I have a few of Sams books on perl but cannot find
anything on random access files.

Can anyone point me in the right direction?

Thanks.

donb@wcnet.org


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

Date: 23 Jun 1997 18:56:48 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: donb@wcnet.org
Subject: Re: Random access files in PERL
Message-Id: <8clo407ogv.fsf@gadget.cscaper.com>

>>>>> "Don" == Don Botten <donb@wcnet.org> writes:

Don> I want to read and write to Random access files.  For example, I want to
Don> be able to change only one record of a file, or goto a particular spot
Don> to read some data.  I have a few of Sams books on perl but cannot find
Don> anything on random access files.

Perl has C-like seek(), tell(), and read() functions and sends output
with print() (not write).  See the relevant Perl docs for these.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 434 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: Tue, 24 Jun 1997 03:59:41 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: reading a data file?
Message-Id: <5onfs1$to$1@news3.voicenet.com>

Brandon <weekend_warrior@mindless.com> wrote:
>What I need the script to do is read a data file with the information of
>the users in a format like:
>1234 = someone@somewhere.com
>4321 = someonelse@somewhere.com

open DATA, 'myfile.dat';
while(<DATA>) {
	chomp;
	($id, $addr) = split /=/;
	$myhash{$id} = $addr;
}
close DATA;

Now all pairs are stored in %myhash.
--
          - Bob
          http://www.voicenet.com/~bbell
          xxbbell@voicenet.com
          remove x's to reply



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

Date: Sat, 21 Jun 1997 15:52:01 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Arthur Merar <amerar@unsu.com>
Subject: Re: Recursion
Message-Id: <Pine.GSO.3.96.970621154804.24220e-100000@kelly.teleport.com>

On Sat, 21 Jun 1997, Arthur Merar wrote:

> I also posted this in the CGI group.  But maybe someone can help me
> here:

Why post it twice? You should crosspost it instead, if it's on-topic in
both. If it's not on topic, you shouldn't post it. 

> I have a CGI program that reads in an HTML file and prints it to the
> screen.  It also generates a gif, then prints some more HTML.
> 
> Basically, this is my page:
> 
> Content-Type: multipart/mixed;boundary=--BoundaryString\n\n
> \n

That doesn't look like a valid Content-type header, but I may be mistaken. 
Check the spec again. If you still have troubles, check the CGI newsgroup,
since this isn't a Perl problem. 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/



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

Date: Sat, 21 Jun 1997 15:10:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Chris Talent <cdt@teleport.com>
Subject: Re: Setting a script's user ID
Message-Id: <Pine.GSO.3.96.970621150723.24220T-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, Chris Talent wrote:

> 	I am trying to write a script that will run Netscape Mail's
> MTA-list command, then take that output and write up a quick address
> book in HTML format.  The script works fine when I'm logged in as root,
> but it outputs nothing when I'm logged in as anyone else. 
> 
> 	I think that the problem is that the MTA-list command needs to
> be executed by root - when I run it from the command line as any other
> user, I get nothing. 

This sounds like a file permission problem. Could you set the file to be
world-readable? (Of course, don't do this if you don't want it to be
readable by other users!)

Incidentally, I'd file a bug report to the authors of that MTA-list
command. If it can't read the file, it should report an error message.
Silently failing is not good programming.

> 	So, the question is: in perl, how can I call the MTA-list
> command as root?

You _could_ make your calling script setuid. I wouldn't, but if you must,
read perlsec(1) first. 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/



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

Date: Sat, 21 Jun 1997 15:17:25 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bruno Pagis <pagib@aur.alcatel.com>
Subject: Re: uc function for PERL4
Message-Id: <Pine.GSO.3.96.970621151656.24220V-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, Bruno Pagis wrote:

> I've written a uc (capitalize) function for PERL4.
> There is more than one way to do it. Anybody wloud have a better idea ? 

Yep. Install Perl 5. :-)

-- 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/



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

Date: Mon, 23 Jun 1997 22:56:03 -0500
From: Matt <program@mindless.com>
Subject: Uploading in Perl 5
Message-Id: <33AF4553.EA49661D@mindless.com>


--------------BFB7CC93D17DB2FAFAB0ABFE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Okay, I need to know how you can take a file that a user selects from
his/her hard drive, and upload it to your internet site.  This script
will be run on the server.  All I need is the way to access the users
file from the hard drive and open it, input from it, then put it on the
server NT4 System.  Thank you for your time...
                      -Matt (program@mindless.com)

--------------BFB7CC93D17DB2FAFAB0ABFE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Okay, I need to know how you can take a file that a user selects from his/her
hard drive, and upload it to your internet site.&nbsp; This script will
be run on the server.&nbsp; All I need is the way to access the users file
from the hard drive and open it, input from it, then put it on the server
NT4 System.&nbsp; Thank you for your time...
<CENTER><FONT FACE="Mistral"><FONT SIZE=+2>-Matt </FONT></FONT><FONT FACE="Comic Sans MS">(program@mindless.com)</FONT></CENTER>
</HTML>

--------------BFB7CC93D17DB2FAFAB0ABFE--



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

Date: Sat, 21 Jun 1997 15:06:43 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ben Lass <blass@unlinfo.unl.edu>
Subject: Re: URGENT HELP! Need to add function to script
Message-Id: <Pine.GSO.3.96.970621145827.24220S-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, Ben Lass wrote:

> Subject: URGENT HELP! Need to add function to script

> I need a response TODAY (Friday, June 20) if possible. 

Usenet can be fast, but it's not usually the best for "urgent" 
situations. 

> I am in urgent need of help to add a function to an already exisitng CGI
> perl script. WARNING: I'm not a Perl programmer and only have been able
> to understand enough of perl to take scripts others have done and modify
> them for our own uses, except for now. 

Perhaps you want to hire a programmer. If you need urgent help, there are
ways to purchase support contracts for Perl so that you can get assistance
right away. Depending upon your needs, you may wish to keep a programmer
on staff. 

On the other hand, maybe you want to learn Perl yourself. Once things have
become urgent it's kind of late to learn, but maybe you've learned enough
from this experience to know that you want to learn it yourself before
your next urgent situation. :-) 

> I need to be able to have the results of the quiz (score, percent,
> grade) e-mailed to a particular e-mail address. 

You could use either a module or a pipe to sendmail to do 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/



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

Date: Sat, 21 Jun 1997 15:26:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rick Tan <rst@Eng.sun.com>
Subject: Re: Verifying the modules version number
Message-Id: <Pine.GSO.3.96.970621152212.24220X-100000@kelly.teleport.com>

On Fri, 20 Jun 1997, Rick Tan wrote:

> How does one check the modules and their version number that are 
> included in Perl?

If they're included in Perl, you may need only to check the Perl version
number. 

With many modules, there's a version variable. Check the module's code to
see whether it's available. 

    $version = $ModuleName::VERSION;

If you have 5.004, check the new syntax for C<use Module VERSION LIST>,
which may do what you need. 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/



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

Date: Mon, 23 Jun 1997 18:55:30 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: mike mah <esupu@warwick.ac.uk>
Subject: Re: what is my, lc and etc and where to learn it?
Message-Id: <Pine.GSO.3.96.970623185332.15285G-100000@kelly.teleport.com>

On Mon, 23 Jun 1997, mike mah wrote:

> Although I finished reading Learning Perl, I never encounter my, lc and
> etc. Why is that so? 

Because the Llama is a beginning-level book, which isn't trying to cover
every aspect of the language. (Although I think those two items make it
into the new edition, which may be visible this fall.)

> Where can I get to learn complete (probably advance
> features) set of command (like above)? 

Mostly, you can look them up in the docs as you run across them. They're
all online or in the Camel. If you have a question about one of those
beyond what's in the docs, post it here. 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/



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

Date: 23 Jun 1997 18:55:01 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: mike mah <esupu@warwick.ac.uk>
Subject: Re: what is my, lc and etc and where to learn it?
Message-Id: <8coh8w7oju.fsf@gadget.cscaper.com>

>>>>> "mike" == mike mah <esupu@warwick.ac.uk> writes:

mike> 	I feel so strange, you know. Although I finished reading
mike> Learning Perl, I never encounter my, lc and etc. Why is that so?
mike> Where can I get to learn complete (probably advance features)
mike> set of command (like above)?

"Learning Perl" is not intended to teach "advanced features", but "my"
and "lc" and friends were considered fundamental enough that they made
it into the minor update that will be shipping in a few weeks.  (Yes,
we just put it "to bed".)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 434 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 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 649
*************************************

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