Home Tutorialhelp Comment writing into file

 
 

Comment

pankaj
writing into file,
January 13, 2010 at 6:55 PM

Hi,
I want to write into file by calling another perl/cgi script.
sample1.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI;
use Switch;
print qq'
<html>
<body>
<form method="post" action="sample2.pl">
Field Name : <input type="text" size="6" name="prod">
<input type="submit" value="Save">
<input type="reset" value="Clear" ></form>
</body>
</html>
';
from sample1.cgi I m trying to call sample2.pl

sample2.pl

#!/usr/bin/perl
print "Content-type: text/html\n\n";

use CGI;
use Switch;

my $field="AVATAR";

open NEW_FILE,">/tmp/test.dat";
print NEW_FILE "$field";

close NEW_FILE;

When I m executing sample2.pl this works fine, This is able to write a word "AVATAR" into file but when I m using sampe1.cgi I doesn't work as same.

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Free Programming books

Perl Programming Books
is Advanced Perl Programming. I've found myself writing code, remembering... Perl Programming Books         Learning Perl the hard Way 

Jobs

Perl Developer
Perl Developer       Position Vacant: Perl Developer Job Description  We are looking for Perl developers to work on various projects.  

Jobs

Unix and Perl Programmer
Unix and Perl Programmer       Position Vacant: Unix and Perl Programmer  Job Description  We are looking for Perl Programmers with Unix experience 

General

Ask Perl Questions Online
Ask Perl Questions Online       Perl is a high-level, general-purpose... development. Ask any questions whether programming, scripting 

JSP Servlet Questions

File saving and Writing
File saving and Writing   Hello Rose india..... I have a doubt... a "file create option" it will be ".csv" file and i want to write the data from arraylist into .csv file and i want to save that file so it will ask for "save 

Java Beginners

Writing and Reading A File
Writing and Reading A File  Hello, I've been trying to learn writing and reading data from file for our assignment, but just stuck on how to proceed... (FirstName, LastName, Age). I also made an empty file I named "contactsFile.txt" where 

Java Beginners

writing and appending to a file
writing and appending to a file  My input file includes data from... and values and writes into an existing file for 'male'. How can I do the same..." + " :class :" + Name);// appends the string to the file 

Java Beginners

File Writing - Java Beginners
File Writing  Hi... I need a syntax or logic or program by which we can write into the desired shell of the Excel file from console window...  Hi friend, I am sending you a link. This is will help you. Please 

Java Beginners

Writing xml file - Java Beginners
Writing xml file  Thank you for the quick response The values which... XmlServlet().createXmlTree(doc); System.out.println("Xml File Created... = sw.toString(); File file = new File("c:/newxml.xml 

Struts 2 Tutorials

Writing Actions
Writing Actions The Action is responsible for controlling of data flow within an application. You can make any java class as action. But struts have some... the method name in Action mapping in struts.xml file. To get model reference 

Java Beginners

counting the values in input file and and writing the output to a file
counting the values in input file and and writing the output to a file  Can any one please correct this code. This is to read a file and later...-code/16483-counting-values-input-file-writing-output-file.html this code 

Java-Tutorials

Writing Log Records to a Log File
Writing Log Records to a Log File       This section demonstrates for writing log records to a log file. Logger provides different types of level like: warning, info 

Java Beginners

writing a text into text file at particular line number
writing a text into text file at particular line number   Hi, thanks for quick response, I want to insert text at some particular line number.. after line number four my text will display in text file using java program 

JSP Servlet Questions

Writing a file using servlets - JSP-Servlet
Writing a file using servlets  I'm using a servlet to read an input... reading the data and creating a file in my space. but it is not writing..., but its not writing in the xyz.txt file. I think writing in a servlet should 

Java Beginners

writing a text into text file at particular line number
writing a text into text file at particular line number   Hi, thanks..... after line number four my text will display in text file using java program  ... = ""; int lineNo; try { File f=new File("c 

Java Beginners

writing a text into text file at particular line number
writing a text into text file at particular line number   Hi, thanks..... after line number four my text will display in text file using java program  ... = ""; int lineNo; try { File f=new File("c 

Java Beginners

Writing to and reading from a binary file in java.
Writing to and reading from a binary file in java.  I have written the following code to convert an ASCII text file to a binary file: public static... the binary file from another program as follows: m_dis = new DataInputStream 

Java Beginners

Having a hard time writing program to calculate test scores..........
Having a hard time writing program to calculate test scores.......... ... questions on the test and the school would like you to gather some statistics on how... the scores are stored in a file (scores.txt) that you will need to download. Input 

Java Beginners

java program for writing xml file - Java Beginners
java program for writing xml file  Good morning i want to write values from my database(one table)into one xml file. Like i have 3 coloumns in my... xml file and storet that in particlar location. Please help me out Thanks 

Applet Questions

problem of writing to a local file ( JApplet ) - Applet
problem of writing to a local file ( JApplet )  Dear All, I want to program a guestbook using java applets but now I have problem of writing to a file from JApplet. it is working without any problem if i run the program using 

Java Beginners

Writing a Program to calculate Circumference of planets reading from a file and writing to new file.
Writing a Program to calculate Circumference of planets reading from a file and writing to new file.  Hello, I would like to know how to write... stumped when it comes to reading the file and writing to a new file. My code 

Java Beginners

Image writing over URLConnection
. The problem is that when writing by ImageIO on URL what will the name of the file...Image writing over URLConnection  Hello, I am trying to write... problems trying to write an image I have succeeded in writing to the local HD using 

Java Beginners

Writing a Program to calculate Circumference of planets reading from a file and writing to new file.
Writing a Program to calculate Circumference of planets reading from a file and writing to new file.  Hello, I would like to know how to write... it comes to reading the file and writing to a new file. My code is as follows 

Development process Questions

Perl - Development process
Perl  Hi... can anyone help me regarding perl .... in perl script to connect to database and to run the query System command is being used. for example: #print "\nRun the sql"; system "$MSSQL_OSQL -U$USR -P$PSW -S$SVR 

Design concepts & design patterns Questions

without writing web.xml file we can write servlet program
without writing web.xml file we can write servlet program  Sir Morning... Sir I have one Question "without writing web.xml file we can write servlet program". if yes which way? if no why? but without use Annotation........ Plz 

Development process Questions

questions from an xml file
questions from an xml file  i am developing online bit by bit exam for that i retrieved questions from an xml file but when i retrieved using jsp i am getting all questions at a time in a single page.but i want to show one 

Java Beginners

Reading and Writing files - Java Beginners
Reading and Writing files  Hello, please help me to Develop a simple... from a file. After welcoming the users, ask them for their name and save it to the file. Use the ClassLoader and Properties classes to load the file. You will need 

Java-Tutorials

Writing to File in Java
Writing to File in Java Writing any character or text in Java file is possible...) This is the simplest example of the class used for writing character file. BufferedWriter... are used for writing Character files and Text Files respectively while another class 

Java Server Faces Questions

confused about writing to /resources directory - Java Server Faces Questions
confused about writing to /resources directory  hello I am confused about writing to /resources directory how can I put an image which resides anywhere in the system into /resources directory of a jsf application 

JavaScript Questions

URGENT !!!!! Any PERL language Expert .
URGENT !!!!! Any PERL language Expert .   I have input 50 amino acid... EXCEL sheet. Can this be done using perl or any other programming language. IS THERE ANY PERL OR BIOPERL MODULE AVAILABLE FOR PURPOSE 

Java Beginners

reading multiple files from a directory and writing them into a single file
reading multiple files from a directory and writing them into a single file... file i get an empty text file can you guide me how to do... static void main(String[]args) throws IOException{ File Folder = new 

Programming Questions

Software Questions and Answers
Software Questions and Answers View Software Questions and Answers online Discuss Software development questions, ask your questions and get answers online. Here you can find questions asked by developers in the past. You can 

Programming Questions

Software Questions and Answers
://www.roseindia.net/answers/askquestions/askquestion.html View latest Questions...Software Questions and Answers       View Software Questions and Answers online Discuss Software 

JavaScript Questions

accessing data from a json file writing javascript or using jQuery
accessing data from a json file writing javascript or using jQuery  I... this huge json file containing several objects that contain arrays for the objects... page is built from this json file, but I can't figure out how to code 

Java Server Faces Questions

writing byte array in jsf - Java Server Faces Questions
writing byte array in jsf  Dear sir in jsf i want to write a bye array.My requirement is after clicking one button it should display the image(i am getting the byte array in the manage bean propperly).my application is pure 

Framework Questions

Problem while using a HashMap for writing text ina RTF file. - Framework
Problem while using a HashMap for writing text ina RTF file.  Hi, I am trying to generate a RTF file using iText.jar, wherein I am taking... matched to the string then only write to the RTF file. Problem is Document writes 

Java-Tutorials

Java File Writing Example
Java File Writing Example To write some data on the file you need to first open the file in append mode by using the java.io.FileWriter class and then pass... BufferedWriter(fileWriter); bufferedWriter.write("Adding New Information to the File 

Java Beginners

Need help writing a console program
Need help writing a console program  I need help cant seems to figure it out! Write a program that consists of three classes. The first class... will replace all sequences of 2 spaces with 1 space. The program will read a file 

General

Writing Calculator Stateless Session Bean
' bean. Writing JSP and Web/Ear component Our JSP file access the session bean...Writing Calculator Stateless Session Bean... to build ear file. We will deploy our application using WebLogic console 

Java Beginners

questions
such as such as reading the data form file, reading the data from data base and etc 

Jobs

PERL & CGI Programmer
PERL & CGI Programmer       Position Vacant: PERL & CGI Programmer Job Description  Looking for CGI programmers having knowledge of Perl 

Software Services

Article Writing Services,Article Writing Outsourcing India,Affordable Article Writing Services
Article writing is a technique. It is not an easy task to write a handsome and effective writing especially for the unprofessional person. Only..., but not on every topic, because a single person has some limitation. For writing 

Eclipse Plugins

Eclipse Perl Integration
Eclipse Perl Integration       EPIC is an open source Perl IDE based on the Eclipse platform... assist, perldoc support, source formatter, templating support and a Perl 

Programming Tutorials

Terms to be avoided while writing for the Web
Terms to be avoided while writing for the Web       It is unhealthy for your work to call attention... a file, instructions differ from browser to browser. So, whenever you provide 

Web Hosting Tutorial

What are PHP, ASP and Perl
PHP (Hypertext Preprocessor), ASP.NET (Active Server Pages),and Perl... browsers. Perl is a server-side scripting language. This programming language... are important to provide dynamic look to any websites. PHP, Perl, ASP are among 

PHP Tutorial

PHP File Manipulation Writing to a File Tutorial
of the important work  is writing to a file, following example will illustrate how... of the important work is writing to a file, following example will illustrate how... File Manipulation in PHP       

JSP Interview Questions

uploding an file - JSP-Interview Questions
uploding an file  i want a code for uploading a file and storing it in clog and blog using jsp ex:uuploading file using binary input steam 

PHP Tutorial

Perl and CGI Miscellaneous Very short delay Tutorial
it). Function ussually used to monitor operations on file handles. Syntax: select(handle1, handle2, handle3, time_to_wait); The first 3 parameters are file 

JSP Tutorials

Reading And Writing Excel File
reading and writing excel file   ... org.apache.poi.poif.filesystem.POIFileSystem class is used to buffer the excel file into an object. In other words, we can say that it is used to read the excel file. After reading the excel 

Java Beginners

writing document (.doc) file from java with format such as font type, font style
writing document (.doc) file from java with format such as font type, font... with format such as font type and style to a document file? Thanks in advance... WriteInDocument{ public static void main(String[] args)throws IOException{ File file 

Programming Tutorials

Writing Articles for Showcasing Your Knowledge or Changing Lives?
Writing Articles for Showcasing Your Knowledge or Changing Lives... writers also have several sources of motivation. Some of them enjoy writing articles... objective of writing articles must always be changing lives and not simply covering 

Java Beginners

How to access the image file from project folder itself while writing to pdf using itext?
How to access the image file from project folder itself while writing to pdf using itext?  I am writing a pdf using itext where i add a image in the beginning of the document. When i use image = Image.getInstance("C 

Java Beginners

i written the program in the files but in adding whole file is writing once again - Java Beginners
i written the program in the files but in adding whole file is writing once again  Very Urgent: Write a small record management application file and it should not be re-written for every add/delete operation.  Hi 

JSP Interview Questions

uploading a file - JSP-Interview Questions
uploading a file   uploading a file and storing in database using...; public File currentDir; public DropTarget target; JButton addButton...,BorderLayout.SOUTH); currentDir = new File(System.getProperty("user.dir")); } public 

RDF

Writing RDF file in Java
Writing RDF file in Java     ... or Resource Description Framework file in Java. The example illustrates you how... to develop RDF file in Java "createDefaultModel()" method 

Java Interview Questions

HTMLParserTxt - Java Interview Questions
to convert HTML file to txt file. I will send you the code. Please can you fix...("Parsing text from HTML file " + fileName + "...."); File f = new File(fileName); if (!f.isFile()) { System.out.println("File 

Programming Tutorials

Writing Quick Articles Using Information in Public Domain
Writing Quick Articles Using Information in Public Domain... writing articles as a tough task and consequently have a habit of procrastinating... are not interested in researching on topics for writing original articles 

Software Services

Brochure Copy Writing Services in India
Brochure Copy Writing With a growth in business activities the need... writing demands a special skill set as it is not just informing but it is selling... having dexterity in writing brochure we do the task of bridging 

General

Writing your First WAP Application.
; Writing your First... favourite text editor like Notepad or Wordpad. After writing it save as '.wml' file. U.P. Browser (download 

Java Server Faces Questions

file uploading - Java Server Faces Questions
file uploading  Hi thi is swathi . Thanku for answreing previous questions .But its not working for file uploading . U ask me to send the entire code...) { System.out.println("File Not Uploaded"); } else { FileItemFactory factory = new 

Eclipse Plugins

Pedeto
for Perl. Features: * General o Fully integrated into Eclipse o Support for multiple Perl installations o Wizards... edited file o Support for Tasks (TODO, FIXME) o Auto 

Java Server Faces Questions

file uploading - Java Server Faces Questions
file uploading   In the mozilla browser if we browse the file it takes only the file name not the complete path and file not found exception... of the specified file located on any machine 

Java Interview Questions

java methods - Java Interview Questions
the so-called native method interface. Writing native methods involves importing... are as follows: * Write Java code * Compile Java code * Create C header (.h file) * Create C stubs file * Write C code * Create shared code library (or DLL 

Java Interview Questions

Error Opening File - Java Interview Questions
. But when I try to export it under Runnbale jar file on my desktop and I run this generated file, a message was displayed: Error opening file. But If I 

Hibernate Tutorial Example

Writing ORM for Insurance table
Writing ORM for Insurance table   ... necessary code in the contact.hbm.xml file. Create POJO class: Here is the code of our java file (Insurance.java), which we will map to the insurance table 

Java Server Faces Questions

Jar file - Java Server Faces Questions
Jar file  Hi All, What is the Jar file to run The Jsf Applications.When i am trying to run in the Eclipse its not running. Thanks in Advance, Puppy   Hi friend, Jar file to run The Jsf Applications jsf 

Java Server Faces Questions

file uploading - Java Server Faces Questions
file uploading  HI this is swathi.Thanku for answering previous questions.Previously u helped me in file uploading but is not working the description of problem is below: The file uploading code is working in lan 

IDE Questions

To run a jsp file automatically - IDE Questions
To run a jsp file automatically  Hi all, I am in need for the solution for - Can a JSP page can be made to run automatically when NetBeans IDE has been started. or we have to compile and run it automatically? I 

JSP Interview Questions

creating new file with File class - JSP-Interview Questions
creating new file with File class   I have a file uploading concept in my project. For that, while creating a new file is it necessary to give... of FileOutputStream class. If we give the path as from the file uploading location will it work 

Software Services

Ghost Writing
Ghost Writing Ghost Writing is the kind of writing when someone... of writing it. So ghostwriter is a person who works behind the scene on a writing project in return of certain amount. The write-ups of the writer 

Software Services

Blog Writing
Blog Writing A blog, the short form of web log is an online user... on that. But the professionals are a better choice for writing the blog for commercial or promotional purpose. We provides the services of writing blogs for the commercial 

Servlets

Servlet Interview Questions
Servlet Interview Questions       Collection of large number of Servlet Interview Questions. These questions are frequently asked in the Java Interviews. Question: What 

General

Ask JUnit Questions Online
Ask JUnit Questions Online   ... unit testing easier and more effective. JUnit lets writing, running and testing... and Kent Beck for the purpose of writing, testing and running larger software 

Programming Tutorials

Writing an Unique Article Having the Potential of Making Clients Run For You
Writing an Unique Article Having the Potential of Making Clients Run... flu virus. It's the ?Sameness virus? that is infecting the article writing world... following someone else's instructions for writing your articles. You may have 

Programming Tutorials

Corejava Interview,Corejava questions,Corejava Interview Questions,Corejava
Core Java Interview Questions Page1   ... to use while writing code first, but reconfiguring for a different database product does not require re-writing the client application if you are using a string 

Java-Tutorials

Java Write To File Append
Java Write To File Append In this tutorial you will learn how to append the text when you are writing in a text file. Appending a text means that the text... the older text when you are writing again to an existing file. To achieve 

General

Ask Dojo Questions Online
Ask Dojo Questions Online   ... library used in writing JavaScript applications. It includes AJAX support... in Dojo can also answers of the questions. Dojo 

Java Interview Questions

javascript - Java Interview Questions
javascript  I am writing a simple JavaScript to validate the field. Any guidelines for writing a simple JavaScript will work 

Java-Tutorials

Java Write GZIP File Example
Java Write GZIP File Example To add a file in GZIP format you need to use java.util.zip.GZIPOutputStream class. An example of writing a text file in GZIP...{ /* The new file name which you will get */ String newFileName 

Java-Tutorials

Writing UTF-8 Encoded Data in Java
methods and constructor used in this program to writing text in a file... Writing UTF-8 Encoded Data in Java   ... will learn, how to write text in a file in UTF-8 encoded format 

Java Beginners

dynamically writing text javascript
dynamically writing text javascript  dynamically writing text javascript. Is it possible 

Java Beginners

dynamically writing text javascript
dynamically writing text javascript  dynamically writing text javascript. Is it possible 

Java Technology Tutorials

How to read file in java
How to read file in java Java provides IO package to perform reading and writing operations with a file. In this section you will learn how to read a text file line by line  in java. FileInputStream- This class reads bytes from 

Java-Tutorials

Writing and reading from/to a serialized file through Hash Table in Java
Writing and reading from/to a serialized file through Hash Table in Java... illustrates you how to read and write from/to a serialized file through the hash table.... Following program has the facility if the specified serialized file does not exist 

Java Server Faces Questions

p2p file sharing tech - Java Server Faces Questions
p2p file sharing tech  which technology we can use to build a p2p mobile file sharing application. Is there any application through we can do file sharing on mobile 

Java Interview Questions

how to seperation one file into two - Java Interview Questions
how to seperation one file into two  hi can anyone tell me how to seperation one file into two so that the data inside e.g a=apple will get seperated and comes as a in one file and apple in another 

Programming Tutorials

Web Writing
Web Writing       The art of writing for the web is far removed from writing for the print world.... Following is the prime aspect you need to keep in mind while writing for the web 

Programming Questions

Questions and Answers Help
Questions and Answers Help      ... features of the questions posting form You can ask questions in and provide...-example.html Ask Questions | Browse Latest Questions and Answers 

Programming Questions

Questions and Answers Help
Questions and Answers Help      ... features of the questions posting form You can ask questions in and provide...-example.html Ask Questions | Browse Latest Questions and Answers 

IDE Questions

How to open a .war file inside Netbean IDE? - IDE Questions
How to open a .war file inside Netbean IDE?  Dear experts, I've been trying to read a .war file inside my Netbean IDE alot of times but to no avail. When I used open file to open the .war file, it just remains inside my 

Software Services

SEO Writing
SEM and SEO Article Writing SEM and SEO article helps your business to grow... the intended traffic through SEM and SEO article writing in addition to other tools... is the demand of SEM and SEO article writing services. A good command over 

XML Tutorials

Emitting DOCTYPE Declaration while writing XML File
Emitting DOCTYPE Declaration while writing XML File  ... with the help of a DocumentBuilderFactory File file = new File("Document2.xml... to a style sheet as we are retrieving it from the File. t.setOutputProperty 

Struts and Hibernate Integration Tutorial

Spring Context - Writing Application Context
Spring Context - Writing Application Context  ... by defining the Application context definition file (applicationContext-hibernate.xml). This file is used by context loader servlet to initialize the Spring 

HTML Questions

writing HTML entirely by hand
writing HTML entirely by hand  How comfortable are you with writing HTML entirely by hand 

WebSevices Questions

writing plugin - WebSevices
writing plugin  can anyone help me in writing plugin for internet explorer browser using c++ in .net environment 

Java Interview Questions

how to create a jar file for java classes? - Java Interview Questions
how to create a jar file for java classes?  I have 2 classes x1 and x2. packages names are com.bank.xyz; how to create a jar file for classes.  Hi Friend, Please visit the following link: http 

Servlet Interview Questions

Servlet Interview questions - Servlet Interview Questions
? what is SendRedirectin servlets? give the answers for these two questions... back to the client. A resource can be another servlet, or an HTML file, or a JSP file, etc. A sendRedirect() method sends the client request to some other 

PHP Tutorial

PHP File Manipulation File locking Tutorial
PHP File locking Learn how to use PHP file locking. You need to lock the file each time when you do any input/output operation with that file... simple open file and read/write data from it like this. $fp=fopen(" 

Java Beginners

Java Questions
[] urls = null; URL url = new URL("jar:file::///c://myjarfile.jar!/"); urls = new URL 

PHP Questions

writing webservices in php
writing webservices in php  How to write a simple web service in PHP 

Advertisements Advertisements
 

 

 

DMCA.com