Hi folks,
Perl is always killing me. I always do it on my computer first and then upload to the server in our lab. And oh my, never ever be correct to run on the lab. This time I got the internal error. I tried to add and delete multiple lines and found out that is possibly due to tie::File.
Could you please help me to solve the problem? I am dying for it :(
Here's the code. -
#!/usr/bin/perl
-
-
#use CGI::Carp qw(fatalsToBrowser);
-
-
#use strict;
-
-
use CGI;
-
-
use Tie::File;
-
-
$query = new CGI;
-
-
$data_file="nameList.cgi";
-
-
open(DAT, $data_file) || die("Could not open file!");
-
-
@raw_data=<DAT>;
-
-
tie @line, 'Tie::File', $data_file or die("Could not open file!");
-
-
print $query->header();
-
-
print "Content-type: text/html\n\n";
-
-
print "<HTML><HEAD>\n";
-
print "<TITLE>Thanks!</TITLE></HEAD>\n";
-
print "<BODY>";
-
-
$first = $query->param("first");
-
$last = $query->param("last");
-
$email = $query->param("email");
-
-
-
-
print "<P>$first $last, thank you for signing up! Please click <a href=\"list.pl\">here</a> to see the signup table for confirmation and don't repeatly signing up.</P>\n";
-
-
-
-
$count = 0;
-
-
@WS = $query->param("ws");
-
-
foreach $ws(@WS){
-
-
$line[$ws-1].="$first $last, $email|";
-
-
}
-
-
close(DAT);
-
-
print "</BODY>\n";
-
-
print "</HTML>\n";
-
-------------------------------------------------------------------------------------------------------
And I've tried use warnings, add and remove -w.....doesn't work.........cr ying T-T
Cannot appreciate more.
Oct 25 '07
20 2099
Yeah, finally it works. Thank you so............. ......much, KevinADC.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jonathan Weekes |
last post by:
Being utterly a non Perl IT guy, I have to write a Perl script for a
web site to edit a line in a file. I have looked on Google and found
Tie to be what I needed, but I am really lost in how to change the
line. Can someone please edit the script below for me to show me how
to do this? I have already looked in the documentation and still got
lost...
use CGI qw/:standard/;
use CGI::Cookie;
use Tie::File;
|
by: SpecialK |
last post by:
Does anyone know how to tie a large file to a hash without using shared
memory?
I know I can use Tie::File to tie the file to an array and from the array
create a hash, but I need something that is much faster than that?
thanks,
gregk
|
by: steventhrasher42 |
last post by:
I very likely may be missing something here, but what stops a user from
holding down the F5 key in their browser and generating hundreds of
requests to IIS and thus tying up server resources?
If session state is enabled (enableSessionState=true), all of these
requests get queued and processed one after another.
And if the user finds a particular page with poor enough performance,
say one that takes a few seconds to render, by holding...
|
by: kelly |
last post by:
Hi,
I don't have a code to show you, what I need are references or
algorithms so that I'm in a right track.
By the way, thanks for introducing me the array or arrays. Now I can
continue my script.
Now I want to delete a line from a file. Line being the strings I
got/saved to/from array of arrays.
|
by: mich dobelman |
last post by:
I am developing a web crawler which collects info from more than 50,0000
pages.
but i am afraid this is going to clog the rental web server if I run it
every single day.
Is it possible to stop the web hosting server because of my program?
MD
| |
by: jonathan184 |
last post by:
trying to rename filenames and extensions then add a header in line1 of each file
if the header existed in line 1 to go to the next file.
but i am getting error explciti errors
Here is my code I am using
#!/usr/bin/perl
user warnings;
|
by: J. J. Ramsey |
last post by:
In Perl, there is a module called "Tie::File". What it does is tie a
list to each line of a file. Change the list, and the file is
automatically changed, and on top of this, only the bits of the file
that need to be changed are written to disk. At least, that's the
general idea.
I was wondering if something roughly similar could be done in Python,
or at the very least, if I can avoid doing what amounts to reading the
whole file into...
|
by: eMko |
last post by:
Hello,
In Perl, using a Tie::File module I can easily and comfortably delete
a line from the middle of a text file:
my @file;
open(DATA, "+<:encoding(utf8):raw" , "file.txt") or return 0;
tie @file, 'Tie::File', \*DATA or return 0;
splice(@file, $_, 1);
untie @file;
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script.
What You Need
Any recent...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |