RE: print file

2006-05-08 Thread Timothy Johnson
file. -Original Message- From: Bedanta Bordoloi, Gurgaon [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:24 AM To: badrinath chitrala; beginners@perl.org Subject: RE: print file Try this: open(FILE,"f:/file.txt") || print("open() failed as file did not exis

RE: print file

2006-05-08 Thread Bedanta Bordoloi, Gurgaon
Try this: open(FILE,"f:/file.txt") || print("open() failed as file did not exist.\n"); while (){ print $_; } Bedanta -Original Message- From: badrinath chitrala [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:46 PM To: beginners@perl.org Subject: print file Hi open F

Re: print file

2006-05-08 Thread John W. Krahn
badrinath chitrala wrote: > Hi Hello, > open FILE, "file.txt" or die $!; open() creates the filehandle FILE which is associated with the contents of the file "file.txt". > while () You are using a file glob to get a list of file names which is the same as doing: while ( defined( $_ = glob '

RE: print file

2006-05-08 Thread Thomas Bätzler
badrinath chitrala <[EMAIL PROTECTED]> asked: > open FILE, "file.txt" or die $!; > while () > > Sombody please tell me why do i get the message as below if i > want to print the contents of text file I would suggest you use the three argument open, i.e. OPEN FILE, '<', $file or die "Can