[15923] in Perl-Users-Digest
Perl-Users Digest, Issue: 3336 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 13 00:05:36 2000
Date: Mon, 12 Jun 2000 21:05:14 -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: <960869114-v9-i3336@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 12 Jun 2000 Volume: 9 Number: 3336
Today's topics:
Re: ActiveState 5.6 still doesn't support alarm? (Windo <rootbeer@redcat.com>
Re: ANSI Perl: No Way !!! <godzilla@stomp.stomp.tokyo>
Re: ANSI Perl: No Way !!! <elaine@chaos.wustl.edu>
Re: ANSI Perl: No Way !!! <godzilla@stomp.stomp.tokyo>
Re: ASP and Perl <rootbeer@redcat.com>
Re: Base64 encoded JPEG <rootbeer@redcat.com>
Re: cgi.pm if statements and redirect problems <rootbeer@redcat.com>
Re: Content-type: text/html with ActivePerl <lauren_smith13@hotmail.com>
Re: Content-type: text/html with ActivePerl (Bart Lateur)
CPAN, Windows and AS Perl v5.6 (Doran)
Re: Creating a new folder and file. <billy@arnis-bsl.com>
Re: Creating a new folder and file. <tina@streetmail.com>
Re: Creating new folder and file and can't use mkdir() (Bart Lateur)
Re: Creating new folder and file and can't use mkdir() <lr@hpl.hp.com>
Re: Creating new folder and file and can't use mkdir() <tina@streetmail.com>
Re: Creating new folder and file and can't use mkdir() <tina@streetmail.com>
Re: Finding repeated words -- e.g. the the <noname@noname.com>
How can I do this? please help <edge@gecko.org>
Re: How can I do this? please help <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 12 Jun 2000 20:30:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: ActiveState 5.6 still doesn't support alarm? (Windows)
Message-Id: <Pine.GSO.4.10.10006122028120.18837-100000@user2.teleport.com>
On 12 Jun 2000, Phil Tomson wrote:
> Seems I recall reading that alarm was going to be supported under
> windows in Perl 5.6.
Who told you that? :-)
> Will alarm ever be supported under Windows Perl?
Sure, once you've sent in the patch. :-)
> Is there another way to setup watchdog timers under Perl on Windows in
> the absence of an alarm function?
I doubt that an easy way exists; if there were one, it would probably
already have been used to emulate alarm.
Don't hold your breath, but someone will probably set one up with
threading - one thread will sleep for N seconds, then "alarm" the other
one. Or something like that. Hey, now maybe you'll implement this
yourself! Have fun with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 12 Jun 2000 18:54:22 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <3945944E.7DD4657A@stomp.stomp.tokyo>
Elaine Ashton wrote:
> in article xP715.111471$hT2.435944@news1.rdc1.ct.home.com, Dan Sugalski at
> dan@tuatha.sidhe.org quoth:
> >> My personal viewpoint is, Perl 5 has been developed to
> >> counter a market share being grabbed by other languages,
> >> such as Java and Microsoft's Active Server Programming.
> > Perl 5 predates both ASP and Java, Gojira.
>
> 18.Oct.94 - Perl 5.000 released
> 23.May.95 - JAVA Announced by Sun Microsystems
These are interesting dates. For what it isn't
worth, Research and Development trends and news,
either privately pirated or publically pronounced,
are of greater significance for corporate decision
making, internally, but not always this private.
Word about any Research and Development spreads
like wildfire long before public knowledge is
made. Most fleeting of all secrets, are military.
> I couldn't find a date for ASP but considering
> how late in the game MS 'discovered' the Internet,
> I'd guess it would have debuted ~96.
I would place this date, pertaining to internet
activity, some five to seven years earlier. Back
then, IBM clones, equipped with Win 3.x, often came
bundled with PC_Link, which is Tandy Corp's Grandmother
of America Online, with Quantum Computers being the
mother. Gossip has it, Gates held an indirect vested
interest in the consortium, including Steve Case, which
purchased PC_Link as Quantum Computers then reorganized
into today's America Online.
Microslug, as my nickname implies, is slow to respond
yet rather overpowering. Slugs are basically one big
muscle and, with Microslug, this is a quite large slug.
Could be Microslug initiated ASP in R & D, Sun swiped
the idea and poor Mr. Wall, being well mannered and
more interested in having fun, never thought to send
in the Trenchcoat Boys to listen to coffee break gossip.
Spoof and Spook conjecture of course.
Nonetheless, these are all now historical events
holding no more value than amusing conjecture.
> And the language really isn't the issue in the
> web serving/hosting market as far as I can tell
> rather it is the tools that come with the language
> that make it a popular choice or not. Perl's strength
> for allowing people to make their own tools is also its
> weakness in this particular market. JAVA and ASP are
> growing in popularity as they have IDEs and ready-made
> code for rapid development.
Within one to two decades, Active Server Programming
will be the rule rather than the exception. My best
understanding from news and reading, setting up an
internet service provider with ASP is point and click
now. No system's operator, in the true sense, is needed.
Seems building an ISP is best left to children much
like leaving programming a VCR is best left to children,
when is comes to ASP language. This is power.
> In a world that fought a Perl IDE and plenty of people
> to criticise yet not fix Matt Wrights and Selena Sols
> code one can hardly blame companies looking to Sun and MS
> for a language that comes with tools and support. I don't
> have hard statistics, but by what I've seen Perl has lost
> ground it will never regain in this arena.
There is a distinctive difference between programming and
selling a program language. With programming, all it takes
is some psychotically obsessive techno-geeks, like in this
newsgroup, to 'program' a language. Selling a programming
language takes aggressive, egotistical, cut-throat cruel
leadership willing to engage in corporate blood baths.
Isn't this Bill Gates in a nutshell?
Society also plays a major role. Today's more affluent
peoples, are a fat lazy lot wanting everything to require
no more effort than pushing a button.
* glances at her callouses and broken nails *
Our major markets are geared towards making fat lazy
people develop a self-concept of being young, strikingly
handsome and oh so powerful, at the push of a button.
Perl lacks a young and vivacious image, it lacks neat
little buttons labeled, "Power" and "More Power" along
with "Make Me A Knock-Out". Perl also lacks effective
and decisive leadership willing to go out and commit
heinous acts of corporate genocide.
* notices heinous violates a grammar rule *
Heinous doesn't sound like weigh nor more than height.
*shrugs*
Perl requires work and effort to use. Perl requires
forethought, planning and thinking. Our average Susan
Wannalaya, is not in the least bit interested in any
of those notions. She is highly interested however,
in clicking a button and having a cyber love affair.
Ya know, this group reflects the real problem with Perl.
Here, this is a contest between sissified obsessive
techno-geekster boys, one declaring his ego phallic
larger than the other's and, an ensuing battle of,
"Is not" .. "Is too" .. "Is not" .. "Is too" ..
takes on Godzilla size proportions, just like which
goes on within Perl leadership.
Meanwhile, Bill Gates is cutting throats and laughing
all the way to his multitude of banks. He is, above
all other qualities, a dynamic indomitable leader.
I admire Bill Gates. He is an American Hero.
Godzilla!
------------------------------
Date: Tue, 13 Jun 2000 02:45:01 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <B56B186C.6078%elaine@chaos.wustl.edu>
in article 3945944E.7DD4657A@stomp.stomp.tokyo, Godzilla! at
godzilla@stomp.stomp.tokyo quoth:
>> 18.Oct.94 - Perl 5.000 released
>> 23.May.95 - JAVA Announced by Sun Microsystems
>
> These are interesting dates. For what it isn't
> worth, Research and Development trends and news,
> either privately pirated or publically pronounced,
> are of greater significance for corporate decision
> making, internally, but not always this private.
True as Perl 5.000 had a number of betas before that date
and I remember Sun touting 'Java Camps' possibly a year earlier
but one must hang history on what is/was public and work from
there.
> Word about any Research and Development spreads
> like wildfire long before public knowledge is
> made. Most fleeting of all secrets, are military.
Or secrets in this little burg of the net.
>
>> I couldn't find a date for ASP but considering
>> how late in the game MS 'discovered' the Internet,
>> I'd guess it would have debuted ~96.
> Nonetheless, these are all now historical events
> holding no more value than amusing conjecture.
Interesting viewpoint/conjecture. I would bet MS bought
the technology rather than developed it as they have
much of their products in the last few years though
I'm not expert on MS.
> Within one to two decades, Active Server Programming
> will be the rule rather than the exception. My best
> understanding from news and reading, setting up an
> internet service provider with ASP is point and click
> now. No system's operator, in the true sense, is needed.
> Seems building an ISP is best left to children much
> like leaving programming a VCR is best left to children,
> when is comes to ASP language. This is power.
2 decades? Sooner. Economics and a lack of skilled workforce
is driving this. Programming isn't for everyone but the net
is becoming an appliance and as such simple tools for the
hoi polloi will win the market share. Geeks are expensive,
MS FrontPage and the teenager down the street isn't.
> Society also plays a major role. Today's more affluent
> peoples, are a fat lazy lot wanting everything to require
> no more effort than pushing a button.
Not having an interest in how the toaster works doesn't mean
that you don't know how to make toast without burning it or
that you are a KLB for not taking the bloody thing apart and
rebuilding a better one ala MacGuyver with duct tape, chewing
gum, two cans and some yarn.
The internet is an appliance. The engineers job is to make it
so that it is simple and easy to use.
It would be nice to see the nerds of the world unite to make
something easy enough for my mother to use yet having a powerful
enough back-end to make even the most arrogant PITA love it.
There are plenty of idiots making ugly web pages but wouldn't
giving them a tool to allow them to make reasonable pages instead
of wasting so much time bitching at them be more productive?
> Our average Susan
> Wannalaya, is not in the least bit interested in any
An Ian Fleming moment....
> I admire Bill Gates. He is an American Hero.
The 'make me a stud' button must have not worked for him
though. A pity really. :)
e.
------------------------------
Date: Mon, 12 Jun 2000 20:04:53 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <3945A4D5.9D2558A3@stomp.stomp.tokyo>
Elaine Ashton wrote:
> in article 3945944E.7DD4657A@stomp.stomp.tokyo, Godzilla! at
> godzilla@stomp.stomp.tokyo quoth:
> Not having an interest in how the toaster works doesn't mean
> that you don't know how to make toast without burning it or
> that you are a KLB for not taking the bloody thing apart and
> rebuilding a better one ala MacGuyver with duct tape, chewing
> gum, two cans and some yarn.
MacGuyver and Perl, appropriate analogy.
Umm... you forgot the part about this toaster giving
a burglar a mild electric shock rendering him quite
unconscious but not injured in the least.
My MacGuyver toaster would leave this burglar
fried to crisp and reduced to two ounces of
soot and ash.
A fun exchange of dialog Ms. Ashton, very fun.
;)
Godzilla!
------------------------------
Date: Mon, 12 Jun 2000 20:15:49 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: ASP and Perl
Message-Id: <Pine.GSO.4.10.10006122015320.18837-100000@user2.teleport.com>
On Mon, 12 Jun 2000, Samay wrote:
> I am building pages with Visual Interdev..
> And using Perlscript in ASP..
> and it doesn't work..
When you're having trouble with a CGI program in Perl, here's a handy
troubleshooting guide to get you back on track.
http://www.smithrenaud.com/public/troubleshooting_CGI.html
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 12 Jun 2000 20:14:53 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Base64 encoded JPEG
Message-Id: <Pine.GSO.4.10.10006122011400.18837-100000@user2.teleport.com>
On Mon, 12 Jun 2000, peredina wrote:
> Im trying to process a Netscape directory entry (Base64 encoded jpg)
> to a file.
I don't know what you mean by the obscure term "Netscape directory entry
(Base64 encoded jpg)". And I don't know what you mean when you say you
want to "process" it "to a file".
Do you want to undo the base-64 encoding of a file, to turn it into an
ordinary JPEG file? Or is it something else?
If you need help with Netscape, JPEG encodings, directory formats, or
something else, you may wish to search for the related docs, FAQs, and
newsgroups.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 12 Jun 2000 20:23:40 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: cgi.pm if statements and redirect problems
Message-Id: <Pine.GSO.4.10.10006122023140.18837-100000@user2.teleport.com>
On 12 Jun 2000, Chris Sorensen wrote:
> Thanks - I saw that but when I try to redirect without printing a
> header .. it doesn't work ... I'm not sure why
It doesn't work because you're doing something wrong.
When you're having trouble with a CGI program in Perl, here's a handy
troubleshooting guide to get you back on track.
http://www.smithrenaud.com/public/troubleshooting_CGI.html
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 12 Jun 2000 18:03:13 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Content-type: text/html with ActivePerl
Message-Id: <8i416v$485$1@brokaw.wa.com>
<braccobaldo.xyz@hotmail.com> wrote in message
news:akvaks0mhmhha1scds6qlqk100oh93f1fm@4ax.com...
> I'm configuring a Perl counter (gcount.pl - Author: Yutung Liu - web
> site: http://www.cgi-factory.com). It works fine in my web site
> (http://baravalle.co.uk). I'm using it by a a few months.
> I have a win2000 sistem. Il looks more or less fine, but in front of
> the digits I have the words "Content-type: text/html".
> Why? In internet I don't have them.
This last sentence doesn't parse.
> The code the script uses to display immages is:
>
> print "Content-type: text/html\n\n";
> for ($i; $i < $length; ++$i) {
> print "<img src=\"$images/@gcount[$i].$ending\" width=\"$width\"
> height=\"$height\">";
> }
ick.
print "Content-type: text/html\n\n";
for my $image (@gcount) {
print qq(<img src="$images/$image.$ending" width="$width"
height="$height">);
}
Now, I don't know if this solves your problem, but it sure is easier to
read.
> I have solved it deleteing the line
>
> print "Content-type: text/html\n\n";
>
> in the script I have in my computer and leaving as it was in my web
> page.
> What was the meaning of that line? Why in internet I have only my
> counter and in local I have the words "Content-type: text/html"+the
> counter?
I know why you're posting here. You have a CGI program that was written in
Perl and think that somehow CGI and Perl are intertwined. That is simply
not the case. Perl (in this example) is merely printing out information.
The 'Content' line is printed out by Perl and read by something else. My
guess is that a browser is reading and interpreting that line.
People that work with CGI and HTML all day long would probably have better
information to give you than the people in here.
comp.infosystems.authoring.html would be a better place to ask this
question.
Lauren
------------------------------
Date: Tue, 13 Jun 2000 01:16:28 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Content-type: text/html with ActivePerl
Message-Id: <3952894b.24769087@news.skynet.be>
braccobaldo.xyz@hotmail.com wrote:
>I have a win2000 sistem. Il looks more or less fine, but in front of
>the digits I have the words "Content-type: text/html".
>Why? In internet I don't have them.
>The code the script uses to display immages is:
>
>print "Content-type: text/html\n\n";
>...
>I have solved it deleteing the line
It's a directive to the web server, and from there, to the browser. You
don't need it if used without a web server.
This is pretty safe:
print "Content-type: text/html\n\n" if $ENV{REQUEST_METHOD};
--
Bart.
------------------------------
Date: Tue, 13 Jun 2000 01:48:44 GMT
From: doran@NOSPAMaltx.net (Doran)
Subject: CPAN, Windows and AS Perl v5.6
Message-Id: <39458c9e.3518888@news2.brandx.net>
I have ActiveState perl v5.6 (build613) on my Win98 machine.
I'd *really* like to use the CPAN module to retrieve and install
modules when they're not available via PPM.
I've gone through my Config.pm file (in \perl\lib\CPAN) and put in the
values I think are correct (see below) but I still haven't been able
to install *any* modules. For example, when I try to install
MP3::Info, I get this:
-------------------------------
begin CPAN output
-------------------------------
cpan> install MP3::Info
Running make for C/CN/CNANDOR/MP3-Info-0.80.tar.gz
Checksum for
\.cpan\sources\authors\id\C\CN\CNANDOR\MP3-Info-0.80.tar.gz ok
MP3-Info-0.80/eg/mp3tag.PL
MP3-Info-0.80/eg/mp3tocddb.PL
MP3-Info-0.80/Info.pm
MP3-Info-0.80/lib/MPEG/MP3Info.pm
MP3-Info-0.80/Makefile.PL
MP3-Info-0.80/MANIFEST
MP3-Info-0.80/README
MP3-Info-0.80/test.pl
MP3-Info-0.80/test1.mp3
MP3-Info-0.80/test2.mp3
Removing previously used \.cpan\build\MP3-Info-0.80\.
CPAN.pm: Going to build C/CN/CNANDOR/MP3-Info-0.80.tar.gz
Checking if your kit is complete...
Looks good
Bad command or file name
Bad command or file name
Unable to find a perl 5 (by these names: C:\Perl\bin\Perl.exe miniperl
perl perl5 perl5.00503, in these dirs: Z:. X:. W:. C:\BIN C:\DJGPP\BIN
C:\NOVELL\CLIENT32 C:\WINDOWS C:\WINDOWS\COMMAND C:\PERL\BIN\
C:\WINDOWS\SYSTEM C:\NCFTP C:\PROGRAMFILES\MTS
C:\PROGRA~1\SYMANTEC\PCANYW~1\ C:\Perl\bin)
Writing Makefile for MP3::Info
Makefile:651: *** missing separator. Stop.
c:\djgpp\bin\make -- NOT OK
Running make test
Oops, make had returned bad status
Running make install
Oops, make had returned bad status
cpan>
-------------------------------
end of CPAN output
-------------------------------
I suspect that those "Bad command or file name" errors can't be a good
thing, but I'm not sure what's failing at that point. Plus there's
that nasty "missing separator" message. I should note that I *do* have
perl installed in the C:\Perl\bin directory as Perl.exe, so I'm also
not quite sure why I'm getting the "Unable to find a perl5..." error.
I have read README.win32.html and that mentions a problem with
command.com in Win95. Is that the problem? Do I need a different
command interpreter? That readme seems to be for an older version of
perl, so I'm not even sure if the things it talks about still pertain
in v5.6.
Finally, just FYI, perl runs fine on my machine (well, fine for a
Windows machine) , so I know it's installed and in my path and such.
Here's my Config.pm with the values I entered:
C:\Perl\lib\CPAN>type Config.pm
# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/MyConfig.pm.
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[\.cpan\build\.],
'cpan_home' => q[\.cpan\.],
'ftp' => q[C:\WINDOWS\ftp.exe],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gzip' => q[c:\bin\gzip],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[\.cpan\sources\.],
'lynx' => q[c:\lynx\lynx],
'make' => q[c:\djgpp\bin\make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[],
'ncftpget' => q[c:\ncftp\ncftpget],
'no_proxy' => q[],
'pager' => q[C:\WINDOWS\COMMAND\more.com],
'prerequisites_policy' => q[follow],
'scan_cache' => q[atstart],
'shell' => q[c:\command.com],
'tar' => q[c:\bin\tar],
'unzip' => q[c:\bin\gunzip],
'urllist' => [],
'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]],
};
1;
__END__
C:\Perl\lib\CPAN>
Let me know if there's some web page or FAQ or something that I've
missed that I need to read. I suspect I'm not the first person to ask
this question, but I haven't found any answers (that solve the
problem) in my searches at deja and elsewhere.
Thanks for any insight, help or direction you may offer.
Doran...
------------------------------
Date: Tue, 13 Jun 2000 02:51:31 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: Creating a new folder and file.
Message-Id: <8i47jd$4l5$1@nnrp1.deja.com>
In article <ECa15.573$UU6.26747@news.uswest.net>,
"Ferk Da Jerk" <shawnball@uswest.net> wrote:
> When I use:
>
> open (TEST, ">test/test.log");
> print TEST ("Test");
> close (TEST)
>
> it does not work. There folder "test" is not made yet. So I want it
to
> create a folder called "test" and put a file called "test.log" inside
of
> that folder. But my problem is it won't create the folder. Does
anyone
> know how to create a folder or if there is something I'm doing wrong?
>
First, you should _always_ check return values from system calls:
open TEST, $file or die "cannot open $file: $!\n";
If I guess right, you mean 'directory' by 'folder'.
To create a directory use 'mkdir': see 'perldoc -f mkdir'
(or http://www.cpan.org/doc/manual/html/pod/perlfunc/mkdir.html).
To create nested directories take a look at File::Path module
(http://www.cpan.org/doc/manual/html/lib/File/Path.html).
Hope this helps.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 13 Jun 2000 03:14:58 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Creating a new folder and file.
Message-Id: <8i48vi$40rbn$1@fu-berlin.de>
hi,
Ilja Tabachnik <billy@arnis-bsl.com> wrote:
> In article <ECa15.573$UU6.26747@news.uswest.net>,
> "Ferk Da Jerk" <shawnball@uswest.net> wrote:
>>
>> open (TEST, ">test/test.log");
>> print TEST ("Test");
>> close (TEST)
> First, you should _always_ check return values from system calls:
> open TEST, $file or die "cannot open $file: $!\n";
better to leave that newline out:
open TEST, $file or die "cannot open $file: $!";
(try it out to see the difference or see
perldoc -f die)
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Tue, 13 Jun 2000 01:16:24 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <39518855.24523133@news.skynet.be>
Larry Rosler wrote:
>Tina Mueller says...
>> try mkdir($directory,0766) instead of
>> mkdir($directory)
>> because mkdir needs two arguments.
>The second argument is optional.
Eh? Since when?
It's still required for Perl 5.005_03.
To Tina: why is your umask 0766? Execute permission for a directory is
not the same as for a file. As it is, you will allow external people
(e.g. a webserver running as "nobody") to write to files, but not to
create a new file.
--
Bart.
------------------------------
Date: Mon, 12 Jun 2000 18:35:53 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <MPG.13af2fd9305d0a2698ab66@nntp.hpl.hp.com>
In article <39518855.24523133@news.skynet.be> on Tue, 13 Jun 2000
01:16:24 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Larry Rosler wrote:
>
> >Tina Mueller says...
> >> try mkdir($directory,0766) instead of
> >> mkdir($directory)
> >> because mkdir needs two arguments.
>
> >The second argument is optional.
>
> Eh? Since when?
>
> It's still required for Perl 5.005_03.
Perl 5.6.0:
mkdir FILENAME,MASK
mkdir FILENAME
Creates the directory specified by FILENAME, with permissions specified
by MASK (as modified by umask). If it succeeds it returns true,
otherwise it returns false and sets $! (errno). If omitted, MASK
defaults to 0777.
In general, it is better to create directories with permissive MASK, and
let the user modify that with their umask, than it is to supply a
restrictive MASK and give the user no way to be more permissive. The
exceptions to this rule are when the file or directory should be kept
private (mail files, for instance). The perlfunc(1) entry on umask
discusses the choice of MASK in more detail.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 13 Jun 2000 01:56:39 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <8i44cn$43jeu$2@fu-berlin.de>
hi,
Bart Lateur <bart.lateur@skynet.be> wrote:
>>Tina Mueller says...
>>> try mkdir($directory,0766) instead of
>>> mkdir($directory)
>>> because mkdir needs two arguments.
> To Tina: why is your umask 0766? Execute permission for a directory is
> not the same as for a file. As it is, you will allow external people
> (e.g. a webserver running as "nobody") to write to files, but not to
> create a new file.
sorry, i know i should not post something i'm not very sure
of. this umask was just an example to make clear,
that mkdir needs a second argument. (and MY perl
version needs that argument; i think it would
be better posting something which is compatible
with recent perl versions)
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: 13 Jun 2000 02:00:26 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <8i44jq$43jeu$3@fu-berlin.de>
hi,
Larry Rosler <lr@hpl.hp.com> wrote:
> In article <8i3ft8$3tmj6$7@fu-berlin.de> on 12 Jun 2000 20:07:04 GMT,
> Tina Mueller <tina@streetmail.com> says...
>> try mkdir($directory,0766) instead of
>> mkdir($directory)
>> because mkdir needs two arguments.
> The second argument is optional.
i didn't know that it is optional in the
newest perl version. even if I had known it would've
been better to mention that, because it will
take a while until most of the people
have upgraded. (there are still some who are
using perl4...)
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Tue, 13 Jun 2000 11:38:55 +0800
From: "DIAMOND Mark" <noname@noname.com>
Subject: Re: Finding repeated words -- e.g. the the
Message-Id: <8i4a9b$k4k$1@enyo.uwa.edu.au>
Many thanks to all!
--
Mark R Diamond
Vision Research Laboratory
The University of Western Australia
no spam email: markd at psy dot uwa dot edu dot au
------------------------------
Date: Tue, 13 Jun 2000 01:13:06 GMT
From: Edge <edge@gecko.org>
Subject: How can I do this? please help
Message-Id: <8i41qp$m4$1@nnrp1.deja.com>
I am trying to write a perl script that will read a file (entry1 <tab>
entry2) and generate a list on screen that a user can pick from. The
script will # all the entries and then the user can pick the #(s) he
wants to see and the script will display the files. What I need help
with is generating the on-screen "menu" - I can get the selection and
display the file....any help greatly appreciated. Code snippet to
follow:
open(INDEX,'/web-it/NOCR/nocr.index');
format STDOUT =
=========================================
| NOCR Created by |
=========================================
@>>) ^<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<
$i $nocr $who
~ ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<
$nocr $who
.
$i="0";
while (<INDEX>) {
chop;
($nocr,$who)=split(/\s+/);
write;
$i++;
}
and here is the output:
=========================================
| NOCR Created by |
=========================================
0) NOCR.06122000 edge
=========================================
| NOCR Created by |
=========================================
1) NOCR.06122000-1 edge
=========================================
| NOCR Created by |
=========================================
2) NOCR.06122000-2 jack
of course, what I'm looking for is :
=========================================
| NOCR Created by |
=========================================
0) NOCR.06122000 edge
1) NOCR.06122000-1 edge
2) NOCR.06122000-2 jack
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 13 Jun 2000 02:40:29 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: How can I do this? please help
Message-Id: <39459E13.EE2C2630@rochester.rr.com>
Edge wrote:
>
> I am trying to write a perl script that will read a file (entry1 <tab>
> entry2) and generate a list on screen that a user can pick from. The
> script will # all the entries and then the user can pick the #(s) he
> wants to see and the script will display the files. What I need help
> with is generating the on-screen "menu" - I can get the selection and
> display the file....any help greatly appreciated. Code snippet to
> follow:
>
> open(INDEX,'/web-it/NOCR/nocr.index');
> format STDOUT =
>
> =========================================
> | NOCR Created by |
> =========================================
> @>>) ^<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<
> $i $nocr $who
> ~ ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<
> $nocr $who
> .
> $i="0";
> while (<INDEX>) {
> chop;
> ($nocr,$who)=split(/\s+/);
> write;
> $i++;
> }
>
> and here is the output:
> =========================================
> | NOCR Created by |
> =========================================
> 0) NOCR.06122000 edge
>
> =========================================
> | NOCR Created by |
> =========================================
> 1) NOCR.06122000-1 edge
>
> =========================================
> | NOCR Created by |
> =========================================
> 2) NOCR.06122000-2 jack
>
> of course, what I'm looking for is :
>
> =========================================
> | NOCR Created by |
> =========================================
> 0) NOCR.06122000 edge
> 1) NOCR.06122000-1 edge
> 2) NOCR.06122000-2 jack
...
How about:
#open(INDEX,'/web-it/NOCR/nocr.index');
format STDOUT_TOP =
=========================================
| NOCR Created by |
=========================================
.
format STDOUT =
@>>) ^<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<
$i $nocr $who
~ ^<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<
$nocr $who
.
$i="0";
while (<DATA>) {
chop;
($nocr,$who)=split(/\s+/);
write;
$i++;
}
__END__
NOCR.06122000 edge
NOCR.06122000-1 edge
NOCR.06122000-2 jack
--
Bob Walton
------------------------------
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 3336
**************************************