SPUG: printing reports

Colin Meyer cmeyer at helvella.org
Fri Feb 8 14:27:06 CST 2002


Hi Walter,

On Fri, Feb 08, 2002 at 12:53:03PM -0700, North, Walter wrote:
> 
> I use the following to define the format for each data file.
> 
> Use IO::Handle;
> open PRTFILE, ">>$PRTFILE" or die "blah blah\n";
> If ($TYPE eq "A") {
> PRTFILE->format_name("APRTFILE");
> PRTFILE->format_top_name("APRTFILE_TOP");

...

In order to be able to use the method calls from IO::File, you need to 
use an IO::File object instead of the traditional Perl FILEHANDLE.

Try something like:

  use IO::Handle;
  my $prtfile = IO::File->new; # creating the IO::File object
  $prtfile->open(">>$PRTFILE") or die "...";
  $prtfile->format_name("...");
  # ...

You may want to read the IO::Handle and IO::File perldoc pages for more
info.

Have fun,
-C.


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list