Home » Open Source » Programming Interfaces » Have a doubt in File handling in Perl
Have a doubt in File handling in Perl [message #235811] Tue, 08 May 2007 01:33 Go to next message
lokeshg82
Messages: 23
Registered: February 2007
Location: chennai
Junior Member
Dear Experts,

Actually i want to create a file using File handing in Perl,

see my code below,

vi Test_tax.pl
open FILEHANDLE, ">/usr/local/pbiace/current/bin/alice1.IL"  or die "cannot open file for reading: $!";
print FILEHANDLE "ACC_ID            000";
print FILEHANDLE "ACC_INFO_ID       001";
close FILEHANDLE  or die "an error occured while trying to close the file: $!";


actually when i run the script,it will return the rows.

but its not reflecting the input(alice1.IL) file which i mentioned path in the code(/usr/local/pbiace/current/bin/alice1.IL)

please correct me where i made mistake.


Re: Have a doubt in File handling in Perl [message #236035 is a reply to message #235811] Tue, 08 May 2007 14:07 Go to previous message
BlackSwan
Messages: 22688
Registered: January 2009
Senior Member
oracle@comdb01.hitbox.com:/tmp:> cat test1.pl
open FILEHANDLE, ">//tmp/alice1.IL"  or die "cannot open file for reading: $!";
print FILEHANDLE "ACC_ID            000";
print FILEHANDLE "ACC_INFO_ID       001";
close FILEHANDLE  or die "an error occured while trying to close the file: $!";
</tmp:> perl test1.pl
</tmp:> cat alice1.IL 
ACC_ID            000ACC_INFO_ID       001

It works for me.
Previous Topic: Setup Env. Variables for PHP
Next Topic: oracle and php
Goto Forum:
  


Current Time: Thu Aug 21 20:59:48 CDT 2014

Total time taken to generate the page: 0.08926 seconds