shawnhcorey
- About: Master Programmer, Perl Guru, & Avid Gamer
Recent Actions
-
Commented on Please provide an abstract for posts to blogs.perl.org
I hear you. http://blogs.perl.org/users/shawnhcorey/2012/09/how-to-post-an-article-on-blogsperlorg.html...
-
Posted A Look at Cartesian Products to shawnhcorey
A new post in my blog about Cartesian products.
Problem: You have a number of sets and you want all the combinations when choosing one element from each set.
In mathematics, these…
-
Posted A Look at Recursion to shawnhcorey
I created a blog about Perl over on Blogger and I have just posted an new article on recursion.
-
Commented on C Programming: What is the difference between an array and a pointer?
Yes, pointers in C will drive you batty. Perl's references are much easier to understand....
-
Commented on Algebra of Grammars?
"'putting F first means I never gets a chance to parse anything' has more to do with algebra of parser combinators that is defined in terms of parse results rather than parseable sets." Yes but why build a parser if...
-
Commented on Algebra of Grammars?
Note that: I ⊂ F I <+> F can parse I or F but it is not commutative. F <+> I = F Since F can parse everything I can, so putting F first means I never gets a chance...
-
Commented on ----perl--hello
It worked! ;)...
-
Commented on The comma operator
consistency = predictability inconsistency = gotchas...
-
Commented on Subroutine Signatures - my Plan (v.1)
I did something similar in my Sub::Starter module; only I called them usage statements. Sub::Starter is a filter that converts usage statements into sub skeletons. It is easier to write a usage statement than a consistent sub & its documentation....
-
Commented on The comma operator
$ perl -E'$a = () = (6, 1, 1, 1, 7); say $a;' 5 $ perl -E'@a = () = (6, 1, 1, 1, 7); say @a;' $ Why? In the first one, the array is kept. In the second,...
-
Commented on How to Post an Article on blogs.perl.org
After you sign in, at the top, the menu should end with "...| Edit Profile | Post | Sign out". Click on the Post....
-
Commented on How to Post an Article on blogs.perl.org
I didn't design this so redirect any complaints to Movable Type. The reason why you'd want to keep the BODY section small is so people don't have to scroll over a long article if they don't want to read it....
-
Posted How to Post an Article on blogs.perl.org to shawnhcorey
When creating an article for blogs.perl.org, place only one or two paragraphs in the BODY section. This is the lead (pronounced "leed") to the article. Place the bulk of the article in the EXTENDED section.
-
Commented on A Look At Braces
No, in #4, the expression in the braces evaluates to a reference. In string interpolation, the contents are placed in the string. If the contents is a reference, then a weird value appears in the string, like, "SCALAR(0x1f39838)". You're correct;...
-
Commented on A Look At Braces
You could be correct. The `perldoc -f print` doesn't list the BLOCK as a possibility, so I overlooked it....
-
Posted A Look At Braces to shawnhcorey
In a comment of an article here at blogs.perl.org, Going to Perl School, I mentioned that Perl has 9 uses for braces. Here they are:
-
Commented on Is this a place where I can get some technical input?
I'm not familiar with IIS but when this happens in Apache, it's because Apache isn't configured to run CGIs. I think this is a IIS configuration problem....
-
Commented on How many ways can I use thee, module?
How about reading the module into a variable and then eval it? And then run `Module->import();`...
-
Commented on Going to Perl School
I'm not surprise at your problems. Perl only makes sense when you have the right frame of mind. For example, did you know Perl has over 9 uses for the braces, "{}"? Learning and then keeping these uses distinct is...
-
Commented on DIY personal analytics
$ alias g alias g='history|grep' $ List history and grep out commands. For example, to list all commands with "perl": $ g perl...
-
Commented on utf8::all and autodie now coexist peacefully
Yay! About time....
-
Commented on When Perl is not applicable
"This allowed me to change the algorithm and remove all the unnecessary kind-of-repeated SQL selections with changing where conditions." Obviously, the fault was not in Perl....
-
Commented on Extensible Maintainable Subroutines and Methods
if( ! defined $paramsRef || ref( $paramsRef ) ne 'HASH' ){ croak( sprintf( "sub %s in file %s at %s: invalid parameter hash\n", __SUB__, __FILE__, __LINE__ )); } If you're going to validate the parameters, throw an exception....
-
Commented on Windows Sucks, Right? It does doesn't it?
The reason Windows runs in root is so that Microsoft can inspect your machine and delete any unauthorized copies of its programs. Windows will never be secure....
-
Commented on Hello, world.
Welcome to Perl. Here are some links you might find useful: official site beginners' help advance help documentation news repository blog regional groups...
-
Posted Useful CPAN Modules to shawnhcorey
I have recently installed perl-5.16.0 using perlbrew and have begun adding CPAN modules. Here is some of them that I find most useful.…
-
Commented on A Look At Arrays
@Brad: I never said they were. I said a linked list can be implemented using only an array. You got them the wrong way around....
-
Commented on duct tape
Actually, the saying is attributed to Hassan Schroeder, Sun's first webmaster....
- Posted A Look At Arrays to shawnhcorey
-
Commented on The Price of Cleverness (YAML is not Safe)
Don't be clever; being great is good enough. ;)...
Comment Threads
-
mauke commented on
C Programming: What is the difference between an array and a pointer?
Note that there's an interesting parallel between C and Perl when it comes to arrays.
Neither C nor Perl have array values (that is, values that represent arrays). When you evaluate an array in C, you get a pointer to its first element. When you evaluate an array in Perl, you get a count (in scalar context) or a list of elements (in list context).
Both languages let you avoid this "decay" by taking the address of (&, C) or a reference to (\, Perl) the array.
-
Olivier Mengué (dolmen) commented on
C Programming: What is the difference between an array and a pointer?
You should put more emphasis on
sizeoffor pointers: the pointer has no idea of how many elements it points to.int array[5]; int *ptr = array; printf("%zd\n", sizeof(array)); // 5*sizeof(int) printf("%zd\n", sizeof(ptr)); // sizeof(int*) printf("%zd\n", sizeof(*ptr)); // sizeof(int) -
mauke commented on
C Programming: What is the difference between an array and a pointer?
Well, that's because (with the exception of VLAs in C99)
sizeofis purely a compile time operation. It only looks at the types:sizeof EXPR == sizeof (typeof(EXPR))(if we pretend C hadtypeoffor a moment). -
http://petdance.com/openid/ commented on
Please provide an abstract for posts to blogs.perl.org
I suggest that even more important than the abstract is the title of the post. Many people don't read blogs.perl.org through the website, but through an RSS reader or some other feed source that shows only the title. It should describe something about what is in the article.
-
Neil Bowers commented on
Please provide an abstract for posts to blogs.perl.org
Good point. I usually read the first paragraph, given the habit of writers to try and catch your eye with the title. I fixed this post though :-)
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.