Domain: perl.org
Stories and comments across the archive that link to perl.org.
Comments · 847
-
Crash course
The perl man pages are quite nice to start:
http://perldoc.perl.org/perlboot.html
http://perldoc.perl.org/perlobj.html ...
And here is a very small example using the basic concepts:
{
package Person ;
sub hello {
my ($self,$who) = @_ ;
print "Hi $who->{Name}! My name is $self->{Name} and I am a " . $self->gender() . ".\n" ;
}
}
{
package Man ;
@ISA = qw(Person);
sub gender {
my ($self) = @_ ;
return "boy" ;
}
}
{
package Woman ;
@ISA = qw(Person);
sub gender {
my ($self) = @_ ;
return "girl" ;
}
}
my $bob = bless { Name => "Bob" } , "Man" ;
my $alice = bless { Name => "Alice" } , "Woman" ;
$bob->hello($alice) ;
$alice->hello($bob) ; -
Do your kid a favor
...and teach him Perl
-
Re:Another free song
One thing I love about Weird Al's songs is that he does his research. In the song from this "article", he mentions such things as Kazaa. In "All about the Pentiums", he throws out a lot of technical terms.
But that's of course because Weird Al is Larry Wall! -
Advertising for Perl Jobs is simple
jobs.perl.org is absolutely the first stop for the Perl subset of open source hiring, both for programmer types and sysadmin types.
-
Re:5 of first 7 comments trolling
Apart from a google search for "PHP sucks", here's a few I have bookmarked:
- Experiences of Using PHP in Large Websites - PHP suffers from "oversimplification leading to excessive complexity".
- What I don't like about PHP - a general shopping list of complaints.
- "PHP IN CONTRAST TO PERL" - How PHP is a mess and Perl does more with less.
- List of PHP's shortcomings from perl.advocacy
- Re^2: Is Perl a good career move? on PerlMonks
-
Re:Other sites
Several perl.org systems were also down. http://log.perl.org/
-
Perl MVC Frameworks
-
Get "Perl Hacks" Instead
Most of the reviews I've read of this book have not been particularly positive. Get "Perl Hacks" instead. Or Randal's Perls of Wisdom
... Or the Cookbook ... -
Get "Perl Hacks" Instead
Most of the reviews I've read of this book have not been particularly positive. Get "Perl Hacks" instead. Or Randal's Perls of Wisdom
... Or the Cookbook ... -
Get "Perl Hacks" Instead
Most of the reviews I've read of this book have not been particularly positive. Get "Perl Hacks" instead. Or Randal's Perls of Wisdom
... Or the Cookbook ... -
Re:Perl praise and beefs interspersed
1) The beef I guess is that unlike Python or Perl's other competitors, Perl modules don't come tightly integrated with the core distro. Agreed that Perl probably has a lot more modules than any of those other languages do, but a larger than ordinary de facto distribution (why not include important modules like Digest::MD5, Crypt modules, SSH modules etc?) would be desirable (especially in those situations where you don't have access to the internet directly from within corporate networks and can't install the modules with the "perl -MCPAN -e shell" option) . There might be those Perl veterans who would say -- "build your own distro with your custom modules already packaged" -- and while that might be a very smart thing to do, many a time (when one keeps moving from one environment to another -- some call it job hopping, it helps to be able to download one single perl distro package or rpm or the source+compile and have basic administrative scripts work -- especially those that rely on centralized automation (ssh-based trusts, copies across the network, etc).
I completely agree, this is a huge problem. Unfortunately, everyone has a different opinion of what "the important modules" are - for example, you mentioned SSH, and I don't think I've ever seen an SSH module, certainly never used one myself, and I don't think I've seen one required by anyone else's code. This is a good place to start, but several of the modules there have external dependencies (e.g. DBD::mysql, GD, and Net::SSLeay, all on the top-10 list) and you really can't expect the libraries they depend on to be installed on everything (although OpenSSL probably ought to be). -
Re:Hello there, Comrade Molotov!
Ok if you want all that automagic stuff that you get with php operators use the Template Toolkit. Everything.is.accessed.by.a.magic.dot.operator. The slash engine uses it, but slash is a bit legacy, and should use Catalyst+TT or Jifty instead these days . That's withough phps 'orrible namespace pollution problems too
:)) No probs, glad to help. -
Re:If you use PHP....
-
Well, duh!
So you've got Perl in your PHP, is there a way to do PHP in your Perl?
Sure!
</joke> -
The Perl Job siteThe Perl Job site
http://jobs.perl.org
Jobs per Month
06-2006 92
05-2006 180
04-2006 141
03-2006 136
02-2006 140
Jobs per Country
United States 2839
United Kingdom 426
India 195
Canada 186
Australia 94
Germany 42
The Netherlands 20
Netherlands 15
Russia 14
Denmark 12
US Jobs per State
CA 821
NY 218
California 193
WA 161
MA 125
IL 122 -
BingoI do a lot of interactive data processing. I use PDL a variant of Perl (which, recall, is JIT-compiled) that is designed for array handling. For most of what I do PDL is great -- the CPU spends most of its time waiting for me to make up my mind what I want to do, and moving my ponderously slow fingers to type the command at 110 baud. But some of the stuff I do (magnetohydrodynamic simulation) is exremely CPU-bound, and that stuff I write in C.
A lot of folks use languages like PDL, IDL, MatLab, Octave, or even NumPy to do array processing, and tout the fact that for large arrays those languages run "essentially as fast as C". But that's bullshit. All those languages vectorize their operations in exactly the wrong order - if you have a hundred million datapoints and you want to do six operations on each one, each of those vectorized languages will dutifully swap each of your hundred million datapoints out of RAM into the processor, multiply it by seven (or whatever), and push it back out to RAM before pulling them all back in to add six to each one. What you really want is to vectorize in pipeline order, doing all the operations you plan to on each data point once and for all so that you can take advantage of your processor's nice, fast cache. Nobody has (to my knowledge) figured out a way to do that, that is robust enough for an interactive/JIT language, so just writing it in "C" and getting the loops nested in the right order can speed you up by a factor of more than 10 on a modern AMD or Intel CPU. -
Re:Using Perl Should Be A Crime
Fortunately B::Deparse deobfuscates the code instantly, resulting in:
@A = (25, 0);
@B = (0, 24);
@C = (49, 24);
@X = ($") x 49;
@_ = (@X, $/) x 25;
$_[$A[1] * 50 + $A[0]] = '.';
$_[$B[1] * 1 * 50 + $B[0]] = '.';
$_[$C[1] * 50 + $C[0]] = '.';
@X = ($C[0], $C[1]);
'???';
while (394 > join($", @_) =~ tr/.//) {
do {
$R = 3 * rand;
@X = (int((${('A', 'B', 'C')[$R];}[0] + $X[0]) / 2 + 0.5), int((${('A', 'B', 'C')[$R];}[1] + $X[1]) / 2 + 0.5 + 0))
} while $_[$Z = $X[1] * 50 + $X[0] + 0] =~ /\./;
$_[$Z] = '.';
system $^O =~ /[wW]in/ ? 'cls' : 'clear';
print @_;
}
which is actually pretty easy to understand :) -
Re:Separation good (perl framework)
Take a look at Catalyst at http://www.catalyst.perl.org/ it is MVC with a lot of options and very nice to use...
-
Re:Code in content, not content in code
I used to use Mason and it is a pretty good framework. But nowadays I've switched to Catalyst, a framework and set of libraries that make MVC pretty easy. It has the added bonus that it supports a number of web engines (e.g mod_perl 1 and 2, CGI, FastCGI, etc) while I've given up on getting my old Mason sites working with Apache 2. I like the use of TT2 as a template engine. It has a simple but powerful mini-language that helps enforce MVC seperation by not being a full-blown programming language. I think Mason almost encourages embedding of logic in content (like PHP) because it doesn't have a seperate templating language, always using Perl code. You have to be really disciplined to break your modules up into a MVC-like arrangement.
I'm not big developer, just a one-man experimenter and network admin for my family. As well as my own projects I've made a few little web apps for the family Linux web server. Catalyst just lays things out so well.
-
Re:Liberal license
People could simply put their time and energy into Perl 6 instead. An open source VM (Parrot) that is well into development, and the primarly language for this VM already has a rather sizable following (Perl 5/6). Its intermediary language (Cola) is OO style, so making a compiler that converts JAVA to COLA shouldn't be all that difficult. Of course, rewriting the libraries will be difficult
... but that part will be the same regardless of where you port Java to.
http://dev.perl.org/perl -
Re:Cap'n Crunch
The GP post is probably referring to functionality in the Storable module.
http://perldoc.perl.org/Storable.html
It's not uncommon for someone to refer to module functions as though they were builtin. We perl geeks pretty much take CPAN for granted these days. It's one of the best thing about perl! -
Re:Bad idea
And unlike Perl and PHP, Ruby has the potential to be an enterprise-scale language
You mean, Perl, as in Amazon?
C'mon...don't be such a fanboy.
Oh, please. Who's the fanboy here?
I started writing Perl somewhere over 15 years ago, and I wrote some yesterday. I still love it, but I think I know its strengths and weaknesses. There's a list of reasons they're building Perl 6: Perl 5 is not well suited for certain kinds of development.
As to Amazon, their jobs pages make it pretty clear that Perl is a secondary language there. Perl was a great thing in the early days of the web, but it's been a loooong time since I've seen a new company doing serious web work in it. I hope Perl 6 fixes that, but for now if you think Perl 5 is just as good as anything else for large projects, you need to get out more. -
P languges will run Java thoughAs I understand it, the Perl6 VM, Parrot, could potentially handle Java bytecode (after translation), thus rather than the JVM supporting P languages, we could just as easily do away with Java and start writing in Perl6. Obviously, this also implies developers having to purchase the mandatory Larry Wall shrine and Damian Conway bible. I'm sure, however, that the world will be so much better off for it. Perl 6 is due for completion in the Year of our Larry, 2666.
s{Che(e)rs}{Am$1n};
-
How about Catalyst?
I did a database-oriented web app last year. I found Catalyst http://catalyst.perl.org/ really really useful. The MVC pattern it imposes on you really helped. Ditto for the web framework, plugins, DB access and scaffolding.
From what I can tell, RoR is conceptually pretty close to Catalyst, but me being a perl-head, I chose Catalyst. Anyone tried them both? Any comments? -
Re:"No Micwosoft! No!"...
-
Re:Queue anti-PHP jokes...
You missed one:
http://www.perl.org/ -
Hey, What about Catalyst
Catalyst is the hot new Perl based Model-View-Controller framework. It's been out for about a year, it's production ready easy for any competent programmer to work with, and backed by massive collection of libraries on CPAN. It has a large friendly and active user community, which you can find via the website.
Me, I'm using it for lots of things - my project of the moment is gluing in some of the tasty AI modules on CPAN into it for automatic classification.
-
Re:Flipping the question around...
Your point is captured in this real-world anecdote:
http://use.perl.org/~Matts/journal/23611
Simultaneously, this suggests a mitigation:
Designate the hardware, and a rigorous test schedule, and allow concerned parties to execute test suites against it before the election.
You can't eliminate "acts of nature", but you can set up a system wherein conspiracy becomes Really Hard. -
XUL: WIkipedia
Here is the Wikipedia article on XUL. I could have used this link on the PERL 6 web site since the documentation on PARROT and PUGS are composed in XUL. This was my first introduction to the format. The documents opened in Mozilla, but not in IE. While the arguement has been made here that you should only use Mozilla, why alienate a huge chunk of users without helping them along? Also, if you are going to publish in XUL, do not assume the casual user knows what the format and reader is. The Filext.com site did not yet have a listing or recommended reader for the XUL files.
-
Re:What about all the libraries SDL is missing?
The most recent and up-to-date OpenGL code is in the sdlperl1 repository. I'd love help getting that merged into the repository on sdl.perl.org.
-
Re:PyGame
FWIW you can bless anything as an object. (Well, a reference to anything.) Scalar, hash, whatever. The key here is that it's optional rather than the default. (So, yes, perl isn't pure OO, but then again that's not really "broken" so much as "different design goal."
;)) -
Re:Oracle and its security record
Sure.
The issue with the mail function is that PHP grabs the four variables specified when calling the mail() function, then puts it into a template and pushes it to sendmail/postfix/qmail/etc stdin. Someone can include a template inside the template and php happily treats it as a separate mail even with a totally different from and to field.
The easiest workaround is that you configure your mailserver that the www-data/php user can only send mail to the local network.
More workarounds here. Some discussion about the issue here.
Note: It is possible to exploit this vulnerable mail() implementation even if you hardcode everything but the body. PHP has this vulnerability in 3-5. -
Re:Oracle and its security record
> Would you be able to direct me to resources on
> how to work around the issue?
http://www.perl.org/ -
Re:Large groups of employers> If you really want a job with Perl...
-
Re:Alternative....
Or rig something up with Catalyst that uses one of the platform independent IO:: modules to read off the serial port. Encapsulate it in your applications model classes, whack up a few templates, [optional create executable application] and serve it all up locally using Catalyst's built in HTTP server.
OK, so Catalyst might not be quite there yet, but it's close.
-
Sounds ambitious
Sounds ambitious. Maybe moodle is what you need, or maybe you could hack something together (e.g. user created slideshows and other presentation stuff) with something like Catalyst.
-
Easier than the articleJust use the excellent prototype javascript library instead. Saves a ton of time. It's cross platform, dev language agnostic, and has super sweet functionality built in.
I guess you can use JSON, and XML data formats with prototype, but I just use plain old text to accomplish whatever I want.
Prototype is also used in Ruby on Rails and its PHP analogue CAKE, and also the excellent perl framework Catalyst
-
Re:allowed charactersIt's not so tricky if you use Perl:
use HTML::TagFilter;
See http://search.cpan.org/~wross/HTML-TagFilter-1.03
my $tf = new HTML::TagFilter;
my $clean_html = $tf->filter($dirty_html); -
Re:Perl What?
You could take a look at Pugs, a Perl 6 inprogress implementation in Haskell.
-
Re:Perl is between awk and CIn bio- and chemical informatics there are a lot of things depending on names and numbers at the same time. Here is where perl fits in really well, since strings are a pain for a c, but the operations become too complex for awk. I'm not into bioinformatics myself, but you can see for example on http://bio.perl.org/ that it makes sense to use perl here
:)not to feed any flame wars here: there's also http://www.biopython.org/ and http://www.bioruby.org/
;)
But I'm just trying to make a point here for the position of these kind of languages in sciences. -
Perl What?
Just checked my new, freshly installed, CentOS 4.2 X86/64 Opteron server to see what flavor of PERL it's running - and....
perl 5.8.
Come on now, how long as Perl 6 been in beta? According to this page, it's been an ongoing effort for at least 3 years, and the oldest link on that page talks about how long it's been since a Perl 6 update!
It's like waiting for the next release of Debian - don't hold your breath, don't delay your shower. Check back when your grandson has his first kid. -
Re:No language that I like better
Can you recommend a resource for OOP with Perl?
Right now i found all i needed in the Perl.org site - this OO tutorial for Perl is pretty complete. There's also this one, which is oriented to begginers.
In fact, i always keep a browser window open to Perl.org when i'm coding Perl - the tutorials are very nice, but the function reference has been priceless to me. -
Re:No language that I like better
Can you recommend a resource for OOP with Perl?
Right now i found all i needed in the Perl.org site - this OO tutorial for Perl is pretty complete. There's also this one, which is oriented to begginers.
In fact, i always keep a browser window open to Perl.org when i'm coding Perl - the tutorials are very nice, but the function reference has been priceless to me. -
PDL
The article talks about some of the defining features for perl. Well, one of the defining features in my perl experience has been Perl Data Language, pdl. PDL _is_ whipitupitude. Its a wonderful wonderful matrix library. And it comes with the best perl shell I know.
I had to break down a equation into a sequence of linear equations. So I hacked up some PDL in like 2 hours to do that. Couldn't have been easier, even though I'd never used PDL or its perldl perl shell; I just started typing in the interactive shell until it worked as expected and until I knew what I was doing. Then I needed the results in interger, so I rounded everything down, built a permuter and sorted the permuted results for each individual segment. That took three hours, but only because I kept botching the matrix multiplication. Even with huge datasets, generating hundreds of thousands of linear equations, each spanning dozens of datapoints, permuting the linear equations, sorting them and selecting the optimal, PDL would run it all my slow arse 800mhz crusoe laptop in seconds. Matlab couldnt touch it.
Thats the other really truly thing about PDL; the performance. If someone else would chime in and do it better justice, but my crude understanding is that it generates some kind of extremely optimized machine code on first use and runs whatever equations you've thrown at it like silk from that point on.
Little late and a little off topic, but PDL really is just a masterpiece of perl hackability. The PDL perl shell is truly spectacular; get some symbolic integrators and differential equation solving packages in there and I wouldn't need to break open Mathematica or Matlab ever again. Ok, long way away, pdl is really just about matricies, but it is really really sweet, and its shell is good for anyone who just wants to try something out really quickly in fully interactive perl.
That being said, I really cant wait to see where the perl6 VM is going.
G'night!
Myren -
Re:IHBT
However, I'm afraid I still have problems with your claim that open source developers and users have nothing in common except open source. I'm not sure whether it's true; more importantly I don't understand why it's relevant.
I don't believe there's a single "open source community". There was a discussion on use Perl; two years ago about Open Source and Egos.
The problem is, among all of the groups of people that might possibly be members of a single open source community, what interesting commonalities are there? You can point to the self-identified Free Software community and make some assumptions about community values and ideals. You can't point to the open source community and say "they are all pragmatists" or "they are all libertarians" or "they all want to beat Windows".
John Mark's argument is that businesses interested in open source should focus more on the economic advantages of open source than the advantages put forth by anyone who points to a mythical community and says "There, that's what these people all care about!" -- because the economic reasons for the successes of open source software are real, yes, but also because they're likely more important to such businesses than the supposed values of the community.
If there is no single open source community with an ideological fence to keep insiders in and outsiders out, then the reason for adopting or not adopting open source depends on the goals and ideals of the potential adopter.
It's not that free software fans don't exist. It's not that software developers don't exist. It's not that Slashdotters don't exist. Hey, I'm a member of all three groups.
I'm not sure how far to take the argument from historical inevitability, but there are some strong social, economic, and historical reasons why free and open source software really started to spread when they did. I don't have a problem with people using open source software because those factors matter to them. I hope they contribute back and I hope the arguments for quality and freedom affect them positively, but I think assuming that they share (or should share) values with an ill-defined community is a mistake.
-
Re:Tapestry Making Web Development a Breeze?....
Seaside is technically superior, it uses continuations to mantain state and this make it really transparent...
If you want a continuations-based open-source Web framework built on top of a stable, popular, well-tested language, you might check out Jifty, a Perl Web framework. Wait a second, you say -- Perl doesn't have continuations! This is true. Perl doesn't have continuations. Jifty does. It's only a "developer release" right now, but it's surprisingly useable all the same.
(Disclaimer: I work for Best Practical Solutions, the company behind Jifty. Yeah, yeah, shameless self-promotion and all that. It's a spiffy framework, and it's open-source.) -
Re:solution
use one time pads. the only REAL secure solution.
I've toyed with this one myself to send chitchat back and forth to my Mum.
Use a geiger counter to fill a CD with random numbers, send a copy to Mum, and drive CSIS/NSA/GCHQ/etc. nuts with email that they can't decode.
Given a CD full of random numbers, a couple of lines of perl would do the rest...
Yeah, I know, I need to get out more. I even recorded the leap second on WWV earlier today. Sad or what?
...tick...tick...tick...(blank)...(blank)...BEE
P ...tick...tick......laura
-
great
-
Which is why we use Catalyst instead
We do rapid application development for the web using Catalyst (http://catalyst.perl.org/) - it's fast, it's MVC, and because it's perl we can leverage the whole of CPAN to avoid re-inventing wheels. It's also (with a little CPAN-fu) trivial to deploy on any host that supports FastCGI, and most of our clients already have enough in-house perl knowledge to be confident they wouldn't be sunk if we disappeared tomorrow.
RoR has a great team behind it and an even better hype machine, but Catalyst simply does the job and does it well - and with mod_perl scales comfortably to huge application workloads. -
Perl - Catalyst for web dev
If you already have some idea of perl and want wonderful MVC web framework goodness, take a look at http://catalyst.perl.org/ which is being touted by many as "perl's answer to Ruby on Rails".