You could print the verion like this

open(FILEHANDLE,">test.txt") or die "Can't open the file: $!";
print FILEHANDLE "$]\n"; # $] is the special variable that holds the running
version of Perl
close FILEHANDLE;

or if you really want the output of perl -v

$returned = `perl -v`;

open(FILEHANDLE,">test.txt") or die "Can't open the file: $!";
print FILEHANDLE "$returned\n";
close FILEHANDLE;

HTH

John

-----Original Message-----
From: jaya kumaran [mailto:[EMAIL PROTECTED]]
Sent: 28 June 2001 11:16
To: [EMAIL PROTECTED]
Subject: Input redirection




Hi,

  I need the o/p of 
     perl -v 
   to be redirected to a file test.txt

  open(FILEHANDLE,"> test.txt") || die can't open the file";
print FILEHANDLE perl -v ;

one executing this , I get the following error

Unrecognized file test: -v at D:\test\perl\TEST1.PL line 6.

How to write the o/p of 'perl -v' in the file(test.txt).

Thanks in advance,
jaya

_____________________________________________________________
Get Free Fast Easy email from indiya.com: SIGNUP NOW : http://www.indiya.com


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.


Reply via email to