develooper Front page | perl.beginners | Postings from February 2002

Re: Formats

Thread Previous
From:
Jeff 'japhy' Pinyan
Date:
February 1, 2002 10:19
Subject:
Re: Formats
Message ID:
Pine.GSO.4.21.0202011318390.27903-100000@crusoe.crusoe.net
On Feb 1, ABhagwandin@STSSystems.com said:

>Why does the following not work for me?
>
>format NAME =
>TEST
>----
>@<<<<<<<<<<<<<<<
>$test
>..
> 
>$test = "asdfjkl;";
> 
>select(NAME);
>write();

That tries writing to the filehandle NAME, too.  Instead of select(NAME),
do:

  $~ = "NAME";

That will set STDOUT's default format name to "NAME".

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About