On 10-05-20 03:17 PM, Uri Guttman wrote:
"SHC" == Shawn H Corey<shawnhco...@gmail.com> writes:
SHC> On 10-05-20 02:07 PM, Uri Guttman wrote:
>> not a major point, but why do you use dumper just to print a list of
>> tokens? i use dumper for deeper stuff where i can't just print the data
>> easily without some code. even single level hashes i will print directly
>> as i can format it my way and not dumper's.
SHC> I have a script called template.pl:
SHC> use Data::Dumper;
SHC> Whenever I need to do a quick script, I copy it and modify it. Dumper
SHC> is already there.
but few people use templates like that (emacs supports it as do other
editors). my point is that dumper is overkill for simple dumps of
values. you don't use it to print scalars? arrays aren't much more and
map works well. and as i said, you can control the output much better
with map than dumper. this is not against dumper which i use all the
time, just to point out to others that using it for simple prints is not
always needed.
uri
I don't use it for the final output at all. I use it to see what's
inside a variable. As I said, this is a quick script. Since the code
comes cheap (it's copied), I use what's there.
And in this case, it's up to the OP to format the final output. Or not,
since the output may only be used internally in a larger program.
BTW, I don't have my editor set up for templates; I just copy the file
on the command line.
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/