Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
New to Perl and stuck...Help
[b][red]This message was edited by mikeruth at 2003-12-18 13:12:55[/red][/b][hr]
[b][red]This message was edited by mikeruth at 2003-12-18 13:12:10[/red][/b][hr]
I am on my second day of Perl programming and I am stuck. The program
below will read a one line, 1 to 2 M file, test it, and, print some counts to another file. I cannot get past the open...infile.
Help! I need to get this done soon (and with "use strict").
Where did all of my spaces go???
========================= The Code ===========================
# We have two versions. Make sure to use the lastest.
if ( @ARGV
< 2 )
my $infile = shift @ARGV
my $outfile = shift @ARGV
open( my $infile_handle, "< $infile" ) or
Can't open input file "$infile".
open( my $outfile_handle, "> $outfile" ) or
Can't open output file "$outfile".
my $text = join( '', <$infile_handle> );
my $test_len = length( $test );
" , $test_len, "
# process the line and print results...
exit ( 0 );
0 · ·