tobold.org

correct • elegant • free

△ comp.lang.perl △

◅ GDBM, Solaris, and flock/fcntl

How to call one PERL script from another ▻

Trouble writning an array to a text/database file

In article <50a1ou$6m9@news.uni-c.dk>, Thomas <zach@inet.uni-c.dk> wrote:
>print DBASE "@write";

An array inside double quotes is interpolated with the value of $"
between each element, so what you have here is equivalent to this.

    print DBASE join($", @write);

>There keeps coming spaces in front of each entry,

By default, $" == ' ', so yes, you will get a space between each element
of @write.

The solution is simple, just hand @write directly to print.

    print DBASE @write;

Tim.
--
Tim Goodwin   | "USENET, of course, is a pure and unadultered source
Cambridge, UK | of truth and wisdom." -- Richard Kettlewell

Original headers:

From: tim@pipex.net (Tim Goodwin)
Newsgroups: comp.lang.perl.misc
Subject: Re: Trouble writning an array to a text/database file
Date: 5 Sep 1996 11:22:54 GMT
Organization: UUNET PIPEX
Message-ID: <50md6e$1g3@wave.news.pipex.net>
References: <50a1ou$6m9@news.uni-c.dk>

△ comp.lang.perl △

◅ GDBM, Solaris, and flock/fcntl

How to call one PERL script from another ▻