Re: Cool/useful short examples of Perl?

2011-05-31 Thread Leo Lapworth
Hi,

Thanks to those who provided me examples.

I'm glad everyone else has had interesting discussions, it's obvious
that lots of people have opinions.. which is nice, though I'm not looking to
get into discussions, I'm focusing on building a website.

For those interested learn.perl.org is going to have a few examples
(just to spice it up / get someone interested in what is possible), but for
this phase is mostly about:

1) Installing Perl
2) What is a command line (hang out on #win32 for an education in what
people don't know!)
3) How do I run a program (I've got Perl installed, now what?)
4) What are modules / Installing modules
5) Using perldoc.perl.org / reading FAQ's / Books and other resources
(I have created a page that lists ALL Perl Keywords and links
to the relevant perldoc page, so although 'perldoc -f while' does
not work, there will be a 'while' link on the site pointing to 'perlsyn')

Having been doing a lot of reading around this the perldoc's and
FAQ's really could do with more love - so if you have time please
try and get involved with those projects:

Perldoc: http://perldoc.perl.org/perlrepository.html the /pod/ folder
FAQ: http://faq.perl.org/#How_to_contribute_to

Thanks again - I'll let you know when the site is live.

Cheers

Leo


Re: Cool/useful short examples of Perl?

2011-05-31 Thread Graeme Hewson
On Tuesday 31 May 2011 04:52:24 Gabor Szabo wrote:

 ps. My spell checker wants me to write 'learned' there.
 I wonder which one of us is right and how many people out there know
 the difference.

Many people are bilingual in American English and British English!


Re: [OffTopic] Anyone sponsoring VISA in UK

2011-05-31 Thread Egor Shipovalov
The problem with this is that the employer needs a license that takes
months to obtain, and a couple of grand in legal fees if you want to
be sure about the outcome. There are companies who are already
licensed though, which is what I presume OP asked about.

--
Best regards,
Egor Shipovalov.

On Mon, May 30, 2011 at 9:39 AM, Dave Hodgkinson daveh...@gmail.com wrote:
 I think if you're good enough and the employer has the right shaped hole,
 it'll just be a process to go through.

 As long as you your application doesn't look weird, in my experience, border 
 control are
 reasonably efficient. Stick out and all bets are off.

 On 30 May 2011, at 06:02, AJ wrote:

 hi,
 By sponsoring , i meant that some company who is willing to give a job to an
 indian national in India at present, which will also help in the visa
 process.

 thanks
 aj

 On Sat, May 28, 2011 at 4:16 PM, David Cantrell da...@cantrell.org.ukwrote:

 On 28 May 2011, at 09:35, AJ j...@ejain.com wrote:

 I am exploring options of any company here willing to sponsor Visa for a
 good perl addict

 Try talking to your bank.

 --
 David Cantrell






Re: [OffTopic] Anyone sponsoring VISA in UK

2011-05-31 Thread Egor Shipovalov
BTW, jobserve.com has an option to search for jobs that offer visa
sponsorship. Once I tried it for UK and perl, a couple of ads turned
up.

--
Best regards,
Egor Shipovalov.

On Sat, May 28, 2011 at 9:35 AM, AJ j...@ejain.com wrote:
 Hi,
 I am exploring options of any company here willing to sponsor Visa for a
 good perl addict.
 Also please let me know if this is not the right place or if there are some
 better places to post such questions.
 Pl reply offline,
 thanks
 aj



Re: Cool/useful short examples of Perl?

2011-05-31 Thread Abigail
On Mon, May 30, 2011 at 10:29:10PM +0100, Dave Hodgkinson wrote:
 
 On 30 May 2011, at 22:17, Uri Guttman wrote:
  
   DH No. Real people want to solve real world problems in a simple,
   DH maintainable way, not wave around a canapé sized penis.
  
  you have a strange way of measuring genitals. real world code is also
  concise and fast and usable.
 
 And MAINTAINABLE. 
 


Maintainability is overrated.


Abigail


Re: Cool/useful short examples of Perl?

2011-05-31 Thread Mark Keating

On 31/05/2011 04:52, Gabor Szabo wrote:

Gabor
ps. My spell checker wants me to write 'learned' there.
I wonder which one of us is right and how many people out there know
the difference.
Gabor, your spell checker is a moron, thankfully you are not, it is 
'learnt', but spell checkers also hate dreamt as being archaic but keep 
slept, wept and meant!

ps2. Your language is confusing. Let's program in Hungarian.
Our language is confusing :) It is a slut who will sleep with anyone and 
steal from everywhere, on that note it is pps etc. (post scriptum, post 
post scriptum, ad infinitum).


Sorry for going OT

-mdk

--
Mark Keating BA (Hons) | Writer, Photographer, Cat-Herder
Managing Director  | Shadowcat Systems Limited
Director/Secretary | Enlightened Perl Organisation
Marketing Chair| The Perl Foundation Marketing Committee
Marketing and PR   | TPF Steering Committee
co-Leader  | North West England Perl Mongers
Organiser  | London Perl Workshop (UKPW)
co-Organiser   | Dynamic Languages Conference
http://www.shadowcat.co.uk | http://linkedin.com/in/markkeating
http://www.enlightenedperl.org | http://www.perlfoundation.org
http://northwestengland.pm.org | http://www.flavors.me/mdk



Re: Cool/useful short examples of Perl?

2011-05-31 Thread Steve Mynott
On Mon, May 30, 2011 at 11:40:57AM +0100, Leo Lapworth typed:

 I'm working on http://learn.perl.org/ and I'd like to have a few rotating
 example of what can be done with Perl on the home page.

Examples from 

http://pleac.sourceforge.net/pleac_perl/index.html

(an opensource version of the Perl Cookbook)

-- 
Steve Mynott st...@gruntling.com


Re: Cool/useful short examples of Perl?

2011-05-31 Thread David Cantrell
On Mon, May 30, 2011 at 04:27:30PM +0100, Denny wrote:
 On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
  if (! Email::Valid-address($email_address) ) {
 Something wrong with 'unless'?

Yes.  Most of the time you'll either have an 'else' or want to add it
later, and unless ... else is Just Wrong.

-- 
David Cantrell | Reality Engineer, Ministry of Information

The Law of Daves: in any gathering of technical people, the
number of Daves will be greater than the number of women.


Re: Cool/useful short examples of Perl?

2011-05-31 Thread Mark Fowler
On Mon, May 30, 2011 at 11:40 AM, Leo Lapworth l...@cuckoo.org wrote:

 I'm working on http://learn.perl.org/ and I'd like to have a few rotating
 example of what can be done with Perl on the home page.

How about my short script to put DNS entires into /etc/hosts?

http://blog.twoshortplanks.com/2011/01/30/hostify/

Mark.


Re: Cool/useful short examples of Perl?

2011-05-31 Thread Peter Corlett
On 31 May 2011, at 15:02, David Cantrell wrote:
[...]
 Yes.  Most of the time you'll either have an 'else' or want to add it
 later, and unless ... else is Just Wrong.

Nah, just add an elsunless keyword to the language :)




Re: Cool/useful short examples of Perl?

2011-05-31 Thread Paul Makepeace
On Tue, May 31, 2011 at 15:02, David Cantrell da...@cantrell.org.uk wrote:
 On Mon, May 30, 2011 at 04:27:30PM +0100, Denny wrote:
 On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
  if (! Email::Valid-address($email_address) ) {
 Something wrong with 'unless'?

 Yes.  Most of the time you'll either have an 'else' or want to add it
 later, and unless ... else is Just Wrong.

That's the main problem with unless - once you've written your
conditional that way, it's impossible to change it.

P



Re: Cool/useful short examples of Perl?

2011-05-31 Thread David Cantrell
On Mon, May 30, 2011 at 05:47:33PM -0400, Uri Guttman wrote:

 if you think that is line noise, then your perl skills need
 improving.

I presume that you have a copy of KR?  Is your copy missing the first
few chapters?  No?  Oh, so maybe there's some value in starting with
simple examples instead of jumping straight in with things like:

   int strcmp(char *s, char *t)
   {
   for ( ; *s == *t; s++, t++)
   if (*s == '\0')
   return 0;
   return *s - *t;
   }

-- 
David Cantrell | Official London Perl Mongers Bad Influence

Cum catapultae proscriptae erunt tum soli proscript catapultas habebunt


Re: Cool/useful short examples of Perl?

2011-05-31 Thread Christopher Jones
On 31 May 2011, at 15:18, Paul Makepeace wrote:

 On Tue, May 31, 2011 at 15:02, David Cantrell da...@cantrell.org.uk wrote:
 On Mon, May 30, 2011 at 04:27:30PM +0100, Denny wrote:
 On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
 if (! Email::Valid-address($email_address) ) {
 Something wrong with 'unless'?
 
 Yes.  Most of the time you'll either have an 'else' or want to add it
 later, and unless ... else is Just Wrong.
 
 That's the main problem with unless - once you've written your
 conditional that way, it's impossible to change it.
 
 P

I see that as a feature, not a problem.


Chris





Re: Cool/useful short examples of Perl?

2011-05-31 Thread Jason Clifford
On Tue, 2011-05-31 at 15:06 +0100, Mark Fowler wrote:
 Depends if you're looking semi-technical or not.  How about my hostify
 script that puts DNS entries into /etc/hosts?
 
 http://blog.twoshortplanks.com/2011/01/30/hostify/

Am I alone in finding the code elements of that page very hard to read -
the deeper the grey gets the harder it is to read against a black
background.