[Cascavel-pm] Duvida FileHandle - formataca

Patty Silva ptfzs em yahoo.com.br
Segunda Fevereiro 18 10:32:33 PST 2008


Pessoal.. 
estou com um exemplo aqui.. e estou tentando modifica-lo:

#!/usr/bin/perl
# Figure 12.7: fig12_07.pl
# demonstrates the special format variables

use warnings;
use strict;
use English;

my @array=qw(23 345 56 67 67 78 89);

my $file = $ARGV[ 0 ];
my $file2 = $ARGV[ 1 ];
my $line;

&readfile($file);
&readfile($file2);

-------------------------------------------------------------
sub readfile
{

my($file)=@_;
open( FILE, $file ) or die( "Cannot open $file:: $!" );

$FORMAT_TOP_NAME = 'TOP';
$FORMAT_NAME = 'CORPO';
$-=0;
$%=0;
    while ( $line = <FILE> ) 
    {
       write();
    }
}

close( FILE ) or die( "Cannot close: $!" );




format TOP =
------------------------------------------------------------------
@>>>>>>>>>>>>> ~~
shift @array||''
------------------------------------------------------------------
.

format CORPO =
------------------------------------------------------------------
Line @<<<   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     $.,    $line
~~          ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            $line
.


Eu quero que saia a impressao do array(@array) quando ler tanto o 1 arquivo quando o 2...
e ele so aparece quando eu leio o 1 arquivo...

alguem pode me ajudar??


Obrigada








      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://mail.pm.org/pipermail/cascavel-pm/attachments/20080218/269869f5/attachment.html 


Mais detalhes sobre a lista de discussão Cascavel-pm