Works perfectly for me... ActiveState 5.6.1 on NT4
#!C:/Activeperl/bin/perl.exe
use strict;
use warnings;
my ($name, $address, $city, $state, $zip);
format ADDRESSLABEL =
===
| @<<<<<<<<<<<<<<<<<<<<<<<<<< |
$name
| @<<<<<<<<<<<<<<<<<<<<<<<<<< |
$address
| @<<<<<<<<<<<<<<<<, @< @<<<< |
$city, $state, $zip
===
.
open(ADDRESSLABEL,">addresses.txt") or die("ack: $!");
while () {
chomp;
($name, $address, $city, $state, $zip) = split(/;/);
select (ADDRESSLABEL);
write (ADDRESSLABEL);
}
__DATA__
David R. Wagner;4485 Long Green Dr;San Francisco;CA;994058
F:\>formtest.pl
F:\>cat addresses.txt
===
| David R. Wagner |
| 4485 Long Green Dr |
| San Francisco, CA 99405 |
===
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
> -Original Message-
> From: Eric Edwards [SMTP:[EMAIL PROTECTED]
> Sent: Friday, March 12, 2004 7:52 AM
> To: Anderson, Mark (Service Delivery);
> [EMAIL PROTECTED]
> Subject: Re: write to a file
>
> *** WARNING : This message originates from the Internet ***
>
> From: "Anderson, Mark
>
> > Hi,
> >
> > you need to
> > select(ADDRESSLABEL);
> > before you
> > write(ADDRESSLABEL);
> >
> > Tested!
> Mark,
> It doesn't like that.
> Eric
> >
> > Kind regards,
> >
> > Mark Anderson
> > SMS Deployment
> > The Royal Bank of Scotland
> > 113 Dundas Street, Edinburgh, EH3 5DE
> > http://www.manufacturing.rbs.co.uk/GTrswi/
> >
> >
> > > -Original Message-
> > > From: Eric Edwards [SMTP:[EMAIL PROTECTED]
> > > Sent: Thursday, March 11, 2004 11:55 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: re:write to a file
> > >
> > > *** WARNING : This message originates from the Internet ***
> > >
> > > Hey list,
> > > This program will print the input but will not write the format to the
> > > output file. Any ideas as to the error of my ways? Its
> > > probably real obvious.
> > > Thanks in advance.
> > > Eric
> > > #!/usr/bin/perl
> > > use strict;
> > > use warnings;
> > > my ($name, $address, $city, $state, $zip);
> > > format ADDRESSLABEL =
> > > ===
> > > | @<<<<<<<<<<<<<<<<<<<<<<<<<< |
> > > $name
> > > | @<<<<<<<<<<<<<<<<<<<<<<<<<< |
> > > $address
> > > | @<<<<<<<<<<<<<<<<, @< @<<<< |
> > > $city, $state, $zip
> > > ===
> > > .
> > > open(ADDRESSLABEL, ">c:\\perl_prgm\\labels-to-print") or
> > >die "can't create";
> > > open(ADDRESSES, "c:\\perl_prgm\\addresses.txt") or
> > >die "cannot open addresses";
> > > while () {
> > >chomp;
> > >($name, $address, $city, $state, $zip) = split(/:/);
> > > write (ADDRESSLABEL);
> > > }
> > >
> > > ___
> > > Perl-Win32-Users mailing list
> > > [EMAIL PROTECTED]
> > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> >
> >
> > The Royal Bank of Scotland plc, Registered in Scotland No. 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
> >
> > The Royal Bank of Scotland plc is authorised and regulated by the
> Financial Services Authority and represents The Royal Bank of Scotland
> Marketing Group. The Bank sells life policies, collective investment
> schemes
> and pension products and advises only on the Marketing Group's range of
> these products and on a With-Profit Bond produced by Norwich Union Life
> (RBS) Limited.
> >
> > This e-mail message is confidential and for use by the addressee only.
> If
> the message is received by anyone other than the addressee, please return
> the message to the sender by replying to it and then delete the message
> from
> your computer. Internet e-mails are not necessarily sec