#!/usr/bin/perl;
use strict;
use warnings;
my $filename = 'input.csv';
open my $fh, '<', $filename or die "Unable to open $filename: $!";
my $firstline = <$fh>;
chomp($firstline);
print "The first line is $firstline\n";
my @fields = split(/,/, $firstline);
my $len = length($fields[1]);
print "The second field contains '$fields[1]' which has length of $len\n";
d5e5
Practically a Posting Shark
810 posts since Sep 2009
Reputation Points: 159
Solved Threads: 159