rastoboy has asked for the wisdom of the Perl Monks concerning the following question:
I'm doing some testing, and basically I'm wanting to enter a hash at the command line, like this:
And so I do this in my code:./test.pl r,2,g,2,w,1
And indeed, for the argument given above, it gives this result:#!/usr/bin/perl use Data::Dumper; my $arg = shift; my %actualhash = eval $arg; print Dumper \%actualhash;
So everything is fine and dandy, right? However, I've discovered that if I try to use a 'q' as a hash key the program yields:$VAR1 = { 'w' => 1, 'r' => 2, 'g' => 2 };
So in short--what is up with that? Hepl!./test.pl r,2,g,2,w,1,q,1 $VAR1 = {};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval doesn't like the letter 'q'?
by davido (Cardinal) on Aug 06, 2011 at 17:09 UTC | |
by rastoboy (Monk) on Aug 06, 2011 at 19:12 UTC | |
|
Re: eval doesn't like the letter 'q'?
by Corion (Patriarch) on Aug 06, 2011 at 16:54 UTC | |
by rastoboy (Monk) on Aug 06, 2011 at 17:23 UTC | |
by ikegami (Patriarch) on Aug 07, 2011 at 04:24 UTC |