[15641] in Perl-Users-Digest
Perl-Users Digest, Issue: 3054 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 15 18:10:47 2000
Date: Mon, 15 May 2000 15:10:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <958428619-v9-i3054@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 15 May 2000 Volume: 9 Number: 3054
Today's topics:
net user equivalent jeffhenke@my-deja.com
perl & apache conf <duxbury@kentmere23.freeserve.co.uk>
Re: perl & apache conf <michael.holzer@attglobal.net>
Re: Perl and Apache Authentication <flavell@mail.cern.ch>
Re: Perl code editors? Scratch that <ctcampbe@uiuc.edu>
Perl code editors? <ctcampbe@uiuc.edu>
Re: Perl code editors? <sue@pennine.com>
Re: Perl ps2html <makarand_kulkarni@My-Deja.com>
Problem in overloading operator. <adih@valor.com>
Re: Producing arrays from quoted csv files from excel <lr@hpl.hp.com>
Re: Random Lists (Craig Berry)
Re: Random Lists <aqumsieh@hyperchip.com>
Re: Random Lists <lr@hpl.hp.com>
Re: Random Lists (Trent Seigfried)
Re: Random Lists <mouimet@direct.ca>
Re: Random Lists (Abigail)
Re: Reading and Writing to a file <lr@hpl.hp.com>
Re: Redirection/Pulldown menu cgiscript for MacPerl? <rootbeer@redcat.com>
Site update bzooty@my-deja.com
Specifying MIME type <mstone@mountaincreek.com>
Re: strings and limits <matt.stoker@motorola.com>
Re: strings and limits <lr@hpl.hp.com>
Re: Summary: Accidental Creation of Static Variable <mjcarman@home.com>
text file and perl <gounis@my-deja.com>
Re: text file and perl <trw@freewwweb.com>
Wanted: Perl Training <skpurcell@hotmail.com>
Re: What's this line which Perl added to AUTOEXEC.BAT? <sue@pennine.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 May 2000 19:36:53 GMT
From: jeffhenke@my-deja.com
Subject: net user equivalent
Message-Id: <8fpjki$tqt$1@nnrp1.deja.com>
is there easy a Perl equivalent to the net user command which will
provide a list of all the groups for a user?
I've been working with WIn32::NetAdmin and AdminMisc, but can't seem to
find a single function to do it. Someone suggested that I just run net
user to a file and run a Perl script using a regex to parse out a list
of groups...
seems like a lot of work. Perl is SO handy for almost everything else,
there's got to be a more direct way...
Jeff Henke
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 15 May 2000 21:59:07 +0100
From: "Ian" <duxbury@kentmere23.freeserve.co.uk>
Subject: perl & apache conf
Message-Id: <8fpocd$fa6$2@news8.svr.pol.co.uk>
I'm trying to create a Perl program that sends data that is entered into a
form to a web page.
This is a copy of some of the errors I'm getting in my errror.log file
[Mon May 15 19:12:18 2000] [error] [client 127.0.0.1] c:/program
files/apache group/apache/cgi-bin/p20_5.pl is not executable; ensure
interpreted scripts have "#!" first line
[Mon May 15 19:12:18 2000] [error] [client 127.0.0.1] (2)No such file or
directory: couldn't spawn child process: c:/program files/apache
group/apache/cgi-bin/p20_5.pl
[Mon May 15 19:14:09 2000] [error] [client 127.0.0.1] (2)No such file or
directory: couldn't spawn child process: c:/program files/apache
group/apache/cgi-bin/p20_5.pl
[Mon May 15 21:37:09 2000] [error] [client 127.0.0.1] (2)No such file or
directory: couldn't spawn child process: c:/program files/apache
group/apache/cgi-bin/p20_5.pl
=============================
These are my two programs
this is the HTML page
<html><body>
<FORM NAME="form1" action="http:/cgi-bin/p20_5.pl" method="post"
enctype="text/plain">
<B>Your Name:</B>
<INPUT TYPE="TEXT" NAME="name" SIZE=25>
<B>Phone:</B>
<INPUT TYPE="SUBMIT" VALUE="Submit name">
</FORM>
</BODY>
</HTML>
============================
And this is my perl prog
#!p20_5.pl
use CGI;
$wp=new CGI;
# fetch user name entered in form
$user_name =$wp->param ('user');
print $wp->header;
print $wp->start_html (
-title=>'A CGI script to interact with the user',
-bgcolor=>'white');
#send message back to user
print "<body>\n";
print "Hello, $user_name,\n";
print "welcome to my web page\n";
print "THIS IS A MESSAGE SENT TO $user_name BY THE WEB SERVER\n";
print "</body>\n";
print $wp->end_html;
=======================
I don't know if the address for the action attribute in the HTML form is
correct. On my httpd.conf file I am not sure what to write in as the server
name as I don't know my DNS number. I'm with freeserve and they have a
server assigned number. On the error files there is the number 127.0.0.1 is
this the number I should put in as my server number?
I'am new to all this so any jargon free advice would be appreiciated, I
realise that I have mailed to two completly different news groups, but I
feel that this mail message could apply to either group. Please go easy on
the bollockings.
------------------------------
Date: Mon, 15 May 2000 22:58:08 +0200
From: "Michael Holzer" <michael.holzer@attglobal.net>
Subject: Re: perl & apache conf
Message-Id: <39206647_4@news3.prserv.net>
|
|#!p20_5.pl
|
That's your problem, after the shebang '#!' you're supposed to give the
path of a program that may interpret the following code. Under unix
this will propably be something like '#!/usr/bin/perl', under NT something
like '#!c:\perl\bin\perl.exe'.
hope this helps
Michael
------------------------------
Date: Mon, 15 May 2000 20:06:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl and Apache Authentication
Message-Id: <Pine.GHP.4.21.0005151946490.13206-100000@hpplus03.cern.ch>
On Mon, 15 May 2000 rberdeen@lane.k12.or.us wrote:
> I am designing a web site for my school's web class from the ground up.
Fine...
> There will be an area of the page that is password protected,
> using .htpasswd, and I wanted to know if Apache passes on the username as
> an enviroment variable.
You've strayed into an inappropriate group for this question, though.
If you're asking about CGI scripts, then the answer to your question
is in the CGI specification. The appropriate newsgroup would be
comp.infosystems.www.authoring.cgi, and there are relevant FAQs to get
you up to speed, try starting at
http://www.smithrenaud.com/public/CGI_MetaFAQ.html
http://www.htmlhelp.org/faq/cgifaq.html
and being careful not to miss the related Security FAQs.
The CGI specification is an effective standard, you'll want to make
yourself familiar with it before tackling that kind of work, so I
doubt that merely answering your specific question would be the right
thing to do at this point (but anyway, it's REMOTE_USER, as the
specification shows at http://hoohoo.ncsa.uiuc.edu/cgi-1.1/env.html ).
If you were asking about some other server programming interface
(maybe an ErrorDocument, or SSI or whatever) then you'd find the
answer in the excellent Apache documentation at http://www.apache.org
- those are much less standardised than the CGI, so you need to get
server-specific details.
good luck with your project.
------------------------------
Date: Mon, 15 May 2000 15:12:26 -0700
From: "Carey T. Campbell" <ctcampbe@uiuc.edu>
Subject: Re: Perl code editors? Scratch that
Message-Id: <3920764A.6F79B0E4@uiuc.edu>
Scratch that last post.... I found recent posts o' plenty...
"Carey T. Campbell" wrote:
> What are your preferences for editors, if any? Are any really worth
> it? I've gone through the FAQs, reviews, etc., but would like to get
> the low-down at the hacker level....
>
> Thanks,
>
> Carey
>
> --
> Carey T. Campbell
> Department of Human Resource Education
> University of Illinois, Champaign-Urbana
--
Carey T. Campbell
Department of Human Resource Education
University of Illinois, Champaign-Urbana
------------------------------
Date: Mon, 15 May 2000 15:08:52 -0700
From: "Carey T. Campbell" <ctcampbe@uiuc.edu>
Subject: Perl code editors?
Message-Id: <39207574.BCBF251C@uiuc.edu>
What are your preferences for editors, if any? Are any really worth
it? I've gone through the FAQs, reviews, etc., but would like to get
the low-down at the hacker level....
Thanks,
Carey
--
Carey T. Campbell
Department of Human Resource Education
University of Illinois, Champaign-Urbana
------------------------------
Date: 15 May 2000 13:48:19 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: Perl code editors?
Message-Id: <8fpnqj$d9e@drn.newsguy.com>
In article <39207574.BCBF251C@uiuc.edu>, "Carey says...
>
>What are your preferences for editors, if any? Are any really worth
>it? I've gone through the FAQs, reviews, etc., but would like to get
>the low-down at the hacker level....
>
I know you said to forget it, but I would like to know what editor you decided
to use. I'm a hopeless old vi-ctim, and have used vim on various unixen and
lemmy ($20) on windoze. Lemmy does decent syntax coloring for C/perl/java/html
files. Emacs is another excellent programming editor but I was never able to
make friends with it somehow. It (along with vi, to a lesser extent) are the
best choices for people who work on multiple platforms. Codewright by Premia is
a very nice tool for people who are always on windoze but it is not inexpensive,
though it has a lot of features for managing larger projects. It imitates vi
and emacs and some other editors quite well.
------------------------------
Date: Mon, 15 May 2000 11:32:39 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: Perl ps2html
Message-Id: <392042C7.180EFF00@My-Deja.com>
> By any chance is there a Perl script that will convert a PostScript file to
> a series of HTML files? If so, could someone please URL me?
Yes - there is.
http://www.csd.uch.gr/~nikop/thesis.html
--
------------------------------
Date: Mon, 15 May 2000 22:19:58 +0200
From: "Adi Hoder" <adih@valor.com>
Subject: Problem in overloading operator.
Message-Id: <39204e54$1@news.barak.net.il>
Hi,
Having a problem in overloading operator >>
it collects grabage.
#!/sw/bin/perl
use IO::File;
use File::Copy;
# inilize object for the file handle
$fh=new IO::File;
$fh1=new IO::File;
# copy("./stack","./tmp");
#open stack file
( $fh->open("< stack") ) or die "file opening error\n";
#open tmp file
( $fh1->open("> tmp") ) or die "can't open stack\n";
# copy file from current state
$fh>>$fh1;
$fh1->close;
$fh->close;
( $fh->open("< stack") ) or die "can't open stack\n";
( $fh1->open("> tmp") ) or die "can't open stack\n";
$fh>>$fh1;
$fh1->close;
$fh->close;
############################################### Functions
####################################################
# overloading of operaotr append files >>
# by the end of thi sfunction the file handle
# will be close to repvent any usage by
# mistake of this file
package IO::File;
use overload '>>' => \&append_file;
# follwoing operator copy left location to right
sub append_file
{
my($left,$right)=@_;
print "\ngo go go go go perl";
# copy rest of file ot temp
my @d=$left->getlines;
$right->print("\n@d");
# flush buffer into file
$right->autoflush;
# return bless \$right;
# close both files after append
#$left->close;
#$right->close;
}
------------------------------
Date: Mon, 15 May 2000 11:13:32 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Producing arrays from quoted csv files from excel
Message-Id: <MPG.1389de25d5a243b598aa81@nntp.hpl.hp.com>
In article <8fp7si$g7j$1@nnrp1.deja.com> on Mon, 15 May 2000 16:16:37
GMT, leonarm@my-deja.com <leonarm@my-deja.com> says...
> When Excel produces a csv file from data which already contains commas it
> puts double quotes around the data containing the comma. Could anyone suggest
> a regular expression construction which splits the data at commas but only
> those outside double quotes. Using the line below :-
>
> 01,02,"my house,my street"
>
> an array would be formed $line[0]='01'
> $line[1]='02'
> $line[2]='myhouse,mystreet'
perlfaq4: "How can I split a [character] delimited string except when
inside [character]? (Comma-separated files)"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 15 May 2000 18:05:53 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Random Lists
Message-Id: <si0f41ocrj0177@corp.supernews.com>
Marcus (mouimet@direct.ca) wrote:
: I am trying to create a random list
By this I presume you mean a shuffled list; that is, you take a list with
known contents and put it into random order (as opposed to e.g. a list
of random numbers).
: and seem to be missing something here is
: what I am trying to start with to randomize the list:
:
: srand();
No need for this in recent perls; see the doc on srand for details.
: @userlist = rand(@userlist);
That generates a random real number in the range [0, entries in
@userlist), and stores it as the single element in @userlist, wiping out
the previous entries. That's probably not what you want to do.
: I was able to generate and print a random number by doing this:
:
: srand(time ^ $$);
: $something= rand(@something);
: print $something[$something];
Naming different variables the same (other than the type indicator) is a
recipe for 3am headaches.
Also, you can write this more compactly as
print $something[rand @something];
Note this prints a random array element, not a (raw) random number in the
sense of having come from rand() itself.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "The road of Excess leads to the Palace
of Wisdom" - William Blake
------------------------------
Date: Mon, 15 May 2000 18:23:13 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Random Lists
Message-Id: <7aaehrloce.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
"Marcus" <mouimet@direct.ca> writes:
> I am trying to create a random list and seem to be missing something here is
> what I am trying to start with to randomize the list:
>
> srand();
> @userlist = rand(@userlist);
You don't seem to understand what rand() does. It takes a number as an
argument, and returns a random fractional number less than that number
and greater than or equal to zero. See perlfunc.
> I was able to generate and print a random number by doing this:
>
> srand(time ^ $$);
> $something= rand(@something);
> print $something[$something];
Yes. But I don't think you understand why the above worked. You say you
wanted to create a random list, but what kind of data do you want in
your list? Do you want random numbers? What's the size of the list?
Have a look at perlfaq4 for some good uses of rand().
> Any suggestions would be most appreciated. I am also looking at using
> PHP are there many advantages with PHP over perl?
I am not familiar with PHP.
--Ala
------------------------------
Date: Mon, 15 May 2000 12:04:15 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Random Lists
Message-Id: <MPG.1389ea0a2ac2783798aa84@nntp.hpl.hp.com>
In article <bmWT4.13592$au2.135016@news1.rdc1.bc.home.com> on Mon, 15
May 2000 17:21:11 GMT, Marcus <mouimet@direct.ca> says...
> I am trying to create a random list and seem to be missing something here is
> what I am trying to start with to randomize the list:
>
> srand();
> @userlist = rand(@userlist);
>
> I was able to generate and print a random number by doing this:
>
> srand(time ^ $$);
> $something= rand(@something);
> print $something[$something];
>
> Any suggestions would be most appreciated.
perlfaq4: "How do I shuffle an array randomly?"
> I am also looking at using
> PHP are there many advantages with PHP over perl?
I have no idea.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 15 May 2000 19:19:46 GMT
From: devolver@iastate.edu (Trent Seigfried)
Subject: Re: Random Lists
Message-Id: <8fpiki$o8p$1@news.iastate.edu>
In article <bmWT4.13592$au2.135016@news1.rdc1.bc.home.com>,
mouimet@direct.ca quoth...
>
>I am trying to create a random list and seem to be missing something here is
>what I am trying to start with to randomize the list:
>
> srand();
> @userlist = rand(@userlist);
I see what you're trying to do, but I don't think arrays can be manipulated as
such. rand returns a number and is trying to put that number into the array.
>I was able to generate and print a random number by doing this:
>
>srand(time ^ $$);
>$something= rand(@something);
>print $something[$something];
Are you sure? Running this as is returns nothing. Do you have something in
@something? I just ran this and it returned nothing at all.
My suggestion is to write an iterative loop where each time through, one element
at random is pulled from the array and put into another one. Here's a quick n
dirty algorithim of it:
# @finalarray is all pretty and waiting to have the randomized array put in it
# @userlist has the list to be randomized
for (i=1,i=sizeofarray,i++)
{
$num = rand(sizeofarray);
$temp = @userlist(rand());
@finalarray(i) = $temp;
# eliminate that item from @userlist (or whatever you've temp'ed it to. Seems
trivial but I'm brainfarting at the moment)
> Any suggestions would be most appreciated. I am also looking at using
>PHP are there many advantages with PHP over perl?
Php is better if you're not doing anything requiring complex scripting. It's also
more useful if you have a complex HTML layout with only specific parts having
been dynamically generated.
Hope some of this helps.
Trent
-----
Trent Seigfried | devolver@iastate.edu
http://www.public.iastate.edu/~devolver
------------------------------
Date: Mon, 15 May 2000 19:26:24 GMT
From: "Marcus" <mouimet@direct.ca>
Subject: Re: Random Lists
Message-Id: <AbYT4.14217$au2.137610@news1.rdc1.bc.home.com>
I have figured out how to shuffle my list using rand. But it only displays
one random name out of the list of many names (the name is random so I feel
like I am getting somehwere - I also read up on rand on the Perl Faq), where
before just using sort, it displayed all the names. I am pretty new to perl
so I am still gettin used to it. Here is what I tried:
foreach $service (@servicelist) {
chomp($service);
if( ($in{service} eq "NS")||($in{service} eq "")||($in{service} eq
$service) ) {
$servicechunk = "";
$servicename = $service;
$servicename =~ s/_/ /g;
$servicechunk .= "<LI><FONT SIZE='+1'>$servicename</FONT>\n<UL>\n";
open(USERLIST, "ls $servicesfolder/$service |");
@userlist = <USERLIST>;
srand ();
@userlist = sort($userlist[rand @userlist]);
$x = 0;
foreach $user (@userlist) {
chomp($user);
$infofilestring =
FileToString("$servicesfolder/$service/$user/$infofilename");
$infofilestring =~ s/\n|\s+|\t/ /g;
$name = Extract('name',$infofilestring);
#$company = Extract('company',$infofilestring);
$city = Extract('city',$infofilestring);
$state = Extract('state',$infofilestring
}
"Craig Berry" <cberry@cinenet.net> wrote in message
news:si0f41ocrj0177@corp.supernews.com...
> Marcus (mouimet@direct.ca) wrote:
> : I am trying to create a random list
>
> By this I presume you mean a shuffled list; that is, you take a list with
> known contents and put it into random order (as opposed to e.g. a list
> of random numbers).
>
> : and seem to be missing something here is
> : what I am trying to start with to randomize the list:
> :
> : srand();
>
> No need for this in recent perls; see the doc on srand for details.
>
> : @userlist = rand(@userlist);
>
> That generates a random real number in the range [0, entries in
> @userlist), and stores it as the single element in @userlist, wiping out
> the previous entries. That's probably not what you want to do.
>
> : I was able to generate and print a random number by doing this:
> :
> : srand(time ^ $$);
> : $something= rand(@something);
> : print $something[$something];
>
> Naming different variables the same (other than the type indicator) is a
> recipe for 3am headaches.
>
> Also, you can write this more compactly as
>
> print $something[rand @something];
>
> Note this prints a random array element, not a (raw) random number in the
> sense of having come from rand() itself.
>
> --
> | Craig Berry - cberry@cinenet.net
> --*-- http://www.cinenet.net/users/cberry/home.html
> | "The road of Excess leads to the Palace
> of Wisdom" - William Blake
------------------------------
Date: 15 May 2000 19:54:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Random Lists
Message-Id: <slrn8i0leu.dco.abigail@ucan.foad.org>
On Mon, 15 May 2000 17:21:11 GMT, Marcus <mouimet@direct.ca> wrote:
++ I am trying to create a random list and seem to be missing something here is
++ what I am trying to start with to randomize the list:
++
++ srand();
++ @userlist = rand(@userlist);
What on earth makes you think that is the right way? Have you bothered
to look up what rand() does?
As for your question, that's answering in the FAQ.
++ I was able to generate and print a random number by doing this:
++
++ srand(time ^ $$);
++ $something= rand(@something);
++ print $something[$something];
Really? Does @something contain random numbers?
++ Any suggestions would be most appreciated. I am also looking at using
++ PHP are there many advantages with PHP over perl?
Oh, tons. Please use PHP instead of Perl.
The best advantage is that php questions aren't to be asked in this group.
Abigail
------------------------------
Date: Mon, 15 May 2000 12:00:14 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Reading and Writing to a file
Message-Id: <MPG.1389e91b985b250198aa83@nntp.hpl.hp.com>
In article <B545666E.957D%xah@xahlee.org> on Mon, 15 May 2000 08:31:42 -
0700, Xah <xah@xahlee.org> says...
<SNIP of ad-hominem rant.>
> A colleague sent me an email last year telling me about this article on
> sorting in Perl:
>
> http://www.hpl.hp.com/personal/Larry_Rosler/sort/sorting.html
<SNIP of rant about formal vs. informal descriptions. Someone less
dogmatic would recognize that successful authors tailor their styles to
their intended audiences.>
> I have not read in detail the rest of the article because it is not
> particularly worthy.
How do you determine that wihout reading it 'in detail'?
> In general, if one is concerned about algorithm
> complexity in nitty-gritty parts, or wants to study theories of sorting, the
> first step is to ditch Perl and get away from Perl mongers.
The article focuses on 'Efficient Perl Sorting'. References are
provided that deal in depth with sorting theory and algorithmic
complexity.
...
> PS I have wrote a function that takes care of sorting a matrix in general,
> that i think this may be a good time to post it.
...
> sort_matrix( $matrix, [[$n1, $stringQ, $directionQ], [$n2, $stringQ,
> $directionQ], ...]) sorts a matrix by $n1 th column then $n2 t\
> h...and so on.
>
> $matrix must be a reference to references of arrays, having the form [[$e1,
> $e2,...], [...], ...]. $stringQ is a boolean indicatin\
> g whether to treat corresponding columns as a strings in the sorting process
> (as opposed to a numbers). $directionQ is a boolean in\
> dicating ascending sort or not for the correpsonding column. Important:
> Index counting starts at 0.
You might want to look at the module Sort::Fields, by Joseph N. Hall
(referred to in our paper), which provides functionality identical to
your description.
The module Sort::Records, which aims at the same goal with considerably
more funcionality and efficiency, hasn't been published yet. Perhaps
this will prod Uri Guttman to finish it.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 15 May 2000 14:33:38 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Redirection/Pulldown menu cgiscript for MacPerl?
Message-Id: <Pine.GSO.4.10.10005151433100.25459-100000@user2.teleport.com>
On Sun, 14 May 2000, Jimmy Lantz wrote:
> Hi, I'm looking for a redirection script for Macperl.
> Is there any who knows where I can find one?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service.
But it sounds like you want the CGI module, maybe.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 15 May 2000 21:38:29 GMT
From: bzooty@my-deja.com
Subject: Site update
Message-Id: <8fpqoj$67v$1@nnrp1.deja.com>
Dynamic Whistler, the DHTML information site, has been updated with new
articles, tutorials and a brand new Message Board.
Jerry Stogsdill
http://whistler.bccmedia.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 15 May 2000 15:37:53 -0400
From: "Mike Stone" <mstone@mountaincreek.com>
Subject: Specifying MIME type
Message-Id: <39205216_2@nntp2.nac.net>
Hi,
I am running Active Perl Build 521 on Win NT. From my internal web server
I want to mail an HTML form to a recipient running Outlook 98. I have my
script which takes my form and sends it everything to the recipient via SMTP
using IO::Socket, but I can not figure out how to specify that the content
type of the mail is HTML and not plain text. Any ideas on how to accomplish
this?
Thank you,
Mike W. Stone.
mstone@mountaincreek.com
------------------------------
Date: Mon, 15 May 2000 12:35:44 -0700
From: Matthew Stoker <matt.stoker@motorola.com>
Subject: Re: strings and limits
Message-Id: <39205190.27D708AE@motorola.com>
Ganix wrote:
>
> Hi
> Silly question, but is there a common way of
> getting - say 10 characters long - parts out of
> a string and put them into an array?
> I suppose perl can triuph with some certain
> command for this purpose.
> I think at some kind of split with regular expression.
No claims that this is the "best way", but in the spirit of TMTOWTDI
(Tim TOADY or whatever):
$num = 10;
for ($i = 0; $i<length($string)/$num;$i++)
{
$pieces[$i] = substr ($string, $num*$i, $num);
}
this will split $string into pieces that are $num characters long.
--
/------------------------------------------------------------------\
| Matt Stoker | email: matt.stoker@motorola.com |
| Unit Process Modeling | Mail Drop: M360 |
| DigitalDNA(TM) Laboratories| Phone: (480)655-3301 |
| Motorola, SPS | Fax: (480)655-5013 |
| 2200 W Broadway Road | Pager: (888)699-8803 |
| Mesa, AZ 85202 | |
\------------------------------------------------------------------/
------------------------------
Date: Mon, 15 May 2000 13:50:39 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: strings and limits
Message-Id: <MPG.138a02f995c1dcce98aa85@nntp.hpl.hp.com>
In article <39205190.27D708AE@motorola.com> on Mon, 15 May 2000 12:35:44
-0700, Matthew Stoker <matt.stoker@motorola.com> says...
> Ganix wrote:
> >
> > Silly question, but is there a common way of
> > getting - say 10 characters long - parts out of
> > a string and put them into an array?
...
> No claims that this is the "best way", but in the spirit of TMTOWTDI
> (Tim TOADY or whatever):
>
> $num = 10;
> for ($i = 0; $i<length($string)/$num;$i++)
> {
> $pieces[$i] = substr ($string, $num*$i, $num);
> }
>
> this will split $string into pieces that are $num characters long.
But it loses the last piece of up to 9 leftover characters, if any.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 15 May 2000 14:29:52 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Summary: Accidental Creation of Static Variable
Message-Id: <39205030.2129D147@home.com>
nobull@mail.com wrote:
>
> Summary of the discussion so far:
>
> Basically the debate going on is about the actual behaviour of "my $x
> =1 if $y" and the perlsub manpage.
>
> The actual behaviour is to create a varaible that is lexically scoped
> but that is static (i.e. retains/shares it's value between different
> invocations of the block).
>
> [...]
>
> Meanwhile, the docuementation states:
[quotedepth dropped to one as it was getting indented too far.]
>> variables declared with C<my> are totally hidden from the outside
>> world, including any called subroutines. This is true if it's the
>> same subroutine called from itself or elsewhere--every call gets
>> its own copy.
>
> I assert that the actual behaviour contarvenes this.
>
> Abigail does not accept my assertion.
>
> Abigail asked me to show how the the actual behaviour contarvenes the
> first sentence taken alone. I cannot (because it does not).
Well, it may. I tried to modify things to make a recursive function out
of it to see what happens: (-w left out deliberately)
#!/usr/local/bin/perl5
use strict;
foo(30);
print "---------\n";
foo(10);
sub foo {
my $comp = shift;
my $test = 1 if $comp == 30;
$test = 2 if $comp == 20;
printf("\$comp = %-2d -- [$test]\n", $comp);
foo($comp - 10) if ($comp > 0);
}
Which produces the following:
$comp = 30 -- [1]
$comp = 20 -- [2]
$comp = 10 -- []
$comp = 0 -- []
---------
$comp = 10 -- []
$comp = 0 -- [2]
I have no idea how the last recursed call to foo() got '2' for $test.
This is all a little wierd, though, as the results depend on how many
times you call foo(), with what arguments, and in what order. For some
scenarios, it appears that each call has it's own namespace. Others
(above) do not.
> I consider it so obvious that that "every call gets its own copy" is
> contravened by the actual behaviour (somtimes calls share the same
> copy) that I can't see any way to express it in simpler terms.
I don't think that simple persistance would contradict the docs (which
seems to be the position that Abigail has taken) but I'm not convinced
that what we're dealing with here is simple persistance.
Tom Briles posted a URL to a discussion of this on p5p. It implies (but
does not explicity state) that the observed behavior is at least
reliable. Somehow the reference count gets incremented in the
optimization which prevents the variable from ever being deallocated. So
we shouldn't have to worry about any pointers into la-la-land. (I still
think it's playing with fire, though.)
-mjc
------------------------------
Date: Mon, 15 May 2000 18:53:06 GMT
From: gounis <gounis@my-deja.com>
Subject: text file and perl
Message-Id: <8fph2a$qsv$1@nnrp1.deja.com>
i need some perl code
the problem is:
i need to
1) open a litle .txt file into a text form in a web page (browser)
2) make some changes
3) save again the .txt
the text file is in the web server side
i have full access in the web servers directory
web server is able to run perl script
if anyone can help me please
reply or send me an email
gounis
Kounis Stavros
gounis@clubmobil.com
thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 15 May 2000 15:59:08 -0400
From: "Todd W" <trw@freewwweb.com>
Subject: Re: text file and perl
Message-Id: <8fpkes$pik$1@news.smartworld.net>
gounis wrote in message <8fph2a$qsv$1@nnrp1.deja.com>...
>i need some perl code
Hey so do i!!!Here are my requirements:
1)I dont want to pay for it.
2)I want to vaguely describe it and have it done correctly
3)I want it in my mailbox in 24 hours
couldnt help but smart off a little gounis, I apologize. But it is kind of
rude to ask for free custom code without showing any type of effort to do
SOME of the job yourself.
------------------------------
Date: Mon, 15 May 2000 16:23:50 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Wanted: Perl Training
Message-Id: <39206add$0$14804@wodc7nh1.news.uu.net>
Hello,
I was wondering if anyone out there has attended any Perl classes that help
a newbie get the hang of modules and OO? I don't believe I would be
interested in the Stonehenge or Randalls due to the fact that I never get
any response when I leave e-mails with them. So does anyone know of any GOOD
source for training. I was hoping for a classroom type of environment, as
opposed to 1 on 1 because of costs.
If anyone knows of any, please respond.
Thanks
Scott
------------------------------
Date: 15 May 2000 10:54:48 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: What's this line which Perl added to AUTOEXEC.BAT?
Message-Id: <8fpdl8$2r2c@drn.newsguy.com>
In article <19b13c48.15fccc27@usw-ex0101-007.remarq.com>, bjanko says...
>
>After installing Perl from activestate.com on my Windows 98
>platform, the following line was written into my AUTOEXEC.BAT:
>
>SET PATH=C:\Perl\bin\
>
>This seemed to make my computer unbootable.
That is not just unlikely, I think it to be impossible. BTW, the above is not
what ActiveState Perl put in my autoexec.bat, so I suspect you have not reported
your situation very accurately. Accuracy (and precision) are very helpful
things when you are trying to get help from thousands of semi-random strangers.
>Does anyone know
>the purpose of the line?
Most PC users know - and a few minutes with a search engine on the web would
tell you, too. This is a perl group, not a PC group, so I won't go that far
off-topic. I'll tell you one thing, however...I've got ActiveState Perl on a
Win98 system and works just fine. It was A-OK right out of the box. I believe
that there are a lot of other happy AS Perl users out there, so much as I hate
to tell you this - there is something else wrong with your PC. Did anything
unusual happen when you installed the package? Did you change anything else at
the time?
> What it does do? Do I need it?
You don't *need* it, but it makes life a lot more convenient.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 3054
**************************************