[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] setting in MacPerl IDE to redirect output?




On Wed, 1 Dec 1999, Chris Nandor wrote:

> At 10.48 -0500 1999.12.01, Ronald J Kimball wrote:
> >On Wed, Dec 01, 1999 at 03:37:51AM -0600, Matthew Langford wrote:
> >
> >>     open STDOUT, "> $file->sfFile()" or die "File redirect failed: $!";
> >
> >Perl doesn't do method calls in a double quoted string.
> 
> To complete that thought, that would mean the filename would be
> something like:
> 
>     StandardFileReply=SCALAR(0x5b0c330)->sfFile()
> 
> ... which is 45 characters long.  A smaller class name, like "foo", would
> "work", though improperly.  :)


Thanks, all!  Replacing the offending line with

    $fh = $file->sfFile();
    open STDOUT, "> $fh" or die "File redirect failed: $!";

worked.  This was fun to play with.

Next questions...

I have the full path to the input file in $0.  In my General Controls
control panel, I allow the application to determine the directory for
StdFileDlgs.  How do I arrange it so MacPerl starts in $0's directory in
the StandardPutFile?

Completely different Q:  Mac::Redirect redirects simply by using it.  If I
wrote a wrapper, I would do the same thing, except I might want to
redirect several times and use a different default string.  In other
words, I would want to add some subs to my package with these features,
and _not_ run the main stuff.  Is this possible?

--
MattLangford 


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org