[13626] in Perl-Users-Digest
Perl-Users Digest, Issue: 1036 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 11 03:05:32 1999
Date: Mon, 11 Oct 1999 00:05:17 -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: <939625516-v9-i1036@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 11 Oct 1999 Volume: 9 Number: 1036
Today's topics:
ANN: perl books page <uri@sysarch.com>
ANN: perl books page <uri@sysarch.com>
Re: CGI and perl question (Bill Moseley)
Re: CGI and perl question <bg25@mailexcite.com>
character count hakanogren@my-deja.com
Debugger tutorials <darnold@northcoast.com>
Re: Expiring Pages (Martien Verbruggen)
Re: External site search ( possible?? ) <gellyfish@gellyfish.com>
Re: I need some Perl help (Larry Rosler)
Re: I need some Perl help (Abigail)
Re: Is $$variable allowed like in PHP ? <gellyfish@gellyfish.com>
kindness? was [Re: howto load modules to an ISP website <ltl@rgsun40.viasystems.com>
lookbehind capabilities was [Re: Help - Perl regular ex <ltl@rgsun40.viasystems.com>
Re: lookbehind capabilities was [Re: Help - Perl regula (Ilya Zakharevich)
Re: lookbehind capabilities was [Re: Help - Perl regula <uri@sysarch.com>
Module throws exception only when I'm catching it? (Sean McAfee)
opening files on Windows NT? (jakal)
perl compiler for Win32? <mmreich@world.std.com>
Re: perl compiler for Win32? harris_m@my-deja.com
Re: Question? Writing to file (Abigail)
Re: search a file on a remote server <gellyfish@gellyfish.com>
Session variables in Perl bt@alliknow.com
Re: Session variables in Perl (Bill Moseley)
Re: Simple flock question <wjbell@ERASEjps.net>
Re: Simple flock question (Martien Verbruggen)
spliting on consecutive whitespace ? yeah@rite.com
Re: tool to convert BMPs to GIFs programatically? harris_m@my-deja.com
Re: trouble with hash (Martien Verbruggen)
Re: unused files script (Bill Moseley)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Oct 1999 00:59:11 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: ANN: perl books page
Message-Id: <x7d7ummr1c.fsf@home.sysarch.com>
well here it is, the official launching of the perl books page. i have
been hacking on this for a while and some of you have previewed it. my
web site finally got moved (netsol sux) to my new provider and there i
have installed a proper recent private perl with al the modules i
need. the last place didn't allow telnet and the new one has a very old
perl.
the permanent url is:
http://www.sysarch.com/cgi-bin/perl_books
there is plenty of information on the main page
my goal for this page is to catalog, rate and review all published books
with some perl content. i have 19 right now and there are over 100 kust
with perl in their titles. any help you can offer is appreciated and you
can get you name on the web (whoopie! :-) if you do any work pn this. i
need more help with entering book info and more reviews/links.
check it out, flame/praise me and eventually buy books through my seller
links (non-existant now) so i can retire a rich perl hacker.
have the appropriate amount of fun,
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
www.sysarch.com ----- Perl Books: http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 11 Oct 1999 01:00:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: ANN: perl books page
Message-Id: <x7aepqmqyk.fsf@home.sysarch.com>
well here it is, the official launching of the perl books page. i have
been hacking on this for a while and some of you have previewed it. my
web site finally got moved (netsol sux) to my new provider and there i
have installed a proper recent private perl with all the modules i
need. the last place didn't allow telnet and the new one has a very old
perl.
the permanent url is:
http://www.sysarch.com/cgi-bin/perl_books
there is plenty of information on the main page
my goal for this page is to catalog, rate and review all published books
with some perl content. i have 19 right now and there are over 100 kust
with perl in their titles. any help you can offer is appreciated and you
can get you name on the web (whoopie! :-) if you do any work pn this. i
need more help with entering book info and more reviews/links.
check it out, flame/praise me and eventually buy books through my seller
links (non-existant now) so i can retire a rich perl hacker.
have the appropriate amount of fun,
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
www.sysarch.com ----- Perl Books: http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sun, 10 Oct 1999 23:10:34 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: CGI and perl question
Message-Id: <MPG.126b1f3a64f5ecc19897f1@nntp1.ba.best.com>
Mob-Rules (Mob-Rules@home.com) seems to say...
> How do I make it so you have to go through my page before using my cgi?
> I tried $ENV{'HTTP_REFERER'} != "http://mysite.com/page.html" then print
> access denied but I can still do "http://mysite.com/cgi-bin/mycgi.chi"
> and it works.
http://www.stonehenge.com/merlyn/WebTechniques/col18.html
How come you can post a completely off-topic question and get an answer,
and I post a _perl_ question and it just gets lost in the noise?
> $ENV{'HTTP_REFERER'} != "http://mysite.com/page.html"
This is wrong a number of ways.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Mon, 11 Oct 1999 08:36:19 +0200
From: Bolo<bg25@mailexcite.com>
Subject: Re: CGI and perl question
Message-Id: <8oABOGcIaGYTElup=7xNZrQz8BZQ@4ax.com>
On Sun, 10 Oct 1999 23:40:17 GMT, Mob-Rules <Mob-Rules@home.com>
wrote:
>How do I make it so you have to go through my page before using my cgi?
>I tried $ENV{'HTTP_REFERER'} != "http://mysite.com/page.html" then print
>access denied but I can still do "http://mysite.com/cgi-bin/mycgi.chi"
>and it works.
>Any help?
>Thanks
My unprofessional solutions are:
1. Give your cgi script a very long parameter when you call it. eg.
http://mysite.com/cgi-bin/mycgi.cgi?bolobalasayonaragoodbyemygirl
then check for the query string in your mycgi.cgi file:
ok if $ENV(QUERY_STRING) eq "bolobalasayonaragoodbyemygirl";
You can of course put more in the parameter like e.g. path, etc...
2. access denied if ( ($ENV{'HTTP_REFERER'} !=
"http://mysite.com/page.html") || ( $ENV{'HTTP_REFERER'} !=
"http://mysite.com/cgi-bin/mycgi.cgi"))
It means that people can only access your .cgi from your page.html or
from mycgi.cgi itself. Your page.html should be password-protected,
otherwise it gives no meaning.
I'm greatly appreciated any better solution.
Bolo
------------------------------
Date: Mon, 11 Oct 1999 06:27:40 GMT
From: hakanogren@my-deja.com
Subject: character count
Message-Id: <7ts00k$96l$1@nnrp1.deja.com>
I need help to count the number of times a certain letter appears in a
string.
For example if a have a string "HELLO WORLD" i want to know how many
L's there are in the string.
Would be grateful for answers
//Hakan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Oct 1999 22:44:09 -0700
From: David Arnold <darnold@northcoast.com>
Subject: Debugger tutorials
Message-Id: <38017929.C7ADC139@northcoast.com>
Hello,
Has anyone written a simple tutorial whose purpose is to introduce the
new user to Perl's debugger?
I'm looking for something that writes a program, starts up the debugger,
then walks me through some of the more important early debugging tools.
--
David Arnold
College of the Redwoods
Mathematics Department
7351 Tompkins Hill Road
Eureka, CA 95501
(707) 476-4222
My Home Page
http://online.redwoods.cc.ca.us/instruct/darnold/index.htm
Ordinary Differential Equations Using Matlab
http://www.prenhall.com/books/esm_0130113816.html
------------------------------
Date: 10 Oct 1999 05:07:09 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Expiring Pages
Message-Id: <slrn8007k4.36a.mgjv@wobbie.heliotrope.home>
On Sat, 9 Oct 1999 19:42:59 -0400,
gus@asus.net <gus@asus.net> wrote:
> How do I expire a page once it has loaded. I do not want people to be able
> to refresh the page...
Pages? In perl?
> I tried inserting an expire html header tag. But it does nothing..
I don't think perl cares about html expire tags. I don't even think
there is such a thing.
> Is it my server? I am on NT4 with IIS
You have a perl server? coolies.
If I were you, I would take this question to one of the
comp.infosystems.www.* groups. They might know things about HTML, and
Expire thingies. Alternatively, you could try comp.mail.sendmail or
alt.adjective.noun.verb.verb.verb.
Martien
--
Martien Verbruggen |
Interactive Media Division | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: 9 Oct 1999 19:33:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: External site search ( possible?? )
Message-Id: <7to59h$4ip$1@gellyfish.btinternet.com>
On 9 Oct 1999 16:01:01 GMT Bobo wrote:
>
>
> Any CGI script that can perform external site search ?? (I mean free download)
>
> i.e., A CGI hosted site (search engine) can search all files in another
> non-CGI hosted site.
>
If you want to try and write such a program then you will probably want to
use the module LWP::UserAgent (available from CPAN).
If you simply want a program that is prewritten then this group is most
probably not the best resource for you - you might want to look at some
web directory.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 10 Oct 1999 21:58:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: I need some Perl help
Message-Id: <MPG.126b0e36db646b5498a069@nntp.hpl.hp.com>
In article <slrn802mk2.gep.abigail@alexandra.delanet.com> on 10 Oct 1999
22:33:35 -0500, Abigail <abigail@delanet.com> says...
> Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCCXXXI September
> MCMXCIII in <URL:news:7tqu5d$6ae$1@gellyfish.btinternet.com>:
...
> ,, while(<>)
> ,, {
> ,, chomp;
> ,, $filenames{$_}++;
> ,, }
> ,,
> ,, foreach (keys %filenames)
> ,, {
> ,, print $_,"\t",$filenames{$_},"\n";
> ,, }
>
> Now, what's the point of chomping the name, and then adding a
> newline again when printing it?
One fewer byte in each hash key. :-)
Actually, if they're not chomped, the printed output will include
extraneous newlines after each key printed, won't it?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 11 Oct 1999 01:13:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I need some Perl help
Message-Id: <slrn803003.gep.abigail@alexandra.delanet.com>
Larry Rosler (lr@hpl.hp.com) wrote on MMCCXXXII September MCMXCIII in
<URL:news:MPG.126b0e36db646b5498a069@nntp.hpl.hp.com>:
%% In article <slrn802mk2.gep.abigail@alexandra.delanet.com> on 10 Oct 1999
%% 22:33:35 -0500, Abigail <abigail@delanet.com> says...
%% > Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCCXXXI September
%% > MCMXCIII in <URL:news:7tqu5d$6ae$1@gellyfish.btinternet.com>:
%% ...
%% > ,, while(<>)
%% > ,, {
%% > ,, chomp;
%% > ,, $filenames{$_}++;
%% > ,, }
%% > ,,
%% > ,, foreach (keys %filenames)
%% > ,, {
%% > ,, print $_,"\t",$filenames{$_},"\n";
%% > ,, }
%% >
%% > Now, what's the point of chomping the name, and then adding a
%% > newline again when printing it?
%%
%% One fewer byte in each hash key. :-)
Nah. It's still there. chomp only changes the length field, it
doesn't actually reallocate a smaller string.
%% Actually, if they're not chomped, the printed output will include
%% extraneous newlines after each key printed, won't it?
Not if you don't print the "\n" ....
Abigail
--
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 9 Oct 1999 20:20:47 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <7to82v$4lc$1@gellyfish.btinternet.com>
On Fri, 08 Oct 1999 11:59:20 -0700 David Cassell wrote:
> Daniel Krajzewicz wrote:
>> Recently I noticed, reading the PHP3-manual that this script-language
>> supports
>> the use of construcs like "$$name = value".
>> Hereby the variable with the name "$name" receives the value "value".
>> Is this also possible to construct such operations in Perl ??
>
> <The Brain>
> Are you pondering what I'm pondering?
> </The Brain>
>
> Can PHP be the cause of all these "I want to do $$name = value"
> questions that show up here?
>
No I think its the inability of people to analyse the problem they are trying
to solve sufficiently. I dont believe I have ever heard anyone who has
trained as a programmer ask this question.
I think the question is why people want to do it in Perl and not in C,
COBOL or BCPL ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 11 Oct 1999 04:29:58 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: kindness? was [Re: howto load modules to an ISP website?]
Message-Id: <7trp46$qcs$2@rguxd.viasystems.com>
Dan Baker <dtbaker_@busprod.com> wrote:
:>I do appreciate the helpful content of your followup. Hopefully this
:>newsgroup will someday become a kinder, place to ask a question.
Naa. Human beings lurk here. If you want kindness and love,
get a dog.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 11 Oct 1999 04:17:50 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: lookbehind capabilities was [Re: Help - Perl regular expression question!]
Message-Id: <7trode$qcs$1@rguxd.viasystems.com>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
:>[A complimentary Cc of this posting was sent to lt lindley
:><lee.lindley@bigfoot.com>],
:>who wrote in article <7tr4u9$l58$1@rguxd.viasystems.com>:
:>> A backreference has a fixed length when it is actually tested.
:>??? How do you decide at compile time what length a backreference is
:>going to have?
You don't. You recalculate the length each time it is applied.
But we both already knew this.
:>> Could
:>> it not be made legal in a lookbehind? Let me rephrase. How much
:>> work would it take to make it legal in a lookbehind?
:>>
:>> /(fo+)(?<!k\1(?=d))/: variable length lookbehind not implemented at re line 12.
:>> I'm not advocating quatifiers in the lookbehind that would cause
:>> backtracking within the lookbehind itself.
:>There is no issue with backtracking at all. What is the issue is that
:>the only "reasonable" way to have lookbehind is to teach REx engine to
:>apply a REx backwards.
I wish I had enough "juice" to debate "reasonable" on this, but it
is not likely in the forseeable future. The source to the re engine
apparently requires a large investment of time to grok, even
more than the rest of the perl source.
:>IIRC, I already reserved //r for backward/reversed matches (as in
:>/f.*ck\G/r, which should not look around at all: it could start at
:>pos(), and go backwards).
Um, was there any latent hostility in your example? :-)
Useful, but at some point chaining together re's becomes more
confusing than just using a full blooded parser. There are of
course many other applications, but parsing seems to be the
one that gets the most interest.
:> When REx engine can do this,
:>variable-length lookbehind will be easy too.
It may be easy, but it won't be cheap. The Perl regexp engine
may become known as the most powerful, easiest to shoot yourself
in the foot with weapon in computing history. :-)
OTOH, what I was asking for was relatively simple in comparison.
But, since I'm not implementing it, I'll shut up now.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 11 Oct 1999 05:21:29 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: lookbehind capabilities was [Re: Help - Perl regular expression question!]
Message-Id: <7trs4p$q0u$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to lt lindley
<lee.lindley@bigfoot.com>],
who wrote in article <7trode$qcs$1@rguxd.viasystems.com>:
> :>> A backreference has a fixed length when it is actually tested.
>
> :>??? How do you decide at compile time what length a backreference is
> :>going to have?
>
> You don't. You recalculate the length each time it is applied.
Thanks, but no, thanks. ;-)
> :>There is no issue with backtracking at all. What is the issue is that
> :>the only "reasonable" way to have lookbehind is to teach REx engine to
> :>apply a REx backwards.
>
> I wish I had enough "juice" to debate "reasonable" on this, but it
> is not likely in the forseeable future. The source to the re engine
> apparently requires a large investment of time to grok, even
> more than the rest of the perl source.
You do not need to *read* the source. Having an ability to *write* it
(if required) is enough. [Moreover, if you do not go inside optimizer
("intuit" stuff in regexec.c and "study" stuff in regcomp.c), the code
is pretty straightforward.]
Try to invent how would you implement it.
> Useful, but at some point chaining together re's becomes more
> confusing than just using a full blooded parser.
You have it backwards: the fully bloody parser will create a REx for
you, then you would apply it as if you know what is inside. ;-)
> :> When REx engine can do this,
> :>variable-length lookbehind will be easy too.
>
> It may be easy, but it won't be cheap. The Perl regexp engine
> may become known as the most powerful, easiest to shoot yourself
> in the foot with weapon in computing history. :-)
Emacs can do it. I do not remember anyone shooting himself with
re-backward-search.
> OTOH, what I was asking for was relatively simple in comparison.
Exactly the opposite.
Ilya
------------------------------
Date: 11 Oct 1999 01:41:47 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: lookbehind capabilities was [Re: Help - Perl regular expression question!]
Message-Id: <x77lkump2c.fsf@home.sysarch.com>
>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
IZ> Emacs can do it. I do not remember anyone shooting himself with
IZ> re-backward-search.
that is not a backwards regex. it is a backwards moving search that uses
a forward matching regex. same as search-backwards also compares
forwards as it move backwards through the buffer.
but i am intrigued by the /r modifier. any work being done on it?
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
www.sysarch.com ----- Perl Books: http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 11 Oct 1999 04:21:13 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Module throws exception only when I'm catching it?
Message-Id: <ZAdM3.1542$%6.329647@news.itd.umich.edu>
The Curses module has an AUTLOAD method that looks like this:
sub AUTOLOAD
{
my($name, $val);
($name = $AUTOLOAD) =~ s/.*:://;
croak "Curses does not support the curses constant '$name', used"
unless $_al{$name};
$val = constant($name, $_al{$name});
eval "sub $AUTOLOAD { $val }";
goto &$AUTOLOAD;
}
Mystery #1:
The %_al hash does not contain the key "DESTROY", so it appears that this
method should call croak() whenever a Curses object is destroyed. It
doesn't, normally (see below). I've checked the C source for this module,
and found nothing that would alter this behavior.
Mystery #2:
{ my $win = new Curses; }
This code produces no errors.
eval { my $win = new Curses; };
print $@;
This code prints out
(in cleanup) Curses does not support the curses constant 'DESTROY',
used at ...
So, it looks like I've caught an exception, but no exception would have
been thrown if I hadn't wrapped the Curses object creation and destruction
in an eval{}.
What the heck is going on here?
--
Sean McAfee mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!
------------------------------
Date: Mon, 11 Oct 1999 15:46:57 +0930
From: jakem@camtech.net.au (jakal)
Subject: opening files on Windows NT?
Message-Id: <jakem-1110991546580001@dialup-sa-1-315.uni.camtech.net.au>
opening files on Windows NT?
I have written a few perl programs, mainly on my macintosh.
I am porting one to a Windows NT machine, and am having trouble opening files.
My code looks like this:
open(TEST, ">>test.txt")|| die "can't open test.txt";
and I get the response, "can't open test.txt at
E:\Students\macjm009\petition.pl line 30."
Is this because my program doesn't have the right permissions, or is it
something to do with the syntax???
--
jakal
------------------------------
Date: Sat, 09 Oct 1999 11:28:00 -0400
From: Michael Reich <mmreich@world.std.com>
Subject: perl compiler for Win32?
Message-Id: <37FF5EFF.87249527@world.std.com>
I seem to remember hearing about a tool that compiled Perl scripts into
.exe files for the Win32 platform. Can anyone give me any information as
to what this product is and where I can find it?
Any help is greatly appreciated!
Thanks,
Mike
-- To reply via email, remove *nospam* from address
------------------------------
Date: Sun, 10 Oct 1999 07:21:40 GMT
From: harris_m@my-deja.com
Subject: Re: perl compiler for Win32?
Message-Id: <7tpepv$l90$1@nnrp1.deja.com>
Check out ActiveState.com for a Perl compiler to create .exe file.
Harris
---------------------------------------------------
In article <37FF5EFF.87249527@world.std.com>,
Michael Reich <mmreich@world.std.com> wrote:
> I seem to remember hearing about a tool that compiled Perl scripts
into
> .exe files for the Win32 platform. Can anyone give me any information
as
> to what this product is and where I can find it?
>
> Any help is greatly appreciated!
>
> Thanks,
> Mike
>
> -- To reply via email, remove *nospam* from address
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 9 Oct 1999 23:29:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Question? Writing to file
Message-Id: <slrn8005gb.iq.abigail@alexandra.delanet.com>
ICEMOUNTAIN@prodigy.net (ICEMOUNTAIN@prodigy.net) wrote on MMCCXXXI
September MCMXCIII in <URL:news:7tovu4$hde$1@newssvr04-int.news.prodigy.com>:
;; I want to be able to write to a file but it's not working, the file path is
;; correct and I have it chomd 666.
;; Do you know what is wrong.
Yes. You have a bug.
Perhaps you want to start with using '-w', 'use strict;' and 'use CGI;'
And next time, explain what you mean with "it is not working".
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 9 Oct 1999 19:37:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: search a file on a remote server
Message-Id: <7to5h5$4jl$1@gellyfish.btinternet.com>
On Sat, 09 Oct 1999 15:37:22 GMT d.k. henderson wrote:
> There is an info(?) file that has filenames along with directory paths on the
> ftp server.
>
There might be or on the other hand there might not be :
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
ftp>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 11 Oct 1999 04:12:42 GMT
From: bt@alliknow.com
Subject: Session variables in Perl
Message-Id: <7tro3j$46t$1@nnrp1.deja.com>
ASP pages have "session variables" which allow you to "remember" the
user information for an entire session accross several pages without
having to pass cookies.
<I realize that this is primarily a CGI question, but when I used Deja
to find cgi groups this was at the top of the list and there was only
one other English group on the list that made any sense.>
I would like to replicate this behavior using perl. In other words, I
want to load in defaults for the user and allow them to go to various
pages and still know who is logged in and what their preferences are.
I want to do this without cookies as I have a lot of information about
the user that I want to keep using.
Any help would be greatly appreciated.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Oct 1999 23:01:52 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Session variables in Perl
Message-Id: <MPG.126b1d283d12c0529897ef@nntp1.ba.best.com>
bt@alliknow.com (bt@alliknow.com) seems to say...
> ASP pages have "session variables" which allow you to "remember" the
> user information for an entire session accross several pages without
> having to pass cookies.
> <I realize that this is primarily a CGI question, but when I used Deja
> to find cgi groups this was at the top of the list and there was only
> one other English group on the list that made any sense.>
Yes, this is a CGI question, and should be in the CGI group.
Go back and search deja again. "session id" in the *cgi groups and you
will find lots. I just did.
It's also in a few FAQs.
> I want to do this without cookies as I have a lot of information about
> the user that I want to keep using.
Who said you had to keep all the info in the cookie?
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Sun, 10 Oct 1999 15:09:49 +0000
From: Warren Bell <wjbell@ERASEjps.net>
Subject: Re: Simple flock question
Message-Id: <3800AC3D.E52D5611@ERASEjps.net>
Dan Sugalski wrote:
>
> Warren Bell <wjbell@erasejps.net> wrote:
> > If I use flock to lock files in my perl script but the machine it's
> > running on doesn't have flock will the script still work, just not lock
> > the file?
>
> Nope. flock dies if it's not implemented on the platform you're on. So if
> you want to be safe, wrap it in an eval.
How would I test for flock? Right now I'm using:
open (FILE,"$pagepath") || die "Can't Open $pagepath: $!\n";
flock(FILE,LOCK_EX);
@LINES=<FILE>;
close(FILE);
Thanks
[cut]
------------------------------
Date: 10 Oct 1999 05:15:03 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Simple flock question
Message-Id: <slrn80082u.36a.mgjv@wobbie.heliotrope.home>
On Sun, 10 Oct 1999 02:34:55 +0000,
Warren Bell <wjbell@ERASEjps.net> wrote:
> If I use flock to lock files in my perl script but the machine it's
> running on doesn't have flock will the script still work, just not lock
> the file?
I don't think it will magically work..
From pp_sys.c:
PP(pp_flock)
{
djSP; dTARGET;
I32 value;
int argtype;
GV *gv;
PerlIO *fp;
#ifdef FLOCK
[removed code]
#else
DIE(no_func, "flock()");
#endif
}
Looks like perl will die if you call flock, but it isn't present.
You might have to check yourself (with an eval, for example) whether
you can use flock at all.
> &lock(FILE);
[snip]
> sub lock {
> local($file)=@_;
> flock($file, $LOCK_EX);
> }
This is a bit useless, isn't it? You could have just put the flock
straight in your code. I'd say it's actually a bit confusing. I always
get a bit scared when I see subs called lock or unlock. In this case
they're fine, but I've seen some bad implementations. If the code
contains the flock directly, at least I don't have to hunt around for
the sub.
> Also, could I simplify this code to not have the subroutines? How would
> I show the difference between locking and unlocking?
Errr... locking happens with one constant, and unlocking with another.
LOCK_EX is for an exclusive lock, and LOCK_UN for unlock. Just as a
matter of curiosity: Did you actually read the documentation on flock?
# perldoc -f flock
Martien
--
Martien Verbruggen |
Interactive Media Division | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd. | great height, over water.
NSW, Australia |
------------------------------
Date: Sun, 10 Oct 1999 04:27:07 GMT
From: yeah@rite.com
Subject: spliting on consecutive whitespace ?
Message-Id: <38011292.644311867@news.earthlink.net>
Hi there,
Im attempting to parse out some mail logs but Ive run into a catch:
$FS = "[<>=\t ]";
open(LOG,"/var/log/maillog");
while(<LOG>) {
($f1,$f2,$f3,$f4)=split($FS,$_,999) ;
}
The problem with this is that if there are two consecutive spaces ,
each of those spaces are considered field separators. On the advice of
a previous posting I added \s+ to $FS but it seems that \s is
completely ignored. This is odd since \t works fine. ' +' doesnt work
either. Any and all advice is appreciated.
wherbert1@earthlink.net (drop the 1)
------------------------------
Date: Sun, 10 Oct 1999 08:00:21 GMT
From: harris_m@my-deja.com
Subject: Re: tool to convert BMPs to GIFs programatically?
Message-Id: <7tph2h$mkq$1@nnrp1.deja.com>
This is not exact answer to the question but some way
around to achieve similar result for which the question is
asked.
Instead of .gif you can consider useing .png file format.
Check out following link for a free tool which convert
your .bmp file to .png file -
http://www.gcnet.com/bw/files/bmptopng.txt
http://www.gcnet.com/bw
You will find bmptopng.zip file on the above site. Above program is
written by Bryan Wilken.
Regards,
Harris M.
In article <rvk62rh1rad28@corp.supernews.com>,
"Colin Reinhardt" <colinrei@oz.net> wrote:
> I want to convert some BMPs to GIFs using code, without any user
> interaction.
> Is there a utility that is scriptable, or batchable, or supports
automation
> to do this?
> Ideally it would be freeware and re-distributable...
> Thank you,
>
> - Colin Reinhardt
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 10 Oct 1999 05:20:43 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: trouble with hash
Message-Id: <slrn8008dg.36a.mgjv@wobbie.heliotrope.home>
On Sun, 10 Oct 1999 01:05:22 GMT,
Mark P. <mag@imchat.com> wrote:
[snip construction of a hash or array references]
> @new_answer = $answer{$question_number}; # obviouly this aint workin.
I know you got an answer-in-a-box on this, but I'd like to explain a
few more things about this, and indeed point you to some documentation
The answer you got is
@new_answer = @$answer{$question};
This will work. It will make a _copy_ of the array that is held by the
array reference. If you actually want to work with the array itself,
you should do:
$na_ref = $answer{$question};
$na_ref is now a reference to an array. Get to its elements with
$$na_ref[0];
$na_ref->[0];
foreach (@$na_ref) {}
etc.
Sometimes you do not want to copy whole arrays, especially if they're
big. And especially if you actually want to modify the original (If I
had a cent for every time I saw cody copying an array, modifying the
copy, and then copy it back, I'd be only modestly richer than I am
now, but still quite a bit :)
Some excellent documentation on this:
# perldoc perlref
# perldoc perllol
# perldoc perldsc
Martien
--
Martien Verbruggen |
Interactive Media Division | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd. | crops where there ain't no crops.
NSW, Australia |
------------------------------
Date: Sun, 10 Oct 1999 23:02:44 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: unused files script
Message-Id: <MPG.126b1d5b9d9542959897f0@nntp1.ba.best.com>
Ace (kawaii_1@hotmail.com) seems to say...
> Does anyone have a script that will search all of
> your html files and report on which files on your server are unused?
Define 'unused'
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
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 1036
**************************************