develooper Front page | perl.perl5.porters | Postings from December 2007

Re: [PATCH] docs more open() and $_ related entries

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
December 26, 2007 23:34
Subject:
Re: [PATCH] docs more open() and $_ related entries
Message ID:
47735553.6000608@pobox.com
Gabor Szabo wrote:
> My point is that people learning perl or just using it not too
> frequently are constantly
> looking for copy paste examples. That is to solve problems without
> understanding the
> difference in 2 parameter and 3 parameter opens. I'd rather see them the safer
> solution and copy-paste that one, than the one that can lead to
> security problems.

I didn't realize it was a security issue.


>> Is it really necessary to initialize well-named sample scalars?  It just
>> clutters up the examples.
>>
>> +    $some_dir = "/home/foobar";
>> +    opendir(my $dh, $some_dir) || die "can't opendir $some_dir: $!";
> 
> It's well named for people with experience in such code and in reading
> perldoc. I agree.
> I am trying to change the docs to be clearer for those who have just
> started. That's
> the most difficult time.

While I'd tend to agree, $some_dir isn't particularly cryptic nor centric to a
particular operating system.


-- 
Life is like a sewer - what you get out of it depends on what you put into it.
    - Tom Lehrer

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About