[EMAIL PROTECTED] wrote:
People of the Perl,
I have this file that looks like:
e4933 e4343 e3435 e9809
and I am printing the first 40 lines using
open FILE ..... ;
while ( <FILE> ) {
chomp
print "$_ " if 1 .. 40;
and it gets me what I want as above on one line, but the end result needs
to be
eject 0,0,0 e4933 e4343 e3435 e9809 ........
I tried to shift the array to populate it with the eject string but with
not exactly clear what you want your end result to be but:
my $cnt = 1;
my $string = 'eject 0,0,0';
while (<FILE>) {
last if $cnt =< 40;
chomp;
$string .= $_;
$cnt++;
}
or if you want it in an array
open FILE;
my @lines = <FILE>;
close FILE;
HTH :)
Lee.M - JupiterHost.Net
no luck.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>