[31551] in Perl-Users-Digest
Perl-Users Digest, Issue: 2810 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 9 06:09:25 2010
Date: Tue, 9 Feb 2010 03:09:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 9 Feb 2010 Volume: 11 Number: 2810
Today's topics:
Re: can I get a new httpd.conf file <jurgenex@hotmail.com>
Re: can I get a new httpd.conf file <tadmc@seesig.invalid>
Re: Math not working <nospam-abuse@ilyaz.org>
Re: perl and sendmail speed problem <m@rtij.nl.invlalid>
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@seesig.invalid
Re: shebang and ubuntu <sreservoir@gmail.com>
Re: shebang and ubuntu <jurgenex@hotmail.com>
Re: shebang and ubuntu <jurgenex@hotmail.com>
Re: shebang and ubuntu <Phred@example.invalid>
Re: shebang and ubuntu tony_curtis32@yahoo.com
Re: shebang and ubuntu <youmustbejoking@lan.invalid>
Re: shebang and ubuntu <m@rtij.nl.invlalid>
Re: shebang and ubuntu <josef.moellers@ts.fujitsu.com>
Re: shebang and ubuntu <Huge@nowhere.much.invalid>
Re: shebang and ubuntu <Huge@nowhere.much.invalid>
The best way to give medicine Pet <woai2010ys@163.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 08 Feb 2010 18:39:47 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: can I get a new httpd.conf file
Message-Id: <6ni1n5dumn1cqc6noetrglgfdtbb93cacj@4ax.com>
John Bokma <john@castleamber.com> wrote:
>Tad McClellan <tadmc@seesig.invalid> writes:
>
>> http://tinyurl.com/yjokxjm
>
>Please don't use obfuscated URLs like this, IMO it's as childish as
>rickrollin' and I would call it bad manners. Thanks.
I second the motion!
jue
------------------------------
Date: Mon, 08 Feb 2010 21:18:38 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: can I get a new httpd.conf file
Message-Id: <slrnhn1kpm.a74.tadmc@tadbox.sbcglobal.net>
John Bokma <john@castleamber.com> wrote:
> Myron <delcofiftyfive@gmail.com> writes:
>
>> I have changed mine so many times that I no longer know what I
>> changed.
>> How do I get a new, clean one for OpenBSD 4.6 apache.?
>
> Kind request to the regulars here: If you see a question that has
> nothing to do with Perl, or in any other way breaks the posting
> guidelines:
>
> Take a deep breath, and move on to the next message.
I will not be honoring your request.
Best to filter out my posts.
> Somehow those posts attract 5+ regulars all stating nearly the same
> message, and causing IMO noise that could've been prevented.
You have a strange notion of cause and effect...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Tue, 9 Feb 2010 05:20:22 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Math not working
Message-Id: <slrnhn1s4m.vho.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-02-08, Ben Morrow <ben@morrow.me.uk> wrote:
>> > [1] I consider the fact that fallback => 1 isn't the default to be a bug
>> > in the perl overloading system, but it's much too late to change
>> > that now. Apart from anything else, any new overloads (like the -X
>> > overload that will be in 5.12) must behave as though fallback=>1
>> > were specified, for compatibility.
> [I had forgotten you were the one to originally implement overloading.
> Just to be clear, the above was in no way intended as any sort of veiled
> personal attack.]
Hmm, I do not see anything resembling a personal attack... Anyway,
the fact that I replied is a good indication that I have not
considered it so. ;-)
>> If you think so, just make overload::simple which has a different
>> default for `fallback'.
> That doesn't help in this case, where someone has written a class that
> doesn't use fallback when IMHO it should.
Definitely. I saw (and still see) no way to find a silver bullet
which would make things much simpler...
>> In my first experiments, I saw that the behaviour with {fallback =>
>> 1} was too error-prone - it was very hard for the developer to see
>> whether the codepath was through convert-to-Perlish-data methods, or
>> through the "specialized operations" methods.
>>
>> So I made the default 0.
> I can see that might be a problem, though I think it's one the developer
> has to deal with anyway.
With default being 1, it would be much harder for them to see the
problem. The current way, it is much more probable that *they* would
see the problem first, so the users would have less problems...
> Would you agree with me that new overload types
> *must* default to falling back
How would "new" types be different from the "old" ones? The problem
existed back then; what changed?
> this is then unnecessarily confusing, with some overloads honouring
> 'fallback' and some not?
Confusing: yes. "Unnecessarily"? Do not think so. The complexity is
there, it is not an artificial one...
Yours,
Ilya
------------------------------
Date: Tue, 9 Feb 2010 07:40:43 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: perl and sendmail speed problem
Message-Id: <bkc747-5hp.ln1@news.rtij.nl>
On Mon, 08 Feb 2010 10:11:56 -0800, joe wrote:
> I tested this script with only 10 messages and it worked but I am not
> sure if it can handle a few thousands
>
> use Thread qw(:DEFAULT async yield);
>
> $thread = Thread->new(\&sendEmail($_,$in_sender,'',$in_subject,
> $in_letter));
Best to limit it to some number of threads so you don't overload your
machine. Wich probably destroys the effect your after.
Do you really need to send 1000 times one message? If the message doesn't
change, send it to many people at once.
If you do need to send individual messages, then it is going to take
time. You may want to investigate why sendmail is so slow.
As an alternative, write the messages to files and start a background
process that sends the messages.
M4
------------------------------
Date: Tue, 09 Feb 2010 02:13:37 -0600
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.9 $)
Message-Id: <n6udnWFlxPOshOzWnZ2dnUVZ_oCdnZ2d@giganews.com>
Outline
Before posting to comp.lang.perl.misc
Must
- Check the Perl Frequently Asked Questions (FAQ)
- Check the other standard Perl docs (*.pod)
Really Really Should
- Lurk for a while before posting
- Search a Usenet archive
If You Like
- Check Other Resources
Posting to comp.lang.perl.misc
Is there a better place to ask your question?
- Question should be about Perl, not about the application area
How to participate (post) in the clpmisc community
- Carefully choose the contents of your Subject header
- Use an effective followup style
- Speak Perl rather than English, when possible
- Ask perl to help you
- Do not re-type Perl code
- Provide enough information
- Do not provide too much information
- Do not post binaries, HTML, or MIME
Social faux pas to avoid
- Asking a Frequently Asked Question
- Asking a question easily answered by a cursory doc search
- Asking for emailed answers
- Beware of saying "doesn't work"
- Sending a "stealth" Cc copy
Be extra cautious when you get upset
- Count to ten before composing a followup when you are upset
- Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------
Posting Guidelines for comp.lang.perl.misc ($Revision: 1.9 $)
This newsgroup, commonly called clpmisc, is a technical newsgroup
intended to be used for discussion of Perl related issues (except job
postings), whether it be comments or questions.
As you would expect, clpmisc discussions are usually very technical in
nature and there are conventions for conduct in technical newsgroups
going somewhat beyond those in non-technical newsgroups.
The article at:
http://www.catb.org/~esr/faqs/smart-questions.html
describes how to get answers from technical people in general.
This article describes things that you should, and should not, do to
increase your chances of getting an answer to your Perl question. It is
available in POD, HTML and plain text formats at:
http://www.rehabitation.com/clpmisc.shtml
For more information about netiquette in general, see the "Netiquette
Guidelines" at:
http://andrew2.andrew.cmu.edu/rfc/rfc1855.html
A note to newsgroup "regulars":
Do not use these guidelines as a "license to flame" or other
meanness. It is possible that a poster is unaware of things
discussed here. Give them the benefit of the doubt, and just
help them learn how to post, rather than assume that they do
know and are being the "bad kind" of Lazy.
A note about technical terms used here:
In this document, we use words like "must" and "should" as
they're used in technical conversation (such as you will
encounter in this newsgroup). When we say that you *must* do
something, we mean that if you don't do that something, then
it's unlikely that you will benefit much from this group.
We're not bossing you around; we're making the point without
lots of words.
Do *NOT* send email to the maintainer of these guidelines. It will be
discarded unread. The guidelines belong to the newsgroup so all
discussion should appear in the newsgroup. I am just the secretary that
writes down the consensus of the group.
Before posting to comp.lang.perl.misc
Must
This section describes things that you *must* do before posting to
clpmisc, in order to maximize your chances of getting meaningful replies
to your inquiry and to avoid getting flamed for being lazy and trying to
have others do your work.
The perl distribution includes documentation that is copied to your hard
drive when you install perl. Also installed is a program for looking
things up in that (and other) documentation named 'perldoc'.
You should either find out where the docs got installed on your system,
or use perldoc to find them for you. Type "perldoc perldoc" to learn how
to use perldoc itself. Type "perldoc perl" to start reading Perl's
standard documentation.
Check the Perl Frequently Asked Questions (FAQ)
Checking the FAQ before posting is required in Big 8 newsgroups in
general, there is nothing clpmisc-specific about this requirement.
You are expected to do this in nearly all newsgroups.
You can use the "-q" switch with perldoc to do a word search of the
questions in the Perl FAQs.
Check the other standard Perl docs (*.pod)
The perl distribution comes with much more documentation than is
available for most other newsgroups, so in clpmisc you should also
see if you can find an answer in the other (non-FAQ) standard docs
before posting.
It is *not* required, or even expected, that you actually *read* all of
Perl's standard docs, only that you spend a few minutes searching them
before posting.
Try doing a word-search in the standard docs for some words/phrases
taken from your problem statement or from your very carefully worded
"Subject:" header.
Really Really Should
This section describes things that you *really should* do before posting
to clpmisc.
Lurk for a while before posting
This is very important and expected in all newsgroups. Lurking means
to monitor a newsgroup for a period to become familiar with local
customs. Each newsgroup has specific customs and rituals. Knowing
these before you participate will help avoid embarrassing social
situations. Consider yourself to be a foreigner at first!
Search a Usenet archive
There are tens of thousands of Perl programmers. It is very likely
that your question has already been asked (and answered). See if you
can find where it has already been answered.
One such searchable archive is:
http://groups.google.com/advanced_search
If You Like
This section describes things that you *can* do before posting to
clpmisc.
Check Other Resources
You may want to check in books or on web sites to see if you can
find the answer to your question.
But you need to consider the source of such information: there are a
lot of very poor Perl books and web sites, and several good ones
too, of course.
Posting to comp.lang.perl.misc
There can be 200 messages in clpmisc in a single day. Nobody is going to
read every article. They must decide somehow which articles they are
going to read, and which they will skip.
Your post is in competition with 199 other posts. You need to "win"
before a person who can help you will even read your question.
These sections describe how you can help keep your article from being
one of the "skipped" ones.
Is there a better place to ask your question?
Question should be about Perl, not about the application area
It can be difficult to separate out where your problem really is,
but you should make a conscious effort to post to the most
applicable newsgroup. That is, after all, where you are the most
likely to find the people who know how to answer your question.
Being able to "partition" a problem is an essential skill for
effectively troubleshooting programming problems. If you don't get
that right, you end up looking for answers in the wrong places.
It should be understood that you may not know that the root of your
problem is not Perl-related (the two most frequent ones are CGI and
Operating System related), so off-topic postings will happen from
time to time. Be gracious when someone helps you find a better place
to ask your question by pointing you to a more applicable newsgroup.
How to participate (post) in the clpmisc community
Carefully choose the contents of your Subject header
You have 40 precious characters of Subject to win out and be one of
the posts that gets read. Don't waste them. Take care while
composing them, they are the key that opens the door to getting an
answer.
Spend them indicating what aspect of Perl others will find if they
should decide to read your article.
Do not spend them indicating "experience level" (guru, newbie...).
Do not spend them pleading (please read, urgent, help!...).
Do not spend them on non-Subjects (Perl question, one-word
Subject...)
For more information on choosing a Subject see "Choosing Good
Subject Lines":
http://www.cpan.org/authors/id/D/DM/DMR/subjects.post
Part of the beauty of newsgroup dynamics, is that you can contribute
to the community with your very first post! If your choice of
Subject leads a fellow Perler to find the thread you are starting,
then even asking a question helps us all.
Use an effective followup style
When composing a followup, quote only enough text to establish the
context for the comments that you will add. Always indicate who
wrote the quoted material. Never quote an entire article. Never
quote a .signature (unless that is what you are commenting on).
Intersperse your comments *following* each section of quoted text to
which they relate. Unappreciated followup styles are referred to as
"top-posting", "Jeopardy" (because the answer comes before the
question), or "TOFU" (Text Over, Fullquote Under).
Reversing the chronology of the dialog makes it much harder to
understand (some folks won't even read it if written in that style).
For more information on quoting style, see:
http://web.presby.edu/~nnqadmin/nnq/nquote.html
Speak Perl rather than English, when possible
Perl is much more precise than natural language. Saying it in Perl
instead will avoid misunderstanding your question or problem.
Do not say: I have variable with "foo\tbar" in it.
Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
or I have $var = <DATA> (and show the data line).
Ask perl to help you
You can ask perl itself to help you find common programming mistakes
by doing two things: enable warnings (perldoc warnings) and enable
"strict"ures (perldoc strict).
You should not bother the hundreds/thousands of readers of the
newsgroup without first seeing if a machine can help you find your
problem. It is demeaning to be asked to do the work of a machine. It
will annoy the readers of your article.
You can look up any of the messages that perl might issue to find
out what the message means and how to resolve the potential mistake
(perldoc perldiag). If you would like perl to look them up for you,
you can put "use diagnostics;" near the top of your program.
Do not re-type Perl code
Use copy/paste or your editor's "import" function rather than
attempting to type in your code. If you make a typo you will get
followups about your typos instead of about the question you are
trying to get answered.
Provide enough information
If you do the things in this item, you will have an Extremely Good
chance of getting people to try and help you with your problem!
These features are a really big bonus toward your question winning
out over all of the other posts that you are competing with.
First make a short (less than 20-30 lines) and *complete* program
that illustrates the problem you are having. People should be able
to run your program by copy/pasting the code from your article. (You
will find that doing this step very often reveals your problem
directly. Leading to an answer much more quickly and reliably than
posting to Usenet.)
Describe *precisely* the input to your program. Also provide example
input data for your program. If you need to show file input, use the
__DATA__ token (perldata.pod) to provide the file contents inside of
your Perl program.
Show the output (including the verbatim text of any messages) of
your program.
Describe how you want the output to be different from what you are
getting.
If you have no idea at all of how to code up your situation, be sure
to at least describe the 2 things that you *do* know: input and
desired output.
Do not provide too much information
Do not just post your entire program for debugging. Most especially
do not post someone *else's* entire program.
Do not post binaries, HTML, or MIME
clpmisc is a text only newsgroup. If you have images or binaries
that explain your question, put them in a publically accessible
place (like a Web server) and provide a pointer to that location. If
you include code, cut and paste it directly in the message body.
Don't attach anything to the message. Don't post vcards or HTML.
Many people (and even some Usenet servers) will automatically filter
out such messages. Many people will not be able to easily read your
post. Plain text is something everyone can read.
Social faux pas to avoid
The first two below are symptoms of lots of FAQ asking here in clpmisc.
It happens so often that folks will assume that it is happening yet
again. If you have looked but not found, or found but didn't understand
the docs, say so in your article.
Asking a Frequently Asked Question
It should be understood that you may have missed the applicable FAQ
when you checked, which is not a big deal. But if the Frequently
Asked Question is worded similar to your question, folks will assume
that you did not look at all. Don't become indignant at pointers to
the FAQ, particularly if it solves your problem.
Asking a question easily answered by a cursory doc search
If folks think you have not even tried the obvious step of reading
the docs applicable to your problem, they are likely to become
annoyed.
If you are flamed for not checking when you *did* check, then just
shrug it off (and take the answer that you got).
Asking for emailed answers
Emailed answers benefit one person. Posted answers benefit the
entire community. If folks can take the time to answer your
question, then you can take the time to go get the answer in the
same place where you asked the question.
It is OK to ask for a *copy* of the answer to be emailed, but many
will ignore such requests anyway. If you munge your address, you
should never expect (or ask) to get email in response to a Usenet
post.
Ask the question here, get the answer here (maybe).
Beware of saying "doesn't work"
This is a "red flag" phrase. If you find yourself writing that,
pause and see if you can't describe what is not working without
saying "doesn't work". That is, describe how it is not what you
want.
Sending a "stealth" Cc copy
A "stealth Cc" is when you both email and post a reply without
indicating *in the body* that you are doing so.
Be extra cautious when you get upset
Count to ten before composing a followup when you are upset
This is recommended in all Usenet newsgroups. Here in clpmisc, most
flaming sub-threads are not about any feature of Perl at all! They
are most often for what was seen as a breach of netiquette. If you
have lurked for a bit, then you will know what is expected and won't
make such posts in the first place.
But if you get upset, wait a while before writing your followup. I
recommend waiting at least 30 minutes.
Count to ten after composing and before posting when you are upset
After you have written your followup, wait *another* 30 minutes
before committing yourself by posting it. You cannot take it back
once it has been said.
AUTHOR
Tad McClellan and many others on the comp.lang.perl.misc newsgroup.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Mon, 08 Feb 2010 21:34:07 -0500
From: sreservoir <sreservoir@gmail.com>
Subject: Re: shebang and ubuntu
Message-Id: <hkqhj9$f9g$1@speranza.aioe.org>
On 2/8/2010 8:20 PM, Jonathan N. Little wrote:
> Phred Phungus wrote:
>
>> I've now tripped on another instance of being denied permission:
>>
>> dan@dan-desktop:/usr/bin$ ls -l >text1.txt
>> bash: text1.txt: Permission denied
>
> If you are not root you cannot write to the /usr/bin folder
>
> Try
> sudo sh -c "ls -l > text1.txt"
ls -l | sudo tee text1.txt >&-
> Or redirect do a folder that you *do* have write permission
> ls -l > ~/text1.txt
this is probably the best idea, since /usr/bin isn't a good place to
keep directory listings.
--
"Six by nine. Forty two."
"That's it. That's all there is."
"I always thought something was fundamentally wrong with the universe"
------------------------------
Date: Mon, 08 Feb 2010 18:35:51 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: shebang and ubuntu
Message-Id: <c2i1n5ldthdv5hkl3q8okc3ug9feqsnt85@4ax.com>
Phred Phungus <Phred@example.invalid> wrote:
>Jürgen Exner wrote:
>> Phred Phungus <Phred@example.invalid> wrote:
>>> dan@dan-desktop:~/source42$ perl t1.pl
>>
>> What is "~/source42$"? Is that part of your prompt? That is confusing to
>> say the least!
>
>I've got all these refugee directories named source leftover from when I
>would use gnu software on windows. Now on linux, not only do I have a
>shebang line that does something, but I also have the option of creating
>a terminal anywhere I want with a right-click and selection. So I've
>got a lot more flexibility than trying bring up a dos terminal quickly.
???
Is the above meant to be an answer to my question? If yes then I have no
idea what you are talking about.
>>> dan@dan-desktop:~/source42$ ./t1.pl
>>> bash: ./t1.pl: Permission denied
>>
>> That error message is a bash error message, it has nothing to do with
>> Perl.
>> There can be more obscure reasons but most likely you didn't set the
>> file permissions for t1.pl to executable.
>>
>>> dan@dan-desktop:~/source42$ cat t1.pl
>>> #!/usr/bin/perl
>>
>> One of those more obscure reasons could be that /usr/bin/perl itself is
>> not executable for you and this is being masked by a different perl
>> being executed in your first command (did you try 'which perl'?).
>
>dan@dan-desktop:~/source42$ which perl
>/usr/bin/perl
Ok, then it is not this one of the more obscure reasons. My bets are
still on the most trivial: you forgot to make t1.pl executable.
>I've now tripped on another instance of being denied permission:
>
>dan@dan-desktop:/usr/bin$ ls -l >text1.txt
>bash: text1.txt: Permission denied
Ok, I am beginning to suspect that this funny "~/source42$" or now
"/usr/bin$" is supposed to indicate the current working directory.
>How can a non-existent file deny me permission?
If that is the case then does your account have permissions to create a
file in /usr/bin? Hopefully not because otherwise that would be A Very
Bad Idea. You absolutely, totally, completely don't want just any user
to mess around in /usr/bin.
Again, this has nothing at all whatsoever to do with Perl.
jue
------------------------------
Date: Mon, 08 Feb 2010 18:37:36 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: shebang and ubuntu
Message-Id: <khi1n5hbfufa605rm6kjt432km86u4q5s5@4ax.com>
"Jonathan N. Little" <lws4art@gmail.com> wrote:
>Phred Phungus wrote:
>
>> I've now tripped on another instance of being denied permission:
>>
>> dan@dan-desktop:/usr/bin$ ls -l >text1.txt
>> bash: text1.txt: Permission denied
>
>If you are not root you cannot write to the /usr/bin folder
>
>Try
>sudo sh -c "ls -l > text1.txt"
Of course this begs the question why on earth would somewone want to
create a txt file in /usr/bin?
>Or redirect do a folder that you *do* have write permission
>ls -l > ~/text1.txt
A much saner idea.
jue
------------------------------
Date: Mon, 08 Feb 2010 20:36:44 -0700
From: Phred Phungus <Phred@example.invalid>
Subject: Re: shebang and ubuntu
Message-Id: <7tc3idFqtuU1@mid.individual.net>
Jürgen Exner wrote:
> "Jonathan N. Little" <lws4art@gmail.com> wrote:
>> Phred Phungus wrote:
>>
>>> I've now tripped on another instance of being denied permission:
>>>
>>> dan@dan-desktop:/usr/bin$ ls -l >text1.txt
>>> bash: text1.txt: Permission denied
>> If you are not root you cannot write to the /usr/bin folder
>>
>> Try
>> sudo sh -c "ls -l > text1.txt"
>
> Of course this begs the question why on earth would somewone want to
> create a txt file in /usr/bin?
If you want to see what's in there and you don't have the below advice.
>
>> Or redirect do a folder that you *do* have write permission
>> ls -l > ~/text1.txt
>
> A much saner idea.
dan@dan-desktop:/usr/bin$ ls -l > ~/zax1.txt
dan@dan-desktop:/usr/bin$ locate zax1.txt
dan@dan-desktop:/usr/bin$ man sh
dan@dan-desktop:/usr/bin$ sudo sh -c "ls -l > qext1.txt"
[sudo] password for dan:
dan@dan-desktop:/usr/bin$ locate qext1.txt
dan@dan-desktop:/usr/bin$ ls qext1.txt
I'm so glad I finally figured out this bit here. It will enter my
linuxlog, and so I hope never to ask this question again.
Why did my locate commands not work? The first should have indicated
that the text file was in the home folder, and the second is in the same
directory whence the locate originates.
--
fred
------------------------------
Date: Mon, 08 Feb 2010 21:58:36 -0600
From: tony_curtis32@yahoo.com
Subject: Re: shebang and ubuntu
Message-Id: <871vgvkqkz.fsf@yahoo.com>
Phred Phungus <Phred@example.invalid> writes:
> Why did my locate commands not work? The first should have indicated
> that the text file was in the home folder, and the second is in the
> same directory whence the locate originates.
This is now off-topic for clpm, but locate looks at a
pre-built index file, which is updated regularly (but
obviously not every 2 seconds or so :-).
comp.os.linux.misc may be your best bet for permissions
issues.
hth
t
------------------------------
Date: 09 Feb 2010 04:35:42 GMT
From: Dan C <youmustbejoking@lan.invalid>
Subject: Re: shebang and ubuntu
Message-Id: <pan.2010.02.09.04.36.39@moria.lan>
On Mon, 08 Feb 2010 17:24:14 -0700, Phred Phungus wrote:
> Jürgen Exner wrote:
>> Phred Phungus <Phred@example.invalid> wrote:
>>> I have a common problem that files tell my that I'm not allowed there.
>>> If I recall my reading, I was referred to chmod(). I've looked at
>>> that several times, and it doesn't seem to take, at least as a man
>>> page.
>>>
>>> Does perl have a way to manipulate these file permissions?
>>>
>>> dan@dan-desktop:~/source42$ perl t1.pl
>>
>> What is "~/source42$"? Is that part of your prompt? That is confusing
>> to say the least!
>
> I've got all these refugee directories named source leftover from when I
> would use gnu software on windows. Now on linux, not only do I have a
> shebang line that does something, but I also have the option of creating
> a terminal anywhere I want with a right-click and selection. So I've
> got a lot more flexibility than trying bring up a dos terminal quickly.
>
> Since this is x-posted to alt.os.linux.ubuntu, I would be curious where
> others like to put their perl scripts.
>
>
>>> t1.pl out b1.c~ t1.pl~ .. . b1.c
>>> dan@dan-desktop:~/source42$ ./t1.pl
>>> bash: ./t1.pl: Permission denied
>>
>> That error message is a bash error message, it has nothing to do with
>> Perl.
>> There can be more obscure reasons but most likely you didn't set the
>> file permissions for t1.pl to executable.
>>
>>> dan@dan-desktop:~/source42$ cat t1.pl #!/usr/bin/perl
>>
>> One of those more obscure reasons could be that /usr/bin/perl itself is
>> not executable for you and this is being masked by a different perl
>> being executed in your first command (did you try 'which perl'?).
>
> dan@dan-desktop:~/source42$ which perl /usr/bin/perl
>
> I've now tripped on another instance of being denied permission:
>
> dan@dan-desktop:/usr/bin$ ls -l >text1.txt bash: text1.txt: Permission
> denied
> dan@dan-desktop:/usr/bin$ ls -l text1.txt ls: cannot access text1.txt:
> No such file or directory dan@dan-desktop:/usr/bin$
>
>
> How can a non-existent file deny me permission?
Jesus, you're fucking stupid even for a n00b. Almost so stupid that one
would have to believe you're just deliberately trolling.
Bugger off, stupid troll boy.
--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as he found his pit crew eating ice cream.
Usenet Improvement Project: http://twovoyagers.com/improve-usenet.org/
------------------------------
Date: Tue, 9 Feb 2010 07:42:27 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: shebang and ubuntu
Message-Id: <jnc747-5hp.ln1@news.rtij.nl>
On Mon, 08 Feb 2010 20:36:44 -0700, Phred Phungus wrote:
> dan@dan-desktop:/usr/bin$ ls -l > ~/zax1.txt dan@dan-desktop:/usr/bin$
> locate zax1.txt dan@dan-desktop:/usr/bin$ man sh
> dan@dan-desktop:/usr/bin$ sudo sh -c "ls -l > qext1.txt" [sudo] password
> for dan:
> dan@dan-desktop:/usr/bin$ locate qext1.txt dan@dan-desktop:/usr/bin$ ls
> qext1.txt
>
> I'm so glad I finally figured out this bit here. It will enter my
> linuxlog, and so I hope never to ask this question again.
>
> Why did my locate commands not work? The first should have indicated
> that the text file was in the home folder, and the second is in the same
> directory whence the locate originates.
Locate works on a database that is created each night.
I think you would be better of in a unix/linux newsgroup. Your questions
are VERY basic unix questions and have NOTHING to do with perl.
M4
------------------------------
Date: Tue, 09 Feb 2010 08:56:20 +0100
From: Josef Moellers <josef.moellers@ts.fujitsu.com>
Subject: Re: shebang and ubuntu
Message-Id: <hkr4f4$bc0$1@nntp.fujitsu-siemens.com>
Phred Phungus wrote:
> Since this is x-posted to alt.os.linux.ubuntu, I would be curious where
> others like to put their perl scripts.
It depends (aus usual).
If you feel that it is a generic script and should be made available to
anyone using the system, the best place to put it would be
/usr/local/bin (it not being a generally avaliable script). If you just
want to keep it to yourself, put it into the bin-directory inside your
home-directory: $HOME/bin.
> I've now tripped on another instance of being denied permission:
>
> dan@dan-desktop:/usr/bin$ ls -l >text1.txt
> bash: text1.txt: Permission denied
> dan@dan-desktop:/usr/bin$ ls -l text1.txt
> ls: cannot access text1.txt: No such file or directory
> dan@dan-desktop:/usr/bin$
>
>
> How can a non-existent file deny me permission?
It's not the file which denies you permission, it's the directory.
"/usr/bin" is a directory which holds system-wide commands and is
writable only by the super-user "root", or else anyone could put trojans
there.
You can check a directory's permissions with
ls -ld <directoryname>
e.g.
ls -ld /usr/bin
drwxr-xr-x 2 root root 69632 2010-02-08 15:48 /usr/bin
This means:
it's a directory ("d"),
The owner (the first "root") may read, write, and search ("rwx"),
anyone belonging to the group "root" (the second "root", users and
groups can have the same name) may read and search but not write (the
first "r-x") and the resto of the world may read and searcg but not
write (the second "r-x").
The large number is the size in bytes of the directory index (so to
speak) and is of little importance. The next is the date and time of the
last modification of that directory (e.g. a new file was created in that
directory), followed by the name of the directory.
HTH,
Josef
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html
------------------------------
Date: 9 Feb 2010 09:27:27 GMT
From: Huge <Huge@nowhere.much.invalid>
Subject: Re: shebang and ubuntu
Message-Id: <7tco3vFm0cU2@mid.individual.net>
On 2010-02-09, Phred Phungus <Phred@example.invalid> wrote:
> Since this is x-posted to alt.os.linux.ubuntu, I would be curious where
> others like to put their perl scripts.
When I'm working on something;
~/Prog/{progname}/
When it's finished, if it's just for me;
~/bin/
If it's for anyone who might use my computer;
/usr/local/bin/
> I've now tripped on another instance of being denied permission:
>
> dan@dan-desktop:/usr/bin$ ls -l >text1.txt
> bash: text1.txt: Permission denied
> dan@dan-desktop:/usr/bin$ ls -l text1.txt
> ls: cannot access text1.txt: No such file or directory
> dan@dan-desktop:/usr/bin$
>
>
> How can a non-existent file deny me permission?
It can't. You're attempting to write a file (text1.txt) in a directory
in which you don't have write permission.
--
219361311
email me, if you must, at huge {at} huge (dot) org <dot> uk]
------------------------------
Date: 9 Feb 2010 09:29:26 GMT
From: Huge <Huge@nowhere.much.invalid>
Subject: Re: shebang and ubuntu
Message-Id: <7tco7lFm0cU3@mid.individual.net>
On 2010-02-09, Phred Phungus <Phred@example.invalid> wrote:
> Why did my locate commands not work? The first should have indicated
> that the text file was in the home folder, and the second is in the same
> directory whence the locate originates.
man locate
man updatedb
Will give you the answer.
--
219361311
email me, if you must, at huge {at} huge (dot) org <dot> uk]
------------------------------
Date: Mon, 8 Feb 2010 19:19:07 -0800 (PST)
From: zhouu <woai2010ys@163.com>
Subject: The best way to give medicine Pet
Message-Id: <ea168d1e-a66f-4277-bead-c94f8f1da9af@t31g2000prh.googlegroups.com>
The best way to give medicine Pet
Although pets are not as complicated as the process of human thought,
I know when something is wrong or whether to maintain, if somewhat
unpalatable. Thus, even a pet to give the drug is beneficial to the
health of animals can be difficult to bring your pet to work easily.
Through the use of what your pet can enjoy as a strategy of medical
management, saving you time your pet is fighting for this project.
Preparation.
Calm your pet before administering medication. The animals have a
sense of sensitive and can detect when something. Use a pleasant voice
during the call, your pet and approach your pet in a friendly,
nonthreatening way. Sit at eye level with your pet and give your pet a
little love to keep them happy. After a while stroking animals, have a
good picture of your pet around the neck, neck or waist.
Drug Thunder.
If drugs can be administered with food to make the capsule, powder or
liquid on a plate of food every day, the perfect food diguised.
You can also prepare your pet for a delicious treat. Pack medicines in
a meatball or tuna (cats are particularly fond of) and feed the drug
to treat your pet. If the capsule is administered in the diet, keep
the head of your pet from above, with the fixed fingers, a horizontal
letter C by hand with the thumb and forefinger on one side of the
mouth and the index and middle fingers on the other side of the mouth
often open mouth. On the other hand, use the middle finger in the
language and press down on drugs with your thumb and forefinger,
insert the tip into the neck of the animal. Close the mouth of pets
and blow gently through your nose to encourage your pet to swallow
drugs. Keep the mouth of your pet and that is closed for several
seconds and swallowed the medicine, because the mouth of your pet,
make sure the medicine is gone. Pets are not to be cooperation, so be
patient and give the physical management approach, a couple of
attempts until you succeed.
Positive reinforcement.
Always speak in a calm voice and reassuring in administering drugs to
keep your pet panic. Gently pat your pet and veterinary medicine
during the administrative work and reward your pet to do a good job.
Love your pet for a good few minutes and offer them a reward, a
popular snack treat or a game play, then it is equally cooperation for
the next round.
See More About Dog Health : http://www.dogs-info.net/html/Health/2010/0118/643.html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 2810
***************************************