SPUG:command line switches: the DWIMmyness that is Perl

Michael R. Wolf MichaelRunningWolf at att.net
Mon Jan 20 03:07:59 CST 2003

m3047 at inwa.net (Fred Morris) writes:

> Hi all,
> I use Perl for all sorts of complicated things, but I confess to never
> having played with the command line switches until tonight. I wanted
> something which would expand tabs into spaces, but I wanted to be able to
> specify the tab stop: sometimes it's 4, sometimes it's 8... anybody else
> find themselves in the same predicament?
> So I tried a BEGIN block, and it worked! That's cool!

Did you take a look at this module?

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

    use Text::Tabs; 

    $tabstop = 4;
    @lines_without_tabs = expand(@lines_with_tabs);
    @lines_with_tabs = unexpand(@lines_without_tabs);

Michael R. Wolf
    All mammals learn by playing!
        MichaelRunningWolf at att.net

More information about the spug-list mailing list