Domain: perlmonks.org
Stories and comments across the archive that link to perlmonks.org.
Comments · 240
-
perlmonks
For anyone getting into perl I can not recomend The Perl Monks Monastery enough. Lurk for a while, use super search to find the answers to almost any perl question you may have and if all else fails post to Seakers Of Perl Wisdom and enlightenment shall surely follow.
Randal is a regular contributor there and many of the other leading lights of perl pop up frequently.
Regards,
A monk. -
perlmonks
For anyone getting into perl I can not recomend The Perl Monks Monastery enough. Lurk for a while, use super search to find the answers to almost any perl question you may have and if all else fails post to Seakers Of Perl Wisdom and enlightenment shall surely follow.
Randal is a regular contributor there and many of the other leading lights of perl pop up frequently.
Regards,
A monk. -
lisp in perl
-
Re:Head Start?
I couldn't agree more about PHP, and how often are the user comments completely wrong, or suggest something that's going to get your site owned.
As for perl documentation its not that hard. On *nix 'man perl' gives a list of man pages and what to look for where. And if you're looking for a specific function you can do 'perldoc -f ' and get a good idea how to use it. Or do perldoc perlfunc (or man perlfunc) to get a complete function list if you aren't sure what to look for. And most pagers let you search the page your viewing.
If you don't have access to a shell there's also http://perldoc.com/ which should have everything that's availiable from a shell. And finally if you need info on specific modules it can be obtained from the shell after installed (at least through CPAN) or you can view the docs on the web by typing in the module name at http://search.cpan.org/
if you still need help there's also http://perlmonks.org/ with lots of people ready to answer your questions :) -
Maybe it's part of geek culture, sadlyI think your first mistake was looking for help on freenode. it isn't just #debian. #slackware, #perl, all of the big channels all have a few sad kids that think being a grump (to put it kindly) implies techical superiority. One of the more proficient minds in the perl community actually has a standard disclaimer, for God's sake! Thankfully, freenode isn't as bad as alt.os.linux.slackware yet.
I really wonder about this. Is it genetic? Is it a personality fault tied to technical ability a la Asberger(sp) syndrome?
-
Actually, yes.
It's commonly referred to as "golf".
;) http://www.perlmonks.org/index.pl?node=golf -
Re:Perl Vs. Java
No, not even then.
-
For those of us who are too cheap....
There are also a lot of free resources out there to help you learn Perl without having to buy a book. The following website's tutorials listing helped me get started:
http://www.perlmonks.org/index.pl?node=Tutorials
YMMV of course, and you may very well wind up buying a book anyway, but still check that out! -
look after your system'... By early September 2004, I was spending a good portion of the time I'd normally be working online flat on my back instead
...'one of the surest signs you have to do something about it. It is a problem that is stopping you what you normally can do.
'... Being an ex-smoker, worries of lung cancer were starting to consume my thoughts ...'So you realise your mortal and you like living. Nothing wrong there.
Now for the sermon: get someone to find out what is wrong. don't stop until your satisfied. get another practioner if they give you the bums rush or cant be bothered to solve your problem.
repeat after me programmers, hackers: Look after the health of your system and yourself. I dont want to read another opensource contributor obituary.
Well Patrick - get yourself well. write it up and I'll promise to get a full commercial version of slack instead of the cheapscate versions I usually get
:) -
Script may be hard, but doable
At first I thought, "why waste the time when we have things like Eliza to do it for you?"
Then I thought, "that's too funny, somebody must've done it already," and, yeah, here's the perl script.
You can't use a computer script to generate responses, because they can easily be filtered out just like you filter 99% of spam. You'll maybe spend 30 minutes a day to respond to 60 spams.
I suspect if you built up the vocabulary well enough, and, more importantly, use the content of the message with a word rank algorithm and then do some thesaurus lookups and stemming, maybe using WordNet you'd have something that would be at least as unique as what any given subset of 10000 people would come up with.
I'm intrigued because I have a good enough ruleset now that any SpamAssassin score over 10 goes to /dev/null and I haven't seen any false positives in the past six months. I get plenty of false negatives but the hits are ready to feed to a script, and I'm too lazy to respond to them myself. -
Been there, done that :)
cLive
;-) -
Re:All lines are not equal
One line on perl typically does a lot more than one line of C code
There was an excellent, brief example of that in an otherwise also excellent comment to the Paul Graham thingy over at Perlmonks here. It was in java, but the point still remains.
-
Re:Java
Hmm... Last I checked, Perl was not an ideal language for writing "large bodies of maintainable code." In fact, it was quite the opposite.
I don't know about ideal, but it is not hard to write and maintain large bodies of clean and readable code in Perl. On the other hand, you can *also* write totally obfuscated weirdo oneliners. Because it is flexible.
Bad (or just plain evil) programmers can write bad and ugly code in any language, good programmers can write good gode in almost any language. Can't very well say any, because there are such beasts as BF out there. ;-)
Most of the time, the people I know who wrote Perl couldn't understand what they did just 2 weeks later.
Well, those aren't programmers. At least not yet. Perl has - built in, mind you! - more rules, checks and syntactic helpers than most languages - if you chose to turn them on. Most good programmers do, however they are off by default so quick oneliners on the commandline and lightning 5-line quick and dirties can be pulled off as well.
TIMTOWTDI (There Is More Than One Way To Do It) sums up the whole philosophy. Spend some time at places like http://www.perlmonks.org/ and then come back and tell me that most Perl programmers create code that can't be maintained. ;-) -
Then you don't know the right programmers
Spend some time somewhere like Perl Monks and you'll find out that there are a lot of competent Perl programmers who aren't sysadmin types. Or go and look at CPAN to see the variety of different kinds of software that are available in the Perl world.
Furthermore I'd like to point out that Graham made a claim about the behaviour of hackers, not open source programmers. Most of the people who contribute to Sourceforge would not, in Graham's opinion, deserve the compliment of being called hackers. Therefore their aggregate choices are irrelevant.
Disclaimer: I'm a fairly well-known Perl programmer. -
Then you don't know the right programmers
Spend some time somewhere like Perl Monks and you'll find out that there are a lot of competent Perl programmers who aren't sysadmin types. Or go and look at CPAN to see the variety of different kinds of software that are available in the Perl world.
Furthermore I'd like to point out that Graham made a claim about the behaviour of hackers, not open source programmers. Most of the people who contribute to Sourceforge would not, in Graham's opinion, deserve the compliment of being called hackers. Therefore their aggregate choices are irrelevant.
Disclaimer: I'm a fairly well-known Perl programmer. -
Re:Not funny!
Tried the monastery yet?
-
Re:duh, that robots.txt should read....I have one even better than that...
User-agent: Mediapartners-Google*
Disallow:
User-agent: Googlebot/2.1*
Disallow:
# Do NOT visit the following pathname or your host
# will be blocked from this site. This is a trap
# for mal-configured bots which do not follow
# RFCs.
User-agent: *
Disallow: /cgi-bin/block_crawler.plBasically this allows Google to spider my site, but when robots like msnbot decide to ignore this, reading and parsing robots.txt at each line, they'll follow block_crawler.pl, which is a script that appends their IP, date, time, etc. to
.htaccess, with a "Deny from" rule.For excessive abuses, I just block their
/24 at the firewall.Incidentally, they are ignoring robots.txt because they want to beat google at indexing "More(tm)" content, and be the "premiere" search engine out there. A year of "accidentally" crawling more content than they should, and their search engine will appear to have a LOT more pages that google does. You can bet a press release advertising this fact will appear soon after.
I have another little trap for the harvesters, called "Can-o-Raid", which I've been using for about 4 years now. You can read more about it on my Perlmonks writeup over here. Being able to pollute the search engines with +/- 7 million fake email addresses per-night is pretty nice.. and I can slow them down by adding a sleep(45) to each page reload. They can't get out, once they get in.
-
Perl Poetry
I mean come on, how many languages in which you can do this?
-
Perl?
One word: Perl. Compared to C/C++ it is poetry. Introduce her to a friendly llama. If she gets stuck, introduce her to some monks who have shown willingness to help out a beginnger. What you'll find is that they are especially kind if you explain who you are, what you're up against and why you want to do what you want to do.
-
Re:Perl ...>
... completely without letters if you do it right! ;-)Or, with nothing _but_ letters. This still looks nothing like English. Of course, that's a deliberate obfuscation; normal Perl code is considerably more English-based than that. But with Perl6 you'll be able to define your own grammar, so it ought to be easy to make a version based on another language.
-
Re:Best. Excerpt. Ever.
Answer: PerlMonks
-
already adopted for Perl
found someone already using MS VC to build perl (miniperl) for windows at perlmonks.
-
already adopted for Perl
found someone already using MS VC to build perl (miniperl) for windows at perlmonks.
-
already adopted for Perl
found someone already using MS VC to build perl (miniperl) for windows at perlmonks.
-
Re:Additional Information
-
Re:Perl's grammar is too big
You're far underestimating an experienced perl programmer, who is smart enough to know about the tradeoff between tersity and readability. The short, unreadable syntax is meant for when you're doing those one-off scripts, or using perl like an old unix guy uses awk. As usual, the onus is on the programmer. Have you visited Perl Monks? We try to thelp perl developers create maintainable and descriptive code. Any experienced developer who creates really complex code in a project will at least put an explanation in the comments. Think about it: the same person who trys to look good (all developers are prima donnas:) by using unreadable perl code, is probably also mixing business logic with presentation in their PHP apps too. If you visit my home page or google my user name, you'll see my favorite.
My personal opinion (Flame on!): I am also unconfortable with the number of builtin functions, especially with extensions added. I feel PHP needs to focus more on quality, and less on features, and needs to support real namespaces, not just what's in the new OO system. Does PHP have a good, high-quality templating system bundled yet? I think it would be in their best interests, considering the web is its largest use.
In the interest of open discussion, would any PHP developers like to refute any of the ideas put forth in this document: Experiences of Using PHP in Large Websites
-
The O of Erastothenes is just slightly supralinear
O(n*log(log(n))) steps to find the primes out to n. If you want the first n primes, add in another factor of log(n) to account for the density of primes.
The sieving involves one action every time a prime divides a composite number (ie strike out that composite number). Since the average number of prime factors averages out to log(log(n)), the number of actions is just barely supralinear.
In reality, of course, if you don't want to accept artificial limits, you will hit the fact that just talking about very large numbers gets more difficult since the representation has to get larger than any convenient fixed size representation. Throw in another log(n) if your code handles large integers.
I don't know if any purely functional implementation can approach this performance level. The basic action of "striking out" involves modifying a value in place. Recopying the modified datastructure is problematic since the datastructure is large. Incrementally layering changes is likewise problematic since upon access you have to search your incremental changes - most of which do not apply to the number you are looking up.
Here are 2 implementations in Perl. One uses closures heavily (but isn't really functional since it uses assignment) while the other is very, very short. For amusement here is the short implementation (made longer by one space to avoid /. breaking a line in a bad place):
sub sieve {
grep{@_[map$a*$_,$_..@_/($a=$_)]=0if$_[$_]>1} @_=0..pop
}
print join " ", sieve(100);
It scales like the C version does, albeit with far worse constants. Other than practical memory issues, there are no limits on how big a list this can handle. -
And with the death of Web Techniques magazine..... (a year or so ago) and The Perl Journal, there goes the rest of the teachers from my early coding days.
At least SysAdmin (even if pretty clueless sometimes as an entity) and Linux magazine are still worth reading. Both contain enough code to keep the old brain cells churning.
And it was so sad that Web Techniques turned into a load of old wank aimed at PHBs - that, and TJP were the only ones I happily paid for.
Anyone else got any (reasonably priced) recommendations for geek mags that still keep the ol' brain cells working?
.02
cLive
;-) -
Re:Anyone who intimately knows 5
Start now. It's gonna be a while before six is out - and even longer before companies will trust it in production environments.
And come over to The Monastery to get help when needed. A great resource for new (and experienced!) Perl hackers.
.02
cLive
;-) -
Similar thread at perlmonks
A thread over at Perlmonks from a while back.
-
Re:There's one major reason I choose Python over Papart from using whitespace as syntax
A former colleague and I were discussing this at one stage, which inspired this hack entitled "Audible Code Separator" thereby allowing the bell character (^G) to be used for token separation in Perl scripts. I'll not have any other language stealing Perl's thunder in terms of lack of readability! :-) -
Re:Well somebody has to say it...ASP??? They should be using Perl, shurely??
Elgon
-
Re:Not hard enough!
I don't know where Perl gets this totally undeserved reputation for obfuscation.
-
Re:Not hard enough!
I don't know where Perl gets this totally undeserved reputation for obfuscation.
-
Re:Not hard enough!
I don't know where Perl gets this totally undeserved reputation for obfuscation.
-
Re:Not hard enough!
I don't know where Perl gets this totally undeserved reputation for obfuscation.
-
Re:Not hard enough!
I don't know where Perl gets this totally undeserved reputation for obfuscation.
-
T-Mobile, I luv ya.I love t-mobile so much I bought the company.
Ok, so I haven't shaved today, either, but I did write up a little Cool Use For Perl on PerlMonks called Expresso Login.
If you've been to Starbucks or Borders Books in Southern CA or South Texas, you very well may have seen me.
I recommend Borders -- especially if you ever need a reference book while working...just walk over and get one, bring it back, sip Latte, work/surf, and enjoy.
The only problem I've had was the onset of Christmas music prior to Thanksgiving weekend (!).
-
T-Mobile, I luv ya.I love t-mobile so much I bought the company.
Ok, so I haven't shaved today, either, but I did write up a little Cool Use For Perl on PerlMonks called Expresso Login.
If you've been to Starbucks or Borders Books in Southern CA or South Texas, you very well may have seen me.
I recommend Borders -- especially if you ever need a reference book while working...just walk over and get one, bring it back, sip Latte, work/surf, and enjoy.
The only problem I've had was the onset of Christmas music prior to Thanksgiving weekend (!).
-
Re:Don't you prefer to buy a CD?
Hmmm. I agree that it's hard to get excited about downloading from these particular onlines sources (nothing compares to the old emusic.com or just plain ripping from disc), but I have to disagree with the rest of what you're saying. CDs already seem kind chintzy to some of us who grew up in the era of vinyl. Gone are the days where you pull off the shrink wrap and out falls a lyric sheet, a booklet, pictures, other assorted gimcracks and geegaws. Gone are the days where cute tricks like locked grooves made listening to some vinyl a bit more interesting. Also gone: playing any 33 1/3 album at 45 for that Chipmunks sound, playing a wide hole 45 off center, picture discs, foldout covers, affordable indie singles, legible cover text, and probably a lot more.
To me, there is nothing less tactile than a smooth plastic disc. You can't even check the grooves to see how long the songs are! And those little booklets? Always printed on the same lame glossy paper, always printed with miniature type because that's the only way you can fit more than two words on a page. And those lame plastic cases. So easy to break, so annoying to attempt to replace.
For my part, I welcome the digital age. It means: custom playlists without changing physical media or time-consuming mix making, putting my mp3 server on shuffle and not hearing the same song twice for over a month, having Festival act as my own personal DJ, no more scratches, pops, dings on the physical media. The only thing missing is the packaging, which I've already pointed out has lost 99% of its enjoyment during the switch from vinyl to CDs anyway.
Anyway, that's my rant and I'm sticking to it. :) -
Happy DayThe Perl Cookbook is one of the top three technical books I've purchased. If the new version improves on the old version, it is a must-have for anyone who does anything with Perl.
Regardless of the religious wars over languages, I have time and again found Perl to simply be the most practical language for the job and continue to enjoy using it for a variety of tasks and watching it mature.
There is no substitute for the CPAN or Perl's ability to get the job done quickly and easily with an active community providing free (and very effective) support. Both Perl and the Perl Cookbook are an integral parts in my toolkit and for anyone who uses it, whether from time to time or regularly, I recommend it. -
A whole new world for obfuscated code ...
Wow, I think obfuscated code is pretty 1337 now (e.g. Perl code in the shape of a camel), but I'll be seriously impressed when someone writes a "Hello, World" program that converts to an audio file of them saying "Hello, World." Any takers?
:)
Cheers,
IT -
Re:J2EE is not slow
Does Mason use Amazon? The monks would be interested!
-
Re:OOP in Perl is a Bad Thing
Wouldn't that be the fault of the people who didn't bother to learn basic concepts like OO programming rather than the fault of the people who know how to use it?
OO in Perl is not hard, sure its syntax is a bit different but the concepts are the same and there are multiple books (like this one), online resources such as this, and not to mention the existance of 4 (not 1 or 2 but 4) tutorials on OO in perl that come with the documentation. If people don't expect their "schmucks in the cube farm" to be skilled in a language then its no wonder that our jobs are going to India! -
Randal Schwartz (the writer)
Randal Schwartz is a regular over at PerlMonks.org. He's replied to a couple of my threads and helped me out of some sticky situations. It's rare for such a talented programmer to be so accessible and helpful to the public.
He's written well over 3,000 posts on Perl over at PerlMonks.org. -
Randal Schwartz (the writer)
Randal Schwartz is a regular over at PerlMonks.org. He's replied to a couple of my threads and helped me out of some sticky situations. It's rare for such a talented programmer to be so accessible and helpful to the public.
He's written well over 3,000 posts on Perl over at PerlMonks.org. -
Re:seems like
I'm not sure if I agree with you that those are problems. Different, yes, but not necessary problems. I came from C and Java mainly, when I encountered Perl, and at first I thought it looked butt ugly and a bit hard to read, yes. But the benefits can be immense.
The sigils really help code being readable, you always know what to expect from the variable. Although, good naming and good programming practices is enough in most other languages.
Then, like someone else pointed out in some other post up there, you can always be sure that $vtime is a variable, while you never know if vtime might be a reserved keyword in the next version of the language.
But one of the greatest wins are the ease of use that comes with:
print "My name is $name.\n"
Ruby does this like this:
print "My name is #{name}.\n"
(though most use puts) - I find this not really as clear, and a bit more typing. But it allows any expression, which is nice. That kind of magic exists in Perl too, but not easier.
Compared to Java (and others)
System.println("My name is " + name + ".");
It is a winner hands down.
2. I think the complex data structuers are really easy to read and grok in Perl. It is easy to obfuscate these parts of course, but really, there are only a few short rules, and once you have those down, you only need to read left to right. See References quick reference. And creating them is really easy. Just write the structure as you want it.
Writing large applications in Perl depends totally on intense self-discipline as a programmer, and everything about Perl actively encourages you to break that discipline.
This is almost total bullshit. Only bad programmers write bad Perl code, and bad programmers can write bad code in any language. Badly disciplined, inexperienced or just "bad lazy" coders write unmaintainable messes in any language, and I can tell you that they are no easier to untangle in Java or other languages either. I worked in a Java shop for a bit over two years, and the unholy mess some people could create in a coffee break is worse than most things I ever seen in Perl. And at least in those days, Java was the be-all hype language where everything would be so nice, because it was OO. Bullshit.
The thing is that you need to know what you do in any language. And you need discipline in any language. The difference is that the mess does not look the same when you mess up in Perl as in for example Java. But the long compact blocks of code that some people is a Perl trademark is not one of those, I've seen those in most any language. I've seen people write almost complete applications in one method, in one class in Java.
Take advantage of your language, whichever it might be, know what you are doing, and don't cheat (other than in good ways ;-) and you'll be fine.
-
Re:Off Topic but figure I would ask your perl guysAsk at PerlMonks instead. I don't think so, but there have been a few projects for integrating the two languages, such as JPL, perljvm and Inline::Java. Not sure how succesful any of them were, if they ever worked or what the status is today.
If you are looking to convert perl source into java source, then you are probably totally out of luck though.
-
Re:Let's wish this project good luck
Please don't expect Stunnix to give you any level of security. You should read the discussion on Perlmonks.
-
hidden agenda's
This is all just a plot to get tickets to YAPC::Europe
And a damn good one too, i'm going. Hope we'll get some scoop on this too
One year has passed since the last YAPC and they defenately confused me enough to make me want to hear The Damian explain it to me all over again, or anyone who understands it for that matter ;)
Funny how he won over the complete hall of coders using only two words: "less chars"