develooper Front page | perl.perl5.porters | Postings from April 2010

Re: [PATCH 4/5] In perlutil.pod 'cpan', canonicalize shell prompt to $

Thread Previous | Thread Next
From:
Jari Aalto
Date:
April 10, 2010 00:58
Subject:
Re: [PATCH 4/5] In perlutil.pod 'cpan', canonicalize shell prompt to $
Message ID:
87tyrjzqms.fsf@jondo.cante.net
"H.Merijn Brand" <h.m.brand@xs4all.nl> writes:

>> -    perl -MCPAN -e shell
>> +    $ perl -MCPAN -e shell
>
> I think I like this. Do the docs have a precedence?
> What are the stats on using prompts?

The pod files aren't consisntent with the shell prompts. There are both
"%" tcsh and "$" (Linux bash), and those that don't have prompts at all.

Something like:

    grep -E -ne  '^[[:space:]]+[%$]?[[:space:]]*perl' *pod /dev/null

Majority pf the examples use "$" over "%"

>>  =item L<cpanp>

Ronald J Kimball <rjk@tamias.net> writes:
> On Fri, Apr 09, 2010 at 11:43:03AM +0200, H.Merijn Brand wrote:
> I'm a little leery of this change.
> perlrun.pod does not use any prompt character.

Well:

    ...
    perlrun.pod:489:    $ perl -pi'orig_*' -e 's/bar/baz/' fileA	# backup to 'orig_fileA'
    perlrun.pod:494:    $ perl -pi'old/*.orig' -e 's/bar/baz/' fileA # backup to 'old/fileA.orig'
    perlrun.pod:498:    $ perl -pi -e 's/bar/baz/' fileA		# overwrite current file
    perlrun.pod:499:    $ perl -pi'*' -e 's/bar/baz/' fileA		# overwrite current file
    perlrun.pod:501:    $ perl -pi'.orig' -e 's/bar/baz/' fileA	# backup to 'fileA.orig'
    perlrun.pod:502:    $ perl -pi'*.orig' -e 's/bar/baz/' fileA	# backup to 'fileA.orig'
    perlrun.pod:506:    $ perl -p -i.orig -e "s/foo/bar/; ... "
    perlrun.pod:545:    $ perl -p -i'/some/file/path/*' -e 1 file1 file2 file3...
    perlrun.pod:547:    $ perl -p -i'.orig' -e 1 file1 file2 file3...
    perlrun.pod:566:    $ perl -pi~ -e 's/foo/bar/' file1 file2 file3...

And there are plenty in

    perlcompile.pod

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Fri, Apr 9, 2010 at 19:15, Ronald J Kimball <rjk@tamias.net> wrote:
>
>> I'm a little leery of this change.
>>
>> perlrun.pod does not use any prompt character.
>
> Personally I prefer documentation that doesn't use any prompt
> characters. Then you can copy/paste it into a terminal without
> manually removing $, % or # characters from every command.

I know, but when there is both

    $ command
    <output>

In these little examples, where series of commands not need to be
copy/pasted, like in:

    $ command
    $ command
    $ command
    $ command

I think it would be good to have all pages in the line of

    $ perl <option> <scrips>

That stands out compared to:

    <perl code examples>

The "$" and "%" are already in the pages.

Jari


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