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 t
instead of showing random perl examples on learn.perl why not highlight
the good docs that already exist. the other day someone asked on irc
about some ref stuff and i pointed them to perlreftut. the tutes are
full of useful stuff but they aren't read by newbies (i know that from
many times tellin
On Tue, May 31, 2011 at 2:23 AM, Paul Makepeace wrote:
> On Mon, May 30, 2011 at 23:20, lesleyb wrote:
>> I had previous programming experience when I started learning Perl
>> and I was quickly introduced to the 'unless' construct. I confess
>> to finding it both cute and entirely obvious.
>
> Y
On Mon, May 30, 2011 at 7:45 PM, Damian Conway wrote:
> I'll happily concede that this example isn't nearly as impressive as
> some of the others in this thread, but its real-world, useful,
> conveniently incremental, requires no modules, and ably
> demonstrates the value of many core features of
On 27 May 2011 02:58, David Cantrell wrote:
> On Thu, May 26, 2011 at 05:25:01PM +0100, Simon Wistow wrote:
>
>> Unless things have changed dramatically ActiveMQ has many, many features
>> pretty much all poorly documented in the typical ASF/Java project
>> fashion (i.e a poorly maintained wiki re
On Mon, May 30, 2011 at 07:46:08PM -0400, Uri Guttman wrote:
> > "NC" == Nicholas Clark writes:
>
>
> NC> You've stated that you *don't* expect newbies to know how to read
> NC> that line. Leo is currently looking for things that newbies could
> NC> be expected to read.
>
> then you
Uri wrote:
> ever taken a class with damian? he doesn't pussy foot around with
> kiddie code. that line is just like stuff he trains with
No it isn't. Not in my beginners classes, nor in PBP. When I'm teaching
newcomers to Perl, I focus my examples entirely on readability and
maintainability.
Fo
> "NC" == Nicholas Clark writes:
NC> You've stated that you *don't* expect newbies to know how to read
NC> that line. Leo is currently looking for things that newbies could
NC> be expected to read.
then you will get one liners that don't do much. you can't have it both
ways. either t
On Mon, May 30, 2011 at 11:40, Leo Lapworth 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.
I think this is great,
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
An installer that installs
On Mon, May 30, 2011 at 23:20, lesleyb wrote:
> I had previous programming experience when I started learning Perl
> and I was quickly introduced to the 'unless' construct. I confess
> to finding it both cute and entirely obvious.
Yeah, seriously. You know, if someone can understand a regular
ex
On Mon, May 30, 2011 at 04:40:26PM -0500, Avleen Vig wrote:
> On Mon, May 30, 2011 at 1:35 PM, Jason Clifford wrote:
> > On Mon, 2011-05-30 at 16:27 +0100, Denny wrote:
> >> > if (! Email::Valid->address($email_address) ) {
> >>
> >> Something wrong with 'unless'?
> >
> > No but lots of people
On Mon, 2011-05-30 at 17:47 -0400, Uri Guttman wrote:
> my %conf = read_file( $file_name ) =~ /^(\w+)=(.*)$/mg ;
>
> that is an assigment to hash, scalar context call on read_file and a
> regex getting out key=val lines. all stuff newbies need to know and must
> learn. it happens to use them all
t
is simple to see what they do.
http://london.pm.org/pipermail/london.pm/Week-of-Mon-20110530/020713.html
You've stated that you *don't* expect newbies to know how to read that line.
Leo is currently looking for things that newbies could be expected to read.
Nicholas Clark
> "DH" == Dave Hodgkinson writes:
DH> On 30 May 2011, at 22:47, Uri Guttman wrote:
>>> "DH" == Dave Hodgkinson writes:
>>
DH> And MAINTAINABLE.
>>
DH> Not everyone speaks line noise.
>>
>> if you think that is line noise, then your perl skills need
>> improving.
On Mon, May 30, 2011 at 4:47 PM, Uri Guttman wrote:
> if you think that is line noise, then your perl skills need
> improving. seriously i have taught the slurp line to total beginners and
> they get it afterwards. this is for learn.perl.org, not golf.
>
> my %conf = read_file( $file_name ) =~ /^
On 30 May 2011, at 22:47, Uri Guttman wrote:
>> "DH" == Dave Hodgkinson writes:
>
> DH> And MAINTAINABLE.
>
> DH> Not everyone speaks line noise.
>
> if you think that is line noise, then your perl skills need
> improving.
And this is EXACTLY the problem. If this is perl, then we've l
On Mon, May 30, 2011 at 3:02 PM, Uri Guttman wrote:
>> "D" == Denny <2...@denny.me> writes:
> you need to challenge them a bit with new stuff instead of
> handing them simple code anyone can do.
It depends entirely.
If we're teaching things to people who already know some perl, then
sure you
> "DH" == Dave Hodgkinson writes:
DH> 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 cod
On Mon, May 30, 2011 at 1:35 PM, Jason Clifford wrote:
> On Mon, 2011-05-30 at 16:27 +0100, Denny wrote:
>> > if (! Email::Valid->address($email_address) ) {
>>
>> Something wrong with 'unless'?
>
> No but lots of people appear to find "if" to be more readable
>
> If you're not worried about r
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 MAINTA
> "DH" == Dave Hodgkinson writes:
DH> On 30 May 2011, at 21:02, Uri Guttman wrote:
DH> you need to challenge them a bit with new stuff instead of
>> handing them simple code anyone can do.
DH> No. Real people want to solve real world problems in a simple,
DH> maintainable way,
On 30 May 2011, at 21:02, Uri Guttman wrote:
>> "D" == Denny <2...@denny.me> writes:
>
> D> On Mon, 2011-05-30 at 13:10 -0400, Uri Guttman wrote:
>>> if you think those are complex, you haven't seen enough perl! :)
>
> D> I'm trying to think about the target audience, rather than show ho
On 30 May 2011, at 21:02, Uri Guttman wrote:
you need to challenge them a bit with new stuff instead of
> handing them simple code anyone can do.
No. Real people want to solve real world problems in a simple, maintainable
way, not wave around a canapé sized penis.
Another example you can add maybe after some further tweaking:
#!/usr/bin/env perl
use Dancer;
get '/' => sub {
"Hello World!"
};
dance;
$ perl bin/app.pl &
...
$ curl http://localhost:3000/
Hello world!
>From http://perldancer
> "D" == Denny <2...@denny.me> writes:
D> On Mon, 2011-05-30 at 13:10 -0400, Uri Guttman wrote:
>> if you think those are complex, you haven't seen enough perl! :)
D> I'm trying to think about the target audience, rather than show how
D> clever I am.
that isn't clever in my book. th
> "PN" == Philip Newton writes:
PN> On Mon, May 30, 2011 at 17:59, Uri Guttman wrote:
>>
>> # Here is a simple and fast way to load and save a simple config file
>> # made of key=value lines.
>>
>> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
>> write_file( $fi
On 30 May 2011, at 19:47, Philip Newton wrote:
> On Mon, May 30, 2011 at 17:59, Uri Guttman wrote:
>>
>> # Here is a simple and fast way to load and save a simple config file
>> # made of key=value lines.
>>
>> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
>> write_file( $file_na
On Mon, 2011-05-30 at 19:35 +0100, Jason Clifford wrote:
> On Mon, 2011-05-30 at 16:27 +0100, Denny wrote:
> > > if (! Email::Valid->address($email_address) ) {
> >
> > Something wrong with 'unless'?
>
> No but lots of people appear to find "if" to be more readable
It's not a choice between
On Mon, May 30, 2011 at 17:59, Uri Guttman wrote:
>
> # Here is a simple and fast way to load and save a simple config file
> # made of key=value lines.
>
> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
> write_file( $file_name, {atomic => 1}, map "$_=$conf{$_}\n", keys %conf ;
I wo
On Mon, 2011-05-30 at 16:27 +0100, Denny wrote:
> > if (! Email::Valid->address($email_address) ) {
>
> Something wrong with 'unless'?
No but lots of people appear to find "if" to be more readable
If you're not worried about readability then why bother with either the
if or unless. Just do:
On Mon, May 30, 2011 at 14:12, Gabor Szabo wrote:
> use Spreadsheet::Read;
>
> my $ref = ReadData ("test.xls");
> say $ref->[1]{A3};
>
> http://search.cpan.org/dist/Spreadsheet-Read/Read.pm
Cool module. If you do include it, s/ref/workbook/
Paul (who is puzzled by this name-your-var-with-only-it
On Mon, 2011-05-30 at 13:10 -0400, Uri Guttman wrote:
> if you think those are complex, you haven't seen enough perl! :)
I'm trying to think about the target audience, rather than show how
clever I am.
signature.asc
Description: This is a digitally signed message part
> "D" == Denny <2...@denny.me> writes:
D> On Mon, 2011-05-30 at 11:59 -0400, Uri Guttman wrote:
>> from the File::Slurp synopsis. can't get much cooler, short or useful
>> than this. :)
>> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
>> write_file( $file_name, {atomic =
On Mon, 2011-05-30 at 17:30 +0100, David Precious wrote:
> On Monday 30 May 2011 16:27:30 Denny wrote:
> > On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
> > > if (! Email::Valid->address($email_address) ) {
> >
> > Something wrong with 'unless'?
>
> we're talking bits of code for p
On 30 May 2011, at 16:59, Uri Guttman wrote:
>
> from the File::Slurp synopsis. can't get much cooler, short or useful
> than this. :)
>
>
> # Here is a simple and fast way to load and save a simple config file
> # made of key=value lines.
>
> my %conf = read_file( $file_name ) =~ /^(\w+)=(\
On 30 May 2011, at 16:27, Denny wrote:
> On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
>>if (! Email::Valid->address($email_address) ) {
>
> Something wrong with 'unless'?
>
Ask Damian.
I also agree, it's a speedbump for my reading. KISS etc.
Config::Tiny fits the bill nicely.
On Mon, May 30, 2011 at 5:13 PM, Denny <2...@denny.me> wrote:
> On Mon, 2011-05-30 at 11:59 -0400, Uri Guttman wrote:
>> from the File::Slurp synopsis. can't get much cooler, short or useful
>> than this. :)
>> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*
On Monday 30 May 2011 16:27:30 Denny wrote:
> On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
> > if (! Email::Valid->address($email_address) ) {
>
> Something wrong with 'unless'?
Depends whether you follow Damian Conway's PBP strictly :)
At $work, we mostly do follow PBP, but with
On Mon, 2011-05-30 at 11:59 -0400, Uri Guttman wrote:
> from the File::Slurp synopsis. can't get much cooler, short or useful
> than this. :)
> my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
> write_file( $file_name, {atomic => 1}, map "$_=$conf{$_}\n", keys %conf ;
It's kind of hor
from the File::Slurp synopsis. can't get much cooler, short or useful
than this. :)
# Here is a simple and fast way to load and save a simple config file
# made of key=value lines.
my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ;
write_file( $file_name, {atomic => 1}, map "$_=$conf
Something I use quite a lot when skimming through log files:
perl -le 'print scalar localtime shift'
Ok, probably less than you were looking for...
Cheers,
Pedro
On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
> if (! Email::Valid->address($email_address) ) {
Something wrong with 'unless'?
signature.asc
Description: This is a digitally signed message part
On Mon, May 30, 2011 at 03:36:54PM +0100, David Precious wrote:
> On Monday 30 May 2011 14:27:25 'lesleyb' wrote:
> > I am a little fearful people will substitute variables on the
> > RHS in a CGI script without untainting first and then complain
> > when the problems show up.
>
> Whilst I agree
On 30 May 2011, at 11:40, Leo Lapworth wrote:
> Hi,
>
> 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.
Like this concept. Some idioms based around some of the major modules would be
nice.
Especially, bit not l
On Monday 30 May 2011 14:27:25 'lesleyb' wrote:
> I am a little fearful people will substitute variables on the
> RHS in a CGI script without untainting first and then complain
> when the problems show up.
Whilst I agree helping people learn about taint mode and how to untaint is
valuable, I'm
On Mon, May 30, 2011 at 11:40:57AM +0100, Leo Lapworth wrote:
> Hi,
>
> 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.
>
> The first two I've thought of are below, does anyone have others?
>
> They don't have to
I like this very much:
use Spreadsheet::Read;
my $ref = ReadData ("test.xls");
say $ref->[1]{A3};
http://search.cpan.org/dist/Spreadsheet-Read/Read.pm
Gabor
On Monday 30 May 2011 11:40:57 Leo Lapworth wrote:
> Hi,
>
> 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.
>
> The first two I've thought of are below, does anyone have others?
>
> They don't have to use CPAN m
Hi Braudel,
On 30 May 2011 12:14, B Maqueira wrote:
> I have an example on my blog of a script to build sitemaps using TT &
> Mechanize (http://codelab.ferrarihaines.com/archives/135). Feel free to
> use it if it suits your purpose...
Thanks - it's a too long for what I'm after, I guess putting
Hi Leo,
I have an example on my blog of a script to build sitemaps using TT &
Mechanize (http://codelab.ferrarihaines.com/archives/135). Feel free to
use it if it suits your purpose...
Cheers...
Braudel
> Hi,
>
> I'm working on http://learn.perl.org/ and I'd like to have a few rotating
> exampl
Hi,
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.
The first two I've thought of are below, does anyone have others?
They don't have to use CPAN modules, one liners are fine as long as it
is simple to see what the
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:
> h
52 matches
Mail list logo