|
|||||
|
The cool thing about blogging software is that it shows the blogger all sorts of interesting information, such as the number of visitors, or the search string that led them to the blog. I see lots of interesting search strings, but I keep wondering if the users actually found what they were looking for. That said, please be kind and leave a message telling me if you found what you wanted, and if you didn't, please say what it was and I'll try to cover that in my posts. You can leave your message either as a comment here, or send me an email through the contact form. Thanks!! I've added a Tech Jobs page to the main pages section (right under the header) for those who are looking for jobs. Update: Added craigslist.com search for Perl jobs in Canada Update: The Feed fetcher now works with craigslist.com worldwide. You can also use search keys for feeds that accept them. Update (6/13/09): monster.com added with 192 countries (!!). Since some sources accept keywords and others don't, the form will now tell you so. Also, modified the form to allow blank keywords for some sources. The issue is that craigslist uses a totally separate query for blank keywords, and right now the fetcher doesn't handle alternate query strings per source. Total Sources: 4. Total feeds: 708. Good luck job-hunting! Vinny. Seriously - **DON'T!** (did I stress that enough?) Not unless you've tested it well on a non-production machine. It's been known to break themes and plugins. My Advertising Manager plugin is still broken as of this writing, and there's no automatic downgrading. If you were hasty like me and ended up getting in trouble with the blasted 2.8 version, check this link on some steps to perform the downgrade. Update: Changed subroutine to comply with Perl Best Practices Update2: Removed the prototype from the subroutine. I've always had a problem with recursion. Not with the general theory that a function will call itself, etc - no, that's easy. The hard part was when I had to deal with complex data structures in Perl (an array- or hashref containing a hash of arrays of hashes, a gazillion levels deep). Well, I guess anyone would have a hard time with that kind of data. Anyway, in this post I don't intend to get all complicated explaining all the kinds of recursions out there. If you want that, check this article at wikipedia. What I do want to do is help all of those who are in the situation I was in, by explaining in the simplest way possible how to deal with this scenario. Continue reading... Today I managed to finally get Perl to put and get messages to MQ Series. It's something that I've been wanting to do for quite some time, but didn't have the time or even MQ knowledge to do so. This post is intended for those who, like me, aren't MQSeries gurus and can't make much of the documentation of the MQSeries module in CPAN. I hope it serves you well. Continue reading... I always like to say that 90% of Perl is its modules. Back in 2000 when I was working as a junior Perl programmer I was asked to write a web application that, among other things, could send contact messages through email. Unfortunately, I never had anyone to really teach me the Path of Perl - I only relied on Learning Perl by Randall Schwartz, and whatever I could find on the net. I had a really hard time with that application, mainly because I didn't know about Perl modules, MySQL and SQL language. Had I been familiar with at least the Perl modules part, I wouldn't have had to spend 8 days and nights in the office (including my birthday). I didn't even know how to use strict; at the time! Keep reading if use strict; makes no sense to you. Being the extensible and flexible language that it is, Perl provides us with some safeguards and helpers to assist in avoiding what happened to me (I wish I knew that back then). The first of which I'll talk about is Pragmas. Folks, I decided to change the looks of my blog. I'm using Atahualpa theme which is simply amazing. There are over 200 customization options which allow you to do practically anything you want. If you are wondering about the logo, it is one of Pablo Picasso's drawings. I chose it because of its simplicity, which is in my opinion one of Perl's faces (I try not to get on its bad side - K.I.S.S.). I hope you enjoy it. Vinny. author: Valeria Paixão Note from UseStrict: Some of the examples in this tutorial were borrowed from Randall Schwartz's Learning Perl. It's a book that EVERY beginner Perl programmer should have. If you don't have a hardcopy, please consider getting one. You can find it here: Learning Perl, 5th Edition
In this article, you will learn how to use basic I/O in Perl, learn about @ARGV, and become familiar with string formatting using printf. STDIN<STDIN> tells Perl to read from the standard input - usually the keyboard.
while (defined($_ = <STDIN>)) {
print "I saw $_"; # echoes whatever is typed onto the screen.
# Quit with ^D or ^Z (depending on your system)
}
foreach (<STDIN>) {
print "I saw $_"; # almost the same as above
}
The difference between the while and foreach loops above is that while executes its statements at every hit of the return key, while foreach slurps into memory all the input until eof (^D on Unixes) and only then executes its instructions. It is important to note this difference if you don't want to crash your machine. If your input comes from a webserver with a 400MB log file, you're better off processing each line individually than slurping it all into memory. by André Batosti Opening FilesTo read or write files in Perl, you need to open a filehandle. Filehandles in Perl are yet another kind of identifier. To open a new file on system you need to create the filehandle for this file using the command open open(filehandle, pathname); The filehandle is the identifier that will describe the file and the pathname - the full path of the file you trying to open. Typically it is represented by a constant, but when working with complex programs, it is best to use a scalar variable in order to safely pass it from one subroutine or method to another. |
|||||
|
Copyright © 2009 use strict ;#) - All Rights Reserved |
|||||