Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text::Tabs docs too slanted toward the "In Club" #7360

Closed
p5pRT opened this issue Jun 12, 2004 · 6 comments
Closed

Text::Tabs docs too slanted toward the "In Club" #7360

p5pRT opened this issue Jun 12, 2004 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 12, 2004

Migrated from rt.perl.org#30229 (status was 'resolved')

Searchable as RT30229$

@p5pRT
Copy link
Author

p5pRT commented Jun 12, 2004

From @jidanni

Comments on Text​::Tabs man page​:
  $tabstop = 4;
Say perhaps instead
  $tabstop = 4; #default = 8

  Text​::Tabs does about what the unix utilities expand(1) and
  unexpand(1) do.

Not exactly. It seems unexpand does what GNU's unexpand -a does, which
in fact is nice.

  expand doesn't handle newlines very quickly -- do not feed it an entire document in
  one string. Instead feed it an array of lines.

I'd add a simpler example too, indeed, one can use
print unexpand $_;
which I discovered works too, and should be there on the man page, no?

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2004

From @petdance

Let's make a big in unexpand while we're at it.

  $lastbit = "\t"
  if $lastbit eq " "x$tabstop;

This line is run once per line. The C<$lastbit eq " "x$tabstop> can get
computed outside the loop, once per call to C<unexpand>.

And, we can change the format of the version number in Text​::Tabs to
match that of Text​::Wrap.

@p5pRT
Copy link
Author

p5pRT commented Jun 25, 2004

@petdance - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 5, 2006

From @muir

On Tue Jun 22 23​:08​:26 2004, petdance wrote​:

Let's make a big in unexpand while we're at it.

$lastbit = "\\t"
    if $lastbit eq " "x$tabstop;

This line is run once per line. The C<$lastbit eq " "x$tabstop> can get
computed outside the loop, once per call to C<unexpand>.

And, we can change the format of the version number in Text​::Tabs to
match that of Text​::Wrap.

Done. (In the about-to-be released version).

-Dave

@p5pRT
Copy link
Author

p5pRT commented Jul 5, 2006

From @muir

On Fri Jun 11 21​:41​:42 2004, jidanni@​jidanni.org wrote​:

Comments on Text​::Tabs man page​:
$tabstop = 4;
Say perhaps instead
$tabstop = 4; #default = 8

   Text&#8203;::Tabs does about what the unix utilities expand\(1\) and
   unexpand\(1\) do\.

Not exactly. It seems unexpand does what GNU's unexpand -a does, which
in fact is nice.

   expand doesn't handle newlines very quickly \-\- do not feed it

an entire document in
one string. Instead feed it an array of lines.

I'd add a simpler example too, indeed, one can use
print unexpand $_;
which I discovered works too, and should be there on the man page, no?

I'm about roll a new release. This is what I've got now​:

=head1 NAME

Text​::Tabs -- expand and unexpand tabs per the unix expand(1) and
unexpand(1)

=head1 SYNOPSIS
 
  use Text​::Tabs;

  $tabstop = 4; # default = 8
  @​lines_without_tabs = expand(@​lines_with_tabs);
  @​lines_with_tabs = unexpand(@​lines_without_tabs);
 
=head1 DESCRIPTION
 
Text​::Tabs does about what the unix utilities expand(1) and unexpand(1)
do. Given a line with tabs in it, expand will replace the tabs with
the appropriate number of spaces. Given a line with or without tabs in
it, unexpand will add tabs when it can save bytes by doing so (just
like C<unexpand -a>). Invisible compression with plain ASCII!
 
=head1 EXAMPLE
 
  #!perl
  # unexpand -a
  use Text​::Tabs;

  while (<>) {
  print unexpand $_;
  }
 
Instead of the C<expand> comand, use​:
 
  perl -MText​::Tabs -n -e 'print expand $_'
 
Instead of the C<unexpand -a> command, use​:
 
  perl -MText​::Tabs -n -e 'print unexpand $_'

=head1 BUGS

expand doesn't handle newlines very quickly -- do not feed it an
entire document in one string. Instead feed it an array of lines.

=head1 LICENSE
 
Copyright (C) 1996-2002,2005,2006 David Muir Sharnoff.
Copyright (C) 2005 Aristotle Pagaltzis
This module may be modified, used, copied, and redistributed at your own
risk.
Publicly redistributed modified versions must use a different name.

@p5pRT
Copy link
Author

p5pRT commented May 31, 2008

p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant