P
perlUSER
Hello;
I started learning Perl recently and am stuck with the Perl "format"
function.
----------------------------------------------------------------
Program:
#!/usr/bin/perl
use lib '/tmp/perl';
use FileHandle;
format STDOUT =
Album=@<<<<<<<<<<<<< Artist=@>>>>>>>>>>>> Price=$@##.##
$album, $artist, $price
..
$album = "Test album";
$artist = "Brit";
$price = "9.99";
write();
================================================================
Output:
$ perl rpt.pl
Album= Artist= Price=$ 0.00
$album, $artist, $price
$
===============================================================
Variables are printed as if they are like static values.
Could you please help me with this?
Thanks in advance.
Regards,
Sri.
I started learning Perl recently and am stuck with the Perl "format"
function.
----------------------------------------------------------------
Program:
#!/usr/bin/perl
use lib '/tmp/perl';
use FileHandle;
format STDOUT =
Album=@<<<<<<<<<<<<< Artist=@>>>>>>>>>>>> Price=$@##.##
$album, $artist, $price
..
$album = "Test album";
$artist = "Brit";
$price = "9.99";
write();
================================================================
Output:
$ perl rpt.pl
Album= Artist= Price=$ 0.00
$album, $artist, $price
$
===============================================================
Variables are printed as if they are like static values.
Could you please help me with this?
Thanks in advance.
Regards,
Sri.