[17488] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4908 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 16 21:10:34 2000

Date: Thu, 16 Nov 2000 18:10:16 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974427016-v9-i4908@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 16 Nov 2000     Volume: 9 Number: 4908

Today's topics:
    Re: No idea about perl, Long post, short question (Martien Verbruggen)
    Re: No idea about perl, Long post, short question (Martien Verbruggen)
    Re: No idea about perl, Long post, short question <flavell@mail.cern.ch>
    Re: No idea about perl, Long post, short question <siwatkins@iee.org>
    Re: No idea about perl, Long post, short question <siwatkins@iee.org>
    Re: No idea about perl, Long post, short question <siwatkins@iee.org>
    Re: No idea about perl, Long post, short question <siwatkins@iee.org>
        perl readdir() question... <ztc@bigfoot.com>
    Re: perl readdir() question... (Martien Verbruggen)
    Re: perl readdir() question... guthrie_linck@my-deja.com
    Re: perl readdir() question... guthrie_linck@my-deja.com
    Re: perl readdir() question... (Martien Verbruggen)
        please help!!! pos() and m//g bugs!!! guthrie_linck@my-deja.com
        PLEASE, please NEED AN HELP: cookies, LWP and cache con <artax@shineline.it>
    Re: pos() and global pattern matching guthrie_linck@my-deja.com
        question about canned perl script rdayk@my-deja.com
    Re: question about canned perl script <jeff@vpservices.com>
    Re: solution: installing Image::Magick to host as non-r dtbaker_dejanews@my-deja.com
        Spidering <diab.lito@usa.net>
    Re: Spidering (Randal L. Schwartz)
        tree-sync.pl <ekulis@apple.com>
    Re: tree-sync.pl guthrie_linck@my-deja.com
        unload/reload pm's? <mikeegg@prodigy.net>
    Re: Why are references useful? <sumus@aut.dk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 16 Nov 2000 23:18:51 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: No idea about perl, Long post, short question
Message-Id: <slrn918qpv.425.mgjv@verbruggen.comdyn.com.au>

On Thu, 16 Nov 2000 19:35:49 -0000,
	Simon Watkins <siwatkins@iee.org> wrote:
> "Michael Carman" <mjcarman@home.com> wrote in message
> news:3A13EEA8.61E5ADFF@home.com...
>>
>> Get those down, and you'll be welcomed with open arms and find this to
>> be a very friendly and helpful place. Welcome.
> 
> Micheal,
> 
> Thank you for your post, and the points you make - yours was the most civil
> of the public responses sent to me.  You are correct is saying that this
> doesn't seem like a very helpful place :-)  I accept all your comments about
> the things that rile the regulars, however irrational some of them are.  The
> newsgroup seems as inaccessible as the language at this time.  Having read
> many of the posts here, (and my experience may be tainted by my brief
> acquaintance with those with more time to criticize posting style than to
> help), I have to say it does not even compare to many of the other support
> forums I have frequented.

You really are inflammatory. People not helping YOU does not mean a
thing. Before making stupid statements like that, you should acquire a
larger sample space. 

As has been pointed out to you a few times already, people here don't
mind helping. Just _read_ the newsgroup if you don't believe it,
instead of going on and on about how unhelpful everyone is to you.
We've stated the reasons for the reactions you got. Stop whinging and
fix your attitude.

Your score in my killfile just plummeted below visibility level. At
least you've reached that goal.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.   | make a better idiot.
NSW, Australia                  | 


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

Date: Thu, 16 Nov 2000 23:45:25 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: No idea about perl, Long post, short question
Message-Id: <slrn918sbp.425.mgjv@verbruggen.comdyn.com.au>

On Thu, 16 Nov 2000 23:04:57 -0000,
	Chris Stith <mischief@velma.motion.net> wrote:

[snip of most excellent post]

Excellent indeed. You should keep this around for the next time we
have someone like this.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.   | you come to the end; then stop.
NSW, Australia                  | 


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

Date: Fri, 17 Nov 2000 00:55:56 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <Pine.GHP.4.21.0011170054280.12678-100000@hpplus03.cern.ch>

On 15 Nov 2000, Randal L. Schwartz wrote:

> For those of you with an itchy plonk finger, I hope that's enough.

I read this thread backwards, so the hon. Plonkee was already in the
score file long before I reached this point.

You wonder why some people bother, don't you?



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

Date: Fri, 17 Nov 2000 00:43:53 -0000
From: "Simon Watkins" <siwatkins@iee.org>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <58%Q5.4598$B02.91742@news6-win.server.ntlworld.com>

"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrn918qpv.425.mgjv@verbruggen.comdyn.com.au...
> You really are inflammatory.

Martien Verbruggen also wrote in a previous message:

>Nope. Just someone who's figured out the statistical relation between
>top posting and cluelessness. Just like many people here have.

Inflammatory.

 People not helping YOU does not mean a
> thing. Before making stupid statements like that, you should acquire a
> larger sample space.

Inflammatory.

> As has been pointed out to you a few times already, people here don't
> mind helping. Just _read_ the newsgroup if you don't believe it,
> instead of going on and on about how unhelpful everyone is to you.
> We've stated the reasons for the reactions you got.

To which I clarified.

Stop whinging and
> fix your attitude.

Inflammatory.

> Your score in my killfile just plummeted below visibility level. At
> least you've reached that goal.

Great, I'll not have to read any more inflammatory posts from you.

Thanks,

Simon





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

Date: Fri, 17 Nov 2000 00:57:24 -0000
From: "Simon Watkins" <siwatkins@iee.org>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <Nk%Q5.4641$B02.92245@news6-win.server.ntlworld.com>

"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
news:m1aeb0ngcn.fsf@halfdome.holdit.com...
> Just to clarify once more since you seem to still be missing this
> clue:
>
>   A stealth CC is a CC'ed copy of a news posting that IS NOT MARKED AS
>   SUCH, and causes grief for those of us who are obsessive answerers
>   of questions since we don't know that the response will also be seen
>   by the millions of people who are also reading the group, and feel
>   it is our obligation to answer personally.

Randal.  I stand informed, and I do apologize for this - the intent was not
meant to inconvenience you.
>
> You sir, did not mark your CC as a "courtesy mail copy of a posting".
> That differs from my response to you, which *WAS* marked as such. (Go
> back and check, as is THIS one.)

> I respect that you are new in the group, and do not know all the
> customs here.  I'm just amazed you violated so many of them at once on
> your first posting.  That could be a new record! :)

I do tend to frequent newsgroups somewhat less rigid in their customs I
concede.

> This also means you don't understand Usenet in general, where you are
> supposed to read a group for a few weeks before your first posting, to
> understand the culture and players.

Yes, agreed.  Ordinarily I would of and perhaps should have lurked for a
while :-)

There's another free clue for
> you, so you won't have this culture shock in your next online
> discussion area.

Sir, I would wish to be conciliatory to you, and am trying to be civil.
Please can we omit the patronizing comments as perhaps a basis for a less
hostile atmosphere.

> It's not about making everyone the same.  It's about making everyone
> compatible, though.

Agreed.  The norms of this group are somewhat different, and dare I say,
more old fashioned (call it traditional if you will) than many groups that
exist today.  Some have evolved differently.

> In particular, CLPM posters have a disdain for being a replacement
> help desk for a commercial software, *and* for being requested to
> provide substitute brains for helping someone out who really just
> would be better off hiring a consultant.  You triggered both of those
> in one post, and that's what I pointed out.

Conceded - but hopefully, by now, you will have understood my intentions,
and these were in actual fact somewhat different than those assumed.

>And then you
> stealth-CC'ed

Please can we agree to differ on this one :-)  Stealth implies malice in
this context, and I can assure that this was not the case.  I was in fact
returning the courtesy of your cc mail prior to your post appearing on my
news server.  Rightly or wrongly, stealth was no intention of mine in
cc'ing;  however I acknowledge the inconvenience this can potentially cause.

>and upside-down posted (two more culture violations),

Whilst I wouldn't wish to debate this at length, this is one area most
definitely subject to evolution in certain newsgroups, no doubt due to some
great degree to the proliferation of the Outlook client (rightly or
wrongly).  I do normally adapt my style to conform to the groups within
which I post, quoting accordingly - on this occasion I didn't in my first
reply.

s
o
> my "lack of clue" meter pegged, and it was time for me to keep talking
> about it in public, to innoculate the rest of the group from you. :)

And my hackles were raised by your initial terse response, and the rest they
say, is history.  I have no desire to fight a war of words with you, and
have in fact apologized for my subsequent inflammatory response to yours.
In the interests of harmony, perhaps we can resume afresh?

Simon




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

Date: Fri, 17 Nov 2000 01:02:58 -0000
From: "Simon Watkins" <siwatkins@iee.org>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <_p%Q5.4660$B02.92918@news6-win.server.ntlworld.com>

"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
news:m13dgsng3g.fsf@halfdome.holdit.com...
> >>>>> "Simon" == Simon Watkins <siwatkins@iee.org> writes:
> Then this is how your post could have read to get maximum impact and
> minimum offense:
>
>     I have a commercial piece of software that I'm taking beyond its
>     original design, so the original creators won't help.  I know very
>     little Perl, and do not have time to become an expert, but I'm
>     also working on a non-profit project, and do not have cash to hire
>     a consultant.
>
>     So I'm looking for some private consulting for free.  Is anyone
>     here willing to do some consulting for free for a good cause?
>     Please reply to me via email.

I do believe this cuts both ways.  I'm sure if:

"So why are you posting here instead of getting support directly from
the company that produces Actinic Catalog?"

Were rephrased as:

"Simon,

It appears that you are new here, and your posts sets off alarm bells for
the following reasons... (etc)
Could you perhaps clarify why you are posting here instead of getting
support directly from Actinic?"

I do believe things may not have got out of hand as they did.

> There.  Plain and simple, I think that's what you're asking for.
> "consulting for free" is not what Usenet's about.  Maybe that's where
> you got confused. :)

I didn't get confused.  My mistake was in posting prior to noting that the
norms in this group were somewhat, how shall I say... less tolerant, of
loosely and hastily compiled requests for assistance.
Nonetheless, I note the comments, and once more, hope you will consider that
my conciliatory posture toward you is made in good faith.

Regards,

Simon




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

Date: Fri, 17 Nov 2000 01:37:59 -0000
From: "Simon Watkins" <siwatkins@iee.org>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <RW%Q5.4726$B02.89918@news6-win.server.ntlworld.com>

"Chris Stith" <mischief@velma.motion.net> wrote in message
news:t18q0pm9ue1s73@corp.supernews.com...

Chris,

You make some good points in your rather lengthy post :-), and hopefully
you'll consider my right to reply.

> This place has been very helpful to me. In fact, it has been very helpful
> even when I don't post questions. Reading the group before posting is more
> than an "arcane misplaced tradition". It tends to give answers before a
> question is asked repeatedly.

I have found most newsgroups to be very helpful in my experience, and
similarly I reciprocate in those that are of particular interest and relate
to my own skills.  If you take a look back at my own posts, you will see
that I did actually try and establish from both the messages within this
group, and in Deja news to see if my question had been asked before.  The
reality was it hadn't, and hence my post.  My comments regarding arcane
misplaced tradition relate to what I believe (as is my right) some of the
contributors to this newsgroup hold above its purpose as a forum for
discussion on topics regarding perl.  That is just a personal view, and has
been garnered from my early impressions within.  I concede, that it may not
be the same view as held by others, but such differences of opinion are
every man and woman's right.

> This group is also mostly friendly, if you follow the cultural norms.
> There are many resources which will tell you how to get along on Usenet
> even if you haven't taken enough time reading the group to figure it
> out on your own.

I do find comments such as that inflammatory and condescending.  However, I
have been using Usenet long enough to figure things out on my own.

 I wouldn't dare go to China or Somalia or even France
> or the United Kingdom and expect customs and norms for public behavior
> to be identical to my previous experiences in the US and Canada.

And nor I.  Similarly I wouldn't expect to go to America and receive an
hostile response on asking a question.  I would never dream of welcoming
someone into a community of which I was part in such a manner.

> The OP keeps referring to Usenet as "part of the Internet" and a
> "technological resource". He doesn't seem to understand that Usenet
> existed apart from the Internet in days past or that Usenet is a
> cultureof its own. These are serious issues for anyone who expects to
> be taken completely seriously.

This is another example of assumptions being made.  I am well aware of
Usenet's origins, and such patronizing comments oft cause inflammatory
responses.  I find it surprising that so many assumptions have been made by
so many intelligent people with so little information :-)

> The posts explaining the OP's position were not apologies or even
> concessions.

I do beg to differ:  My post.

>Randal,

><olive branch>It appears that we may have got off on the wrong foot,
through
>my clouding my initial query with superfluous information, leading to your
>seemingly hostile response to my first post in this forum.  On reflection,
>d in my experience, these things can get silly and escalate for no
>tional reason.  I have explained myself (hopefully with more clarity) in
>y reply to Jon Ericson a few minutes ago.  Perhaps we can start again?
>/olive branch>

>Simon

They were defensive and excusatory. Naturally defensive
> and excusatory responses are not welcomed as openly. They are evidence
> pointing more towards contempt of the norms than towards an initial
> misunderstanding, and more towards conceit than humility.

I see no reason that I should adopt humility in seeking assistance.

Contempt and
> conceit are disrespectful, especially in the Usenet culture and the
> culture of technological specialists (including programmers) that
> make up the core of the Usenet culture.

I find these remarks equally disrespectful.  You know nothing of my
technical skills in other areas.  Nothing.  I consider myself as much part
of the core of Usenet culture as yourself.

>Usenet exists for the clear
> exchange of ideas across geographical boundaries. The more closely
> posts adhere to Usenet norms, the easier it is to keep the content
> clear.

Agreed.  I have no argument with this, and am myself surprised at so much of
this:

> Anything that wastes time, bandwidth, or disk space in a
> group this voluminous is considered very rude. Posts with inadequate
> background waste all three, especially time. I'd be concerned this
> post was a waste if I didn't consider it informative of why people
> are upset.

I can assure you from the personal responses that I have received, that
those upset form a minority.  I myself am upset at how much has been assumed
about me with no just reason, comments made indicating that I am "Clueless",
someone who doesn't understand Usenet Culture, calling my technological
skills in other areas into question et al.

> You already made public attacks against Randal, so I guess it's true
> you need not mention his name.

I have apologized for my personal comments directed to Randal - publicly.
Why is that you see fit to ignore that?  It is water under the bridge, but
my initial response to him, just in case you had forgotten was as follows:

>Thank you for your reply.  I can only hope that given your response, that
>others more gracious will be still be kind enough to assist.

Inflammatory perhaps but hardly a personal attack. Nonetheless, I shouldn't
have made the comment.  My response was met with:

>- doesn't know Perl that well himself, so it looks like he's trying to get
  >replacement brains for free ("gimme a fish please")
>- upside down quoter (usually a good clue)

>and something you can't know unless I tell you:

>- commits usenet error of *** stealth CC *** (on this post)

>For those of you with an itchy plonk finger, I hope that's enough.

Would you consider that a personal attack?

> His name, by the way, means a lot more
> to the Perl groups than everything you could post defaming him. If you
> really want help from Randal so badly, buy one of his books on Perl.
> After reading one of his books, read some Nathan Torkington or some
> Larry Wall. The Perl Journal, Learning Perl, Programming Perl, etc. are
> some of the most helpful resources for Perl programmers. I'd dare say
> that writing the books and magazine articles (Randal does magazine
> columns, too, BTW) that the whole world can use to learn Perl is helpful.

I thank you for your list of references, I will use them to study the
language.  I have no desire to continue a word war with Randal, and have
said as much.

> This is not a clique. This is a `group', yes. That should be inferred by
> the classification `newsgroup'. Every group expects someone to follow the
> rules to become a part of the group. This newsgroup is not exclusionary
> by any means.

No, that has become apparent in private email.

I've seen all levels of questions answered here. I've seen
> questions asked by people of many nationalities answered. I've even seen
> polite responses referring posters to other groups when questions are
> asked in the wrong group.

I think this is where the problem initially lay - I took Randal's response
to me as rude.  I believe we both could have worded are responses better, in
which case there would have been none of this.

What all of these questions had in common was
> that the posters seemed to be friendly in their wording, aware of the
> stylistic rules, and willing to admit they were wrong if they were wrong.

I don't believe I was anything but polite in my initial post.  I took
Randal's reply to be non-polite.  I have admitted I was wrong in one of my
earlier posts to Randal.  I would ask that you re-read the thread before
propogating implication that I haven't.

> These are some of the same things we were taught in kindergarden where I
> went to school. Basically, if you make an effort to be part of the group,
> the group accepts you. If you try too much you might be considered silly,
> but will be tolerated (like some people might say about me, since I
> post so much at once sometimes), but if you don't try at all and cast
> yourself as an outsider, that's how you'll be treated.

One generally wishes to be part of a group in which they feel welcomed.  If
the group dynamics are such that initial encounters are met with hostile
reponses, how much is someone likely to desire to be part of that group and
conform to its norms?

> I consider much of your post to contain little kindness or regard.

Similarly so.  In places I considered you to be propagating falsehoods,
casting aspersions upon my character and guilty of the same sins of which
you accuse me - those are my opinions, to which I am entitled.  Nonetheless,
I have tried to maintain balance in my reply, as I felt such a lengthy post
merited response.  One would hope that we could end this discussion, as it
has gone on long enough.  Perhaps we can agree on that.

Simon






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

Date: Fri, 17 Nov 2000 00:08:15 GMT
From: "Zachary Cooper" <ztc@bigfoot.com>
Subject: perl readdir() question...
Message-Id: <PF_Q5.63$Xt6.16149@typhoon2.ba-dsg.net>

I have the following perl script in my cgi-bin.  It correctly lists the
contents
of the directory $dirname in the command prompt through the interpreter,
but returns nothing from my cgi-bin...?

#!/usr/bin/perl
use CGI;
use Cwd;
$q = new CGI;
$dirname = "C:\\demo";
chdir $dirname || die "Can't change to $dirname: $!\n";
opendir(DIR, ".") || die "Can't open $dirname: $!\n";
while (defined($file = readdir(DIR)) ) {
 if (-d $file) {
  print "$file:d\n";
 }
 if (-T $file) {
  print "$file:f\n";
 }
}
close(DIR);
exit(0);




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

Date: Fri, 17 Nov 2000 00:39:07 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: perl readdir() question...
Message-Id: <slrn918vgf.425.mgjv@verbruggen.comdyn.com.au>

On Fri, 17 Nov 2000 00:08:15 GMT,
	Zachary Cooper <ztc@bigfoot.com> wrote:
> I have the following perl script in my cgi-bin.  It correctly lists the
> contents
> of the directory $dirname in the command prompt through the interpreter,
> but returns nothing from my cgi-bin...?

What does 'returns nothing' mean? It exits with an error? You don''t
get any output?

The Perl FAQ, section nine has some wonderful info about how to debug
problems with CGI and Perl.

> #!/usr/bin/perl

#!/usr/bin/perl -w
use strict;

> use CGI;

for debugging:

use CGI::Carp qw(fatalsToBrowser);

> use Cwd;
> $q = new CGI;
> $dirname = "C:\\demo";

my $dirname = "c:/demo";

The system calls on Win32 systems understand the slash as directory
separator perfectly fine. using that avoid the backwhacking frenzy
that otherwise arises.

> chdir $dirname || die "Can't change to $dirname: $!\n";
> opendir(DIR, ".") || die "Can't open $dirname: $!\n";

opendir(DIR, $dirname) or die "Cannot open $dirname: $!\n";

Note that if you do this, you will need to refer to 

"$dirname/$file";

I always find it worth it not to use chdir unless I really need to.

> while (defined($file = readdir(DIR)) ) {
>  if (-d $file) {
>   print "$file:d\n";
>  }
>  if (-T $file) {
>   print "$file:f\n";
>  }
> }
> close(DIR);
> exit(0);

No need for the exit.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Little girls, like butterflies, need
Commercial Dynamics Pty. Ltd.   | no excuse - Lazarus Long
NSW, Australia                  | 


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

Date: Fri, 17 Nov 2000 00:35:43 GMT
From: guthrie_linck@my-deja.com
Subject: Re: perl readdir() question...
Message-Id: <8v1ugv$caq$1@nnrp1.deja.com>




why do you have the directory name hard coded?
this script will always and only list the contents of $dirname!
regardless of what directory you run it from, because you
always chdir() into c:\\demo!


In article <PF_Q5.63$Xt6.16149@typhoon2.ba-dsg.net>,
  "Zachary Cooper" <ztc@bigfoot.com> wrote:
> I have the following perl script in my cgi-bin.  It correctly lists
the
> contents
> of the directory $dirname in the command prompt through the
interpreter,
> but returns nothing from my cgi-bin...?
>
> #!/usr/bin/perl
> use CGI;
> use Cwd;
> $q = new CGI;
> $dirname = "C:\\demo";
> chdir $dirname || die "Can't change to $dirname: $!\n";
> opendir(DIR, ".") || die "Can't open $dirname: $!\n";
> while (defined($file = readdir(DIR)) ) {
>  if (-d $file) {
>   print "$file:d\n";
>  }
>  if (-T $file) {
>   print "$file:f\n";
>  }
> }
> close(DIR);
> exit(0);
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 17 Nov 2000 00:59:35 GMT
From: guthrie_linck@my-deja.com
Subject: Re: perl readdir() question...
Message-Id: <8v1vtk$da7$1@nnrp1.deja.com>



oh --  didn't realize it was a cgi...

you have to:

print "Content-type: text/html\n\n";

i believe to output correctly to a browser, you always
have to do this first. right??


In article <slrn918vgf.425.mgjv@verbruggen.comdyn.com.au>,
  mgjv@tradingpost.com.au wrote:
> On Fri, 17 Nov 2000 00:08:15 GMT,
> 	Zachary Cooper <ztc@bigfoot.com> wrote:
> > I have the following perl script in my cgi-bin.  It correctly lists
the
> > contents
> > of the directory $dirname in the command prompt through the
interpreter,
> > but returns nothing from my cgi-bin...?
>
> What does 'returns nothing' mean? It exits with an error? You don''t
> get any output?
>
> The Perl FAQ, section nine has some wonderful info about how to debug
> problems with CGI and Perl.
>
> > #!/usr/bin/perl
>
> #!/usr/bin/perl -w
> use strict;
>
> > use CGI;
>
> for debugging:
>
> use CGI::Carp qw(fatalsToBrowser);
>
> > use Cwd;
> > $q = new CGI;
> > $dirname = "C:\\demo";
>
> my $dirname = "c:/demo";
>
> The system calls on Win32 systems understand the slash as directory
> separator perfectly fine. using that avoid the backwhacking frenzy
> that otherwise arises.
>
> > chdir $dirname || die "Can't change to $dirname: $!\n";
> > opendir(DIR, ".") || die "Can't open $dirname: $!\n";
>
> opendir(DIR, $dirname) or die "Cannot open $dirname: $!\n";
>
> Note that if you do this, you will need to refer to
>
> "$dirname/$file";
>
> I always find it worth it not to use chdir unless I really need to.
>
> > while (defined($file = readdir(DIR)) ) {
> >  if (-d $file) {
> >   print "$file:d\n";
> >  }
> >  if (-T $file) {
> >   print "$file:f\n";
> >  }
> > }
> > close(DIR);
> > exit(0);
>
> No need for the exit.
>
> Martien
> --
> Martien Verbruggen              |
> Interactive Media Division      | Little girls, like butterflies, need
> Commercial Dynamics Pty. Ltd.   | no excuse - Lazarus Long
> NSW, Australia                  |
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 17 Nov 2000 01:47:35 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: perl readdir() question...
Message-Id: <slrn9193gs.425.mgjv@verbruggen.comdyn.com.au>

On Fri, 17 Nov 2000 00:39:07 GMT,
	Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> 
> #!/usr/bin/perl -w
> use strict;
> 
>> use CGI;
> 
> for debugging:
> 
> use CGI::Carp qw(fatalsToBrowser);

add a 

my $cgi = CGI->new();
print $cgi->header('text/plain');

too.. or something equivalent. The CGI.pm documentation tells you
more.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | The gene pool could use a little
Commercial Dynamics Pty. Ltd.   | chlorine.
NSW, Australia                  | 


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

Date: Fri, 17 Nov 2000 00:38:51 GMT
From: guthrie_linck@my-deja.com
Subject: please help!!! pos() and m//g bugs!!!
Message-Id: <8v1umr$ccq$1@nnrp1.deja.com>

# someone please help!!!
# does anyone know why global pattern matching in assignment to a list
# screws up the pos() function? this strange behavior has confounded me
# for hours until i finally realized where the bug was coming from.

#!/usr/local/bin/perl

$_ = shift;

my ($a, $b);

# assignment here seems to wipe out pos() ???? why???
($a, $b) = /(\w+):(\w+)/g;

# if you do it this way, pos() is preserved correctly
#/(\w+):(\w+)/g;
#($a, $b) = ($1, $2);

print "a='$a'\n";
print "b='$b'\n";
print "pos=", pos(), "\n";



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 17 Nov 2000 00:32:02 +0100
From: "Federico" <artax@shineline.it>
Subject: PLEASE, please NEED AN HELP: cookies, LWP and cache control!!!!
Message-Id: <3a146e88_1@news.telnetwork.it>

Hi all,

    I have a big problem and no idea how to solve it. I would be very happy
is somebody could catch this little challenge and give me an help.


   The problem is the following: I have to download a page using the perl
module LWP (the URL change at every request) ans its address could be this
one:
http://service.bfast.com/bfast/click?bfmid=1921220&siteid=35414878&bfpid=086
162036941&bfmtype=movies If you try with IE or Netscape you could raalize
that (and maybe this is one of the causes of the problem!) before you obtain
the answer page there will be TWO rediretcs. Anyway using the browser all
work correctly.

    On the countrary usind the metod GET with the Perl module LWP:


         use LWP::UserAgent;

         my($interfaccia) = new LWP::UserAgent;
         my($richiesta);
         $interfaccia->agent('Mozilla/5.0');
         $interfaccia->timeout(30);

          $richiesta=HTTP::Request-> new('GET' =>
'http://service.bfast.com/bfast/click?bfmid=1921220&siteid=35414878&bfpid=08
6162036941&bfmtype=movies' );

        $richiesta->content_type('application/x-www-form-urlencoded');

          $risultato = $interfaccia->request($richiesta);
          $temp = $risultato->as_string;

          print $temp;

(it could be i have done mistakes or fogotten something coping the code, but
the original one is correct it works well with all the other addreses)

you will botain an ERROR MESSAGE from the host server of this kind (this is
the print of the headers):


HTTP/1.1 200 OKCache-Control: no-cacheConnection: Keep-AliveDate: Thu, 16
Nov 2000 12:23:29 GMTPragma: no-cachePragma: no-cacheServer:
Microsoft-IIS/5.0Content-Length: 19386Content-Type: text/htmlContent-Type:
text/html; charset=windows-1252Expires: Thu, 01 Dec 1994 16:00:00
GMTExpires: Wed, 11 Aug 1999 07:00:00 GMTExpires: 0Client-Date: Thu, 16 Nov
2000 12:23:30 GMTClient-Peer: 199.2.223.1:80Set-Cookie:
SITESERVER=ID=83d9b27a6d8d7e3e7e4e9f73e1540cc7; expires=Monday, 01-Jan-2035
00:00:00 GMT; path=/; domain=.800.comTitle: Incorrect Access Permission

What i can understand is that the remote server does a cookies cache control
and since the module LWP hasn't this function the server returns an error.

    Does somebody know how to solve this problem?


    I have tried  to lunch two requests: the first to obtain a cookies-set
and the second one with the cookies-set just obtained to get the wanted
response page  without the cache controll considering that the cookies were
already present. I have done it adding before the previus code this
instructions


         use HTTP::Cookies;
         my($biscottino) = new HTTP::Cookies;

and after the same previus code

          $biscottino->add_cookie_header($richiesta);
          $risultato = $interfaccia->request($richiesta);
        $temp=$risultato->as_string.$temp;

but it doesn't work!


    Please if somebody knows how to solve this problem ... could it write me
at artax@shineline.it ???

    Thank you, sorry for my terrible english, from italy ^_^

        Federico Bari.









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

Date: Thu, 16 Nov 2000 23:37:40 GMT
From: guthrie_linck@my-deja.com
Subject: Re: pos() and global pattern matching
Message-Id: <8v1r43$9cg$1@nnrp1.deja.com>

god!! i can't believe that!
but even so, i took out that typo-twiddle but, the assignment
still seems to interfere with the value held in pos()...

why is this? i really need to know... i am dynamically generating code
that needs to use this and it would be really annoying to have
to add in code that does what i need to do here....


In article <48m81tsg1dihr6v9f5qud6d0ai0pbd89dh@4ax.com>,
  Bart Lateur <bart.lateur@skynet.be> wrote:
> guthrie_linck@my-deja.com wrote:
>
> >($a, $b) =~ /(\w+):(\w+)/g;
>
> I think you have a twiddle too many.
>
> And yes, the /g modifier and pos() are connected.
>
> --
> 	Bart.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 16 Nov 2000 23:00:01 GMT
From: rdayk@my-deja.com
Subject: question about canned perl script
Message-Id: <8v1ote$7ae$1@nnrp1.deja.com>

Hi everyone,
I have read all the FAQs I can find about perl and haven't found the
answer to what will no doubt strike you as an idiotic question.
I am using a "canned" perl script to track hits. It appears to be
working but I don't think perl is residing in any of our virtual
directories. I asked the previous webmaster and he doesn't know if we
have perl or not. So I downloaded a binary version of perl. Now I would
like to FTP it to the appropriate virtual directory, but I don't know
which files have to be sent.
I want to send perl to our server then delete it from my HD it is
taking up too much space and I am not a programmer, just a lowly
webmaster. Which file should I send?
Thanks,
Rachel


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 16 Nov 2000 15:26:56 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: question about canned perl script
Message-Id: <3A146D40.AB38B452@vpservices.com>

rdayk@my-deja.com wrote:
> 
> I am using a "canned" perl script to track hits. It appears to be
> working but I don't think perl is residing in any of our virtual
> directories. 

If it is a Perl script and it works, then you must have a perl
executable lying around somewhere.  If you are on *nix, type "which
perl" on the command line to find out where the executable is loated or
type perl -v or perl -V to get more info about the installed version of
perl.  If you are on windoze, use the start menu find to locate
perl.exe.  If you are on something else, use whatever file search tools
are available to look for it.

>I asked the previous webmaster and he doesn't know if we
> have perl or not. So I downloaded a binary version of perl. Now I would
> like to FTP it to the appropriate virtual directory, but I don't know
> which files have to be sent.

You are better off logging on to the server and FTPing the binary from a
trusted source like www.perl.com or www.activestate.com and then
performing the installation there on your server.  Installation is not
usually simply a matter of files, but also of things like environment or
registry settings depending on your OS.

> I want to send perl to our server then delete it from my HD it is
> taking up too much space and I am not a programmer, just a lowly
> webmaster. Which file should I send?

Unless your local computer is exactly the same operating system as your
web server this won't work.  If the OSs are the same and you downloaded
a binary that was part of a self-installing executable, it is that
executable rather than any of the files it installed that you would want
to FTP to the server and run the self-installing executable there.

P.S. If you are, by your own definition "not a programmer", I am not
sure how wise it is to install perl and perl scripts on your server
unless you will be hiring consultants whom you trust to manage it for
you.

-- 
Jeff


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

Date: Fri, 17 Nov 2000 00:18:11 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: solution: installing Image::Magick to host as non-root user
Message-Id: <8v1tfs$bd6$1@nnrp1.deja.com>

In article <slrn8vsqdp.710.sholden@pgrad.cs.usyd.edu.au>,
  sholden@cs.usyd.edu.au wrote:
> On Tue, 31 Oct 2000 05:40:27 GMT,
> 	dtbaker_dejanews@my-deja.com <dtbaker_dejanews@my-deja.com>
wrote:
> >
> >        $ perl Makefile.PL
PREFIX=/home/normsgallery/www/admin/cgi-bin
>
> I suspect it would be wiser to install somewhere other than off your
cgi-bin.
>
> PerlMagick could install some executables (I doubt it does, but as a
general
> principle) which aren't meant to be CGI programs and could open up
some
> security holes...
>
> Since it's done now, the paranoid part of me would .htaccess (or
equivalent)
> off the lib/perl5 subdirectory so that the web server won't allow
access.
---------------

well, actually the whole mess is .htaccess protected, so I think I'm
*pretty* safe. additionally, the server doesnt let anyone list a cgi-bin
dir anyway, so it would be pretty darn hard to figure out the name,
arguements, etc to make my scripts behave badly I think. good thought
though.



>
> By the way, I for one think it's good when people post as you have..
much better
> than the 'solved now don't worry' posts that don't helpt he next
person.
---------------
thanx.... I just wish I could get some straight answers on topics
sometimes. People tend to give pieces or general answers, and it takes a
ton of time to sift thru.  ah well.

Dan


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 17 Nov 2000 00:36:24 GMT
From: Mario <diab.lito@usa.net>
Subject: Spidering
Message-Id: <8v1ui8$cb7$1@nnrp1.deja.com>

How to access a document on the web (given its url) to indexing it?
it sounds to be a popular topic,but I cannot find the answer anywhere.

A couple of lines of code to start with would be very helpful.

Thanks anyone,
Mario


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 16 Nov 2000 17:04:23 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Spidering
Message-Id: <m1aeazjtns.fsf@halfdome.holdit.com>

>>>>> "Mario" == Mario  <diab.lito@usa.net> writes:

Mario> How to access a document on the web (given its url) to indexing it?
Mario> it sounds to be a popular topic,but I cannot find the answer anywhere.

You didn't look at

        http://www.stonehenge.com/merlyn/WebTechniques/

or

        http://www.stonehenge.com/merlyn/LinuxMag/

then. :)  Or nearly any of the other web sites frequently
mentioned here.

Mario> A couple of lines of code to start with would be very helpful.

        use LWP::Simple;
        $content = get "http://www.stonehenge.com/perltraining/";

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Thu, 16 Nov 2000 16:43:25 -0800
From: Ed Kulis <ekulis@apple.com>
Subject: tree-sync.pl
Message-Id: <3A147F2C.DB0DBC82@apple.com>

I downloaded
    tree-sync.pl
and it's bugged!!

It only works if there are no sub directories to process.

I need to synchronize directory trees.

Has anyone debugged this?

The error is s uninitialized variable in a report line.

I'm not that familiar with debugging reports.



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

Date: Fri, 17 Nov 2000 01:13:40 GMT
From: guthrie_linck@my-deja.com
Subject: Re: tree-sync.pl
Message-Id: <8v20nv$dsq$1@nnrp1.deja.com>

what about using rysnc?

rsync can run locally. download and compile rsync.samba.org


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 16 Nov 2000 17:20:48 -0600
From: Mike Eggleston <mikeegg@prodigy.net>
Subject: unload/reload pm's?
Message-Id: <3A146BD0.D36C852B@prodigy.net>

Is there a way to unload or reload pm's at runtime?

TIA

Mike



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

Date: 17 Nov 2000 00:09:06 +0100
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: Why are references useful?
Message-Id: <em0b5xbh.fsf@macforce.sumus.dk>

andrew338@my-deja.com writes:

> Perl is my first programming language.  I can do most of the basic
> things and have read about references but don't use them.  I don't see
> why to.

They're useful for efficiency to avoid assignments af large structures
in parameters or return values.

They're useful if you want to allow some sub to modify the data
(passing by reference).

They're necessary if you need advanced data structures like lists of lists,
trees, graphs etc.

They're crucial if you're working with object oriented stuff.

Most of these points hold true in practically any programming language.

-- 
Jakob Schmidt
http://aut.dk/orqwood
etc.


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

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


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