Front page | perl.perl5.porters |
Postings from April 2010
Re: [PATCH 3/5] In perlutil.pod 'Convertors', adjust "find2perl" example
Thread Previous
|
Thread Next
From:
Rafael Garcia-Suarez
Date:
April 9, 2010 02:47
Subject:
Re: [PATCH 3/5] In perlutil.pod 'Convertors', adjust "find2perl" example
Message ID:
x2hb77c1dce1004090247t1e71a303t6f7706ea4d135b65@mail.gmail.com
No. This is an example of code generated by find2perl; the code in the
manpage should look like what the user would get by running find2perl.
On 9 April 2010 11:05, <jari.aalto@cante.net> wrote:
> From: Jari Aalto <jari.aalto@cante.net>
>
> Add newline between chunks of code. Add space after each comma. Use
> operator 'and' instead of '&&'. Use lstat() without parens in simple a
> context.
>
> Signed-off-by: Jari Aalto <jari.aalto@cante.net>
> ---
> pod/perlutil.pod | 12 +++++++-----
> 1 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/pod/perlutil.pod b/pod/perlutil.pod
> index 2fc0022..14e412b 100644
> --- a/pod/perlutil.pod
> +++ b/pod/perlutil.pod
> @@ -115,11 +115,13 @@ C<find2perl . -user root -perm 4000 -print> produces the following callback
> subroutine for C<File::Find>:
>
> sub wanted {
> - my ($dev,$ino,$mode,$nlink,$uid,$gid);
> - (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
> - $uid == $uid{'root'}) &&
> - (($mode & 0777) == 04000);
> - print("$name\n");
> + my ($dev, $ino, $mode, $nlink, $uid, $gid);
> +
> + ($dev, $ino, $mode, $nlink, $uid, $gid) = lstat $_ and
> + $uid == $uid{root} and
> + ($mode & 0777) == 04000;
> +
> + print $name, "\n";
> }
>
> =back
> --
> 1.7.0
>
>
--
"You don't mean odds and ends, you mean des curieux et des bouts",
corrected the manager.
-- Terry Pratchett, Hogfather
Thread Previous
|
Thread Next