formats and write()
From: Dani Pardo (dani_at_enplater.com)
Date: 04/29/04
- Next message: Durai: "Re: Running another program in current program"
- Previous message: John W. Krahn: "Re: Substitution/Regex problem"
- Next in thread: John W. Krahn: "Re: formats and write()"
- Reply: John W. Krahn: "Re: formats and write()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 12:17:48 +0200 (CEST) To: beginners@perl.org
Hi, I've a question involving formats.
I have a text file that has lines like this:
__LINE1__
__LINE2__
I use s/__LINE(\d+)__/$line{$1}/ to change each of these lines by an
scalar that is stored in a hash, i.e:
line{1}="CUSTOMER_NAME | PHONE | EMAIL | COUNTRY";
But, as you may have guessed, I need to format $line{1} with Perl
formats. But write() writes to a filehandle, and I need to store the
result into the scalar variable,
How can I do it? TIA,
--- Dani Pardo, dani@enplater.com Enplater S.A
- Next message: Durai: "Re: Running another program in current program"
- Previous message: John W. Krahn: "Re: Substitution/Regex problem"
- Next in thread: John W. Krahn: "Re: formats and write()"
- Reply: John W. Krahn: "Re: formats and write()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|