473,473 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help about UNDEF function?

9 New Member
Hi,

I have a question about the perl 'undef' function. I am using it to read all line at once in once string. In the same script i am using sftp to transfer the file created by the script which uses undef. Now undef is not allowing me to pick the file created on local server and transfer it to another local server. Is there any way to close this undef function?

I would appreciate help

Thank you in advance
john
Sep 11 '07 #1
3 2365
numberwhun
3,509 Recognized Expert Moderator Specialist
Can you post your code so we can see what you are doing? It would be a lot more helpful that way.

Regards,

Jeff
Sep 11 '07 #2
KevinADC
4,059 Recognized Expert Specialist
the undef() function can not transfer files so your question makes no sense. As Jeff asked, post the code otherwise there is no way for anyone to help you.
Sep 12 '07 #3
johnperl
9 New Member
the undef() function can not transfer files so your question makes no sense. As Jeff asked, post the code otherwise there is no way for anyone to help you.
Sorry to post it little but got the answer as below. I was using undef $/ instead of local $/ = undef, which was creating problem coz the loop was still open. now its fine. Thanks

Expand|Select|Wrap|Line Numbers
  1. our $reqfile = $_[0];
  2.  
  3. open (FILEHANDLE, "<$reqfile") or die ("can't open file"); 
  4. open (FILE, ">$data_dir$file[0]") or die "Cannot create the file: $!";
  5.  
  6.  local $/ = undef;  
  7.  
  8. #  put the entire content of the file into one variable 
  9.    $file1 = readline(FILEHANDLE);
  10.  
  11. #  Put entire batch from Trigger to Extraction in an array
  12.    @a = ($file1 =~ m/\{TRIGGER\}.*?\{EXTRACTION\}/smg);
  13.  
  14. #  Print the column headers
  15.    print FILE '"Extraction","HIS-FREQ","DATATYPES","RMG_NO_DATATYPE","NUM_OF_SERIES_COL","RMG_COLS"';
  16.  
Sep 26 '07 #4

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

Similar topics

2
by: pancho | last post by:
Greetings, I need help configuring/building PHP3 with MySQL as a DSO on a Solaris 8 box - this module is needed to host some existing sites I will be migrating Note. I built PHP4 from source and...
2
by: Paul Porcelli | last post by:
Hi folks, I have a perl one-liner embedded in a ksh script. perl -pi.bak -e "s/val/otherval/" inputfile I'd like to check the return code to know if the substitution was successful. If I...
3
by: J Wang | last post by:
Dear, could you tell me about the usage of "##" in preprossor give me some simple examples. thanks. I just got the example from "dissection C" as follows:
3
by: Sachin | last post by:
hi, Can i use #undef for undefining a function definition and use my function instead? like described below #undef somefunction1 #define somefunction1(a,b) myfunction1(a,b)
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
2
by: info | last post by:
Hi... I want to know (inside a function) if the calling code wants a return value or not. Here is an example: function foo() {
2
by: Old Wolf | last post by:
Is this program alright? #include <stdio.h> #undef EOF int EOF(void) { return 0; } int main(void) { return EOF(); }
0
by: myheartinamerica | last post by:
Hello, I was working on a piece of code where a vendor's #define was causing compiler warnings, which led me to try and do the following: #if defined(VAR1) #define VAR1_SAVE VAR1 #undef VAR1...
2
by: rasmidas | last post by:
Hi, I am new to Perl and could not understand the below line from an existing Perl Code. undef $/; Could anyone please let me know, what does it do? Thanks in advance. Regards...
0
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,...
0
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,...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.