Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do you open a file for writing?

Answers were Sorted based on User's Feedback



How do you open a file for writing? ..

Answer / zech

open FILEHANDLE, ">$FILENAME"

Is This Answer Correct ?    5 Yes 1 No

How do you open a file for writing? ..

Answer / raj

Files are opened using the open and sysopen function.
Either function may be passed up to 4 arguments, the first
is always the file handle thenfile name also known as a URL
or filepath, flags, and finally any permissions to be
granted to this file.

$FH = "filehandle";
$FilePath = "myhtml.html";

open(FH, $FilePath, permissions);
or
sysopen(FH, $FileName, permission);

Is This Answer Correct ?    2 Yes 0 No

How do you open a file for writing? ..

Answer / raghav

To open a file:

open (FILE, "<raghav.txt") || die ("File Cannot be opened");

Where FILE is the file handle for this file.
Here the file is opened in read mode.
Put > for write mode
put >> for append mode.

Is This Answer Correct ?    1 Yes 0 No

How do you open a file for writing? ..

Answer / ankur

open FP,">","myfile.txt";
print FP "Hello World!!";
close FP;

# > for write
# < for read
# >> for read and write

Is This Answer Correct ?    1 Yes 1 No

How do you open a file for writing? ..

Answer / ankur

open FP,">","myfile.txt"
print FP "Hello World!!";
close FP;

Is This Answer Correct ?    0 Yes 2 No

How do you open a file for writing? ..

Answer / shri

Open(FH,">>File.log");
print FH "Hello";
Close FH;

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More CGI Perl Interview Questions

How to turn on Perl warnings? Why is that important?

0 Answers  


What are the various perl data types based on the context?

0 Answers  


package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,

0 Answers  


How we can navigate the xml documents?

0 Answers  


Explain perl. When do you use perl for programming?

0 Answers  


What is an interpolation in perl?

0 Answers  


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

0 Answers  


How many loop control keywords are there in perl?

0 Answers  


What exactly is grooving and shortening of the array?

0 Answers  


Define dynamic scoping.

0 Answers  


Which feature of perl provides code reusability?

0 Answers  


What is the main function of cookie server?

0 Answers  


Categories