| Meta documentation | Contained in the Meta distribution. |
Meta::Tool::Less - run the less pager for you.
Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
MANIFEST: Less.pm PROJECT: meta VERSION: 0.05
package foo; use Meta::Tool::Less qw(); my($object)=Meta::Tool::Less->new(); my($result)=$object->method();
When you want to show something using the less pager don't do it yourself - give this module the job.
BEGIN() show_file($) show_data($) TEST($)
Bootstrap method to find the path to your less executable.
This method will show a file using the less pager.
Pass this method some data and it will show it using the less pager.
Test suite for this module.
None.
None.
Name: Mark Veltzer Email: mailto:veltzer@cpan.org WWW: http://www.veltzer.org CPAN id: VELTZER
0.00 MV import tests 0.01 MV more thumbnail issues 0.02 MV website construction 0.03 MV web site automation 0.04 MV SEE ALSO section fix 0.05 MV md5 issues
Meta::Utils::File::File(3), Meta::Utils::File::Patho(3), Meta::Utils::File::Remove(3), Meta::Utils::System(3), Meta::Utils::Utils(3), strict(3)
-is there a way (using some CPAN module?) to feed the string to the less pager without writing it first into a file ?
| Meta documentation | Contained in the Meta distribution. |
#!/bin/echo This is a perl module and should not be run package Meta::Tool::Less; use strict qw(vars refs subs); use Meta::Utils::Utils qw(); use Meta::Utils::File::File qw(); use Meta::Utils::System qw(); use Meta::Utils::File::Remove qw(); use Meta::Utils::File::Patho qw(); our($VERSION,@ISA); $VERSION="0.05"; @ISA=qw(); #sub BEGIN(); #sub show_file($); #sub show_data($); #sub TEST($); #__DATA__ our($tool_path); sub BEGIN() { my($patho)=Meta::Utils::File::Patho->new_path(); $tool_path=$patho->resolve("less"); } sub show_file($) { my($file)=@_; Meta::Utils::System::system($tool_path,["-csi",$file]); } sub show_data($) { my($data)=@_; my($name)=Meta::Utils::Utils::get_temp_file(); Meta::Utils::File::File::save($name,$data); &show_file($name); Meta::Utils::File::Remove::rm($name); } sub TEST($) { my($context)=@_; return(1); } 1; __END__