473,748 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tie::File 500 Internal Server Error???

35 New Member
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.
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl 
  2.  
  3. #use CGI::Carp qw(fatalsToBrowser); 
  4.  
  5. #use strict; 
  6.  
  7. use CGI; 
  8.  
  9. use Tie::File; 
  10.  
  11. $query = new CGI; 
  12.  
  13. $data_file="nameList.cgi"; 
  14.  
  15. open(DAT, $data_file) || die("Could not open file!"); 
  16.  
  17. @raw_data=<DAT>; 
  18.  
  19. tie @line, 'Tie::File', $data_file or die("Could not open file!"); 
  20.  
  21. print $query->header(); 
  22.  
  23. print "Content-type: text/html\n\n"; 
  24.  
  25. print "<HTML><HEAD>\n"; 
  26. print "<TITLE>Thanks!</TITLE></HEAD>\n"; 
  27. print "<BODY>"; 
  28.  
  29. $first = $query->param("first"); 
  30. $last = $query->param("last"); 
  31. $email = $query->param("email"); 
  32.  
  33.  
  34.  
  35. 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"; 
  36.  
  37.  
  38.  
  39. $count = 0; 
  40.  
  41. @WS = $query->param("ws"); 
  42.  
  43. foreach $ws(@WS){ 
  44.  
  45. $line[$ws-1].="$first $last, $email|"; 
  46.  
  47.  
  48. close(DAT); 
  49.  
  50. print "</BODY>\n"; 
  51.  
  52. print "</HTML>\n"; 
  53.  
-------------------------------------------------------------------------------------------------------

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
casybay
35 New Member
Yeah, finally it works. Thank you so............. ......much, KevinADC.
Oct 31 '07 #21

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1689
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;
1
2549
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
2
1216
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...
2
15993
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.
5
1496
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
1
1987
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;
1
3098
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...
2
12328
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;
1
47476
KevinADC
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...
0
8994
marktang
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...
0
8831
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,...
0
9555
Oralloy
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...
1
9329
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,...
0
9250
tracyyun
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...
1
6796
isladogs
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...
0
6076
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();...
1
3315
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
3
2215
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.