Im going with empty string or null. -----Original Message----- From: Irfan J Sayed (isayed) [mailto:[EMAIL PROTECTED] Sent: 20 August 2008 14:34 To: beginners@perl.org Subject: doubt
Hi All, Can you please tell me what is the value of $file. When i execute this script . it says "Can't open : No such file or directory" Please suggect. Regards Irf. #!/usr/bin/perl # file: count_lines.pl # Figure 1.4: Count the lines of a file use strict; use IO::File; my $file = shift; my $counter = 0; my $fh = IO::File->new($file) or die "Can't open $file: $!\n"; while ( defined (my $line = $fh->getline) ) { $counter++; } STDOUT->print("Counted $counter lines\n"); This e-mail is from the PA Group. For more information, see www.thepagroup.com. This e-mail may contain confidential information. Only the addressee is permitted to read, copy, distribute or otherwise use this email or any attachments. If you have received it in error, please contact the sender immediately. Any opinion expressed in this e-mail is personal to the sender and may not reflect the opinion of the PA Group. Any e-mail reply to this address may be subject to interception or monitoring for operational reasons or for lawful business practices. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/