the mug of Perl

J

John Bokma

ccc31807 said:
http://nostarch.com/mugperl.htm

cheat sheet is here:

http://nostarch.com/mugperl_big.htm

The cheat sheet appears to be targeted more to the casual user rather
than to the daily grind. I wondering what would appear on a cheat
sheet for journeymen Perlistas. My nomination would include the ||=
operator.

IMO ||= is used a lot in a way I wouldn't use it. On older perl I use
an explicit defined test, e.g.

defined $foo or $foo = 'bar';

on recent perl I use //=

As for what I would put on a cheat sheet:
http://johnbokma.com/perl/perl-quick-reference-card.html

Note that it's outdated, and probably incomplete. I hope to have time
soon to add the more recent stuff to it, and also add what is available
since which version of Perl.
 
J

John Bokma

Ben Morrow said:
Hmm. My reaction to lists like that is 'isn't that just all the stuff
you hold in your head?', but I guess if it isn't a cheat sheet is
useful.

I certainly don't have all that information on that cheat sheet in my
head. The reason I made it was that some of the more exotic (to me) file
test ops I couldn't recall which one did which, and some other stuff I
had to look up when needed. Originally some notes on an index card, then
I decided to type it in and print it out. And while typing it in, I
decided to make it useful to more people.

To be honest, after I made it and printed out my own version I've used
it rarely. Can't even recall where my print out is at the moment
:). One advantage of typing stuff in like this is that you learn a lot
(well, I did). I got better at Textpad after I made a similar cheat
sheet: http://johnbokma.com/textpad/quick-reference-card.html
What does 'atomic' mean wrt regex metachars?

"To avoid confusing, we'll call the thing with width an atom" p141,
Programming Perl.
 
J

Jürgen Exner

John Bokma said:
As for what I would put on a cheat sheet:
http://johnbokma.com/perl/perl-quick-reference-card.html

Note that it's outdated, and probably incomplete. I hope to have time
soon to add the more recent stuff to it, and also add what is available
since which version of Perl.

I find it very interesting where you put the emphasis on your sheet:
3 1/2 columns out of 5 deal with regular expressions, only 1 1/2 are
actually Perl itself..

What I would include/add from my perspective:
- Perl functions by name sorted by category as in perldoc perlfunc but
with argument list and return value, including indication for optional
arguments
- Perl syntax, at least for less common constructs, e.g. modifiers
- syntax (maybe by examples) for references and OO

jue
 
J

John Bokma

Jürgen Exner said:
I find it very interesting where you put the emphasis on your sheet:
3 1/2 columns out of 5 deal with regular expressions, only 1 1/2 are
actually Perl itself..

:). Note that there is more than one columm blank, and I am open to
suggestions what to put there.
What I would include/add from my perspective:
- Perl functions by name sorted by category as in perldoc perlfunc but
with argument list and return value, including indication for optional
arguments

Yes, I have been thinking about that. Or at least the Perl functions
that set as a side effect $! or similar [1]. But (!) a function can be
looked up using perldoc -f function. OTOH, Programming Perl's function
reference is sometimes more clear regarding if $! is set or not. For
example, perldoc -f chdir doesn't mention [2] that $! is set if false is
returned, while PP's entry for chdir makes this clear with a boxed $! to
the right of chdir and it has an example that shows this.

On top of that the PP documentation also shows that chdir raises and
exception if fed tainted data.
- Perl syntax, at least for less common constructs, e.g. modifiers
- syntax (maybe by examples) for references and OO

There are several Perl cheat sheets out there that cover this
information. references and OO in itself would be 2+ pages I am
afraid. Especially if you want to include modern Perl stuff (Moose,
etc.).

[1] Like Programming Perl does with the small boxes to the right of the
function name in the "Perl functions in alphabetical order" section.
[2] explicitely I mean, it can be guessed from the context, though.
 
K

Keith R. Watson

http://nostarch.com/mugperl.htm

cheat sheet is here:

http://nostarch.com/mugperl_big.htm

The cheat sheet appears to be targeted more to the casual user rather
than to the daily grind. I wondering what would appear on a cheat
sheet for journeymen Perlistas. My nomination would include the ||=
operator.

CC

This one is rather good.

Perl Reference Guide & Perl Pocket Reference
http://www.vromans.org/johan/perlref.html

At the bottom of the page is a link to the PDF version
http://www.squirrel.nl/pub/perlref-5.004.1.pdf


keith

--

Keith R. Watson Georgia Institute of Technology
Systems Support Specialist IV College of Computing
(e-mail address removed) 801 Atlantic Drive NW
(404) 385-7401 Atlanta, GA 30332-0280
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top