kingman has asked for the wisdom of the Perl Monks concerning the following question:
I just created a module called Shortcuts.pm that looks like this:# debug mode BEGIN { use CGI::Carp qw(carpout fatalsToBrowser); &carpout (\*STDOUT); }
So now, when I create a new script, I can just do this:package Shortcuts; use strict; use diagnostics; use vars qw(@ISA @EXPORT $VERSION); use subs qw(debug); use Exporter; $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = qw(debug); sub debug { use CGI::Carp qw(carpout fatalsToBrowser); &carpout (\*STDOUT); } 1;
This is kind of a minimalist example. But I was wondering: Is this a good idea or does it create 'stylized' code that other people wouldn't want to deal with?#!/usr/bin/perl -wT use strict; use Shortcuts; # debug mode BEGIN {&debug}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is it a good idea to create custom modules?
by dragonchild (Archbishop) on Aug 09, 2001 at 18:50 UTC | |
|
Re: Is it a good idea to create custom modules?
by Masem (Monsignor) on Aug 09, 2001 at 18:52 UTC | |
|
Re: Is it a good idea to create custom modules?
by Excalibor (Pilgrim) on Aug 09, 2001 at 23:09 UTC |