how to use the filehandle stored in a variable without knowing its file association


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to use the filehandle stored in a variable without knowing its file association
# 1  
Old 02-17-2011
how to use the filehandle stored in a variable without knowing its file association

how to use the filehandle stored in a variable without knowing its file association i.e. the filename

code
HTML Code:
my $logFH = $connObj->get('logFH');
infoPrint("Variable is of type IO \n") if(UNIVERSAL::isa($logFH, 'IO'));
infoPrint("$logFH\n");
output
HTML Code:
== INFO :: Variable is of type IO
== INFO :: FileHandle=IO(0x8c634e8)
Now that I got a file handle stored in a scalar plz suggest ny way of using it to access its file content.

open and sysopen doesnot work as it require the file name as well.

ny work around !!!!!!!!!!!!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to lookup stored variable in file and print matching line

The bash bash below extracts the oldest folder from a directory and stores it in filename That result will match a line in bold in input. In the matching line there is an_xxx digit in italics that (once the leading zero is removed) will match a line in link. That is the lint to print in output.... (2 Replies)
Discussion started by: cmccabe
2 Replies

2. Shell Programming and Scripting

Applying sed against a file from a list of values stored in a variable

Hi Forum. I have the following challenge at work that I need to write a script for. I have a file abc.txt with the following contents: 4560123456 4570987654 4580654321 I want to be able to search/replace in abc.txt - the first 4 characters anything starting with 4560 to 7777; 4570... (3 Replies)
Discussion started by: pchang
3 Replies

3. UNIX for Dummies Questions & Answers

Run command stored in variable

Hi, I have a shell script where I have to connect t oracle database. I have to store the command in a variable and then run the command through the variable.The OS is solaris 10 and the shell is bash.pls help when I run the command it doesnot work.Thanks. if CONNECT= "sqlplus... (4 Replies)
Discussion started by: Rossdba
4 Replies

4. UNIX for Dummies Questions & Answers

File association

Hi, I'm using unix solaris 2.8 with CDE and I would modify the file association in my desktop. I found the file /usr/dt/appconfig/types/C/datatypes.dt from this topic : File Extension association in CDE | Unix Linux Forums | UNIX for Dummies Questions & Answers but this file can only be... (3 Replies)
Discussion started by: Toug
3 Replies

5. Shell Programming and Scripting

Resolve parameter value stored in a variable

Hi All, I have below variable, xyz=\$AI_XFR Now, if you will run the below command => echo $xyz $AI_XFR It is returning hardcoded string value. Whereas in environment, there is value in it. Like below: => echo $AI_XFR /home/aditya/sandbox/xfr/ I need to resolve this... (4 Replies)
Discussion started by: adgangwar
4 Replies

6. Shell Programming and Scripting

Function returns a value but cannot be stored in other variable

I need help to store the value returned from the function to one variable and then use that variable. PREVIOUS_DATE_FUNCTION() { date '+%m %d %Y' | { read MONTH DAY YEAR DAY=`expr "$DAY" - 1` case "$DAY" in 0) MONTH=`expr "$MONTH" - 1` case... (1 Reply)
Discussion started by: aroragaurav.84
1 Replies

7. Shell Programming and Scripting

Variable not found error for a variable which is returned from stored procedure

can anyone please help me with this: i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure... ... (4 Replies)
Discussion started by: swap21783
4 Replies

8. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

9. Shell Programming and Scripting

Increment variable stored in a file

Hi, I want to write a perl script, which will increment number stored in file. I want to do this without any file handles. I think we have to use some UNIX commands. I am not sure how to do this with file handles. Thanks, (1 Reply)
Discussion started by: solitare123
1 Replies

10. UNIX for Dummies Questions & Answers

File Extension association in CDE

Hi, Any idea how to define the file extension association within CDE. I need to tell dtfile (the file manager) to open *.log files as text documents and not emails... Thanks! (2 Replies)
Discussion started by: me2unix
2 Replies
Login or Register to Ask a Question
Tcl_SetAssocData(3)					      Tcl Library Procedures					       Tcl_SetAssocData(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData - manage associations of string keys and user specified data with Tcl interpreters SYNOPSIS
#include <tcl.h> ClientData Tcl_GetAssocData(interp, key, delProcPtr) Tcl_SetAssocData(interp, key, delProc, clientData) Tcl_DeleteAssocData(interp, key) ARGUMENTS
Tcl_Interp *interp (in) Interpreter in which to execute the specified command. const char *key (in) Key for association with which to store data or from which to delete or retrieve data. Typically the module prefix for a package. Tcl_InterpDeleteProc *delProc (in) Procedure to call when interp is deleted. Tcl_InterpDeleteProc **delProcPtr (in) Pointer to location in which to store address of current deletion procedure for associa- tion. Ignored if NULL. ClientData clientData (in) Arbitrary one-word value associated with the given key in this interpreter. This data is owned by the caller. _________________________________________________________________ DESCRIPTION
These procedures allow extensions to associate their own data with a Tcl interpreter. An association consists of a string key, typically the name of the extension, and a one-word value, which is typically a pointer to a data structure holding data specific to the extension. Tcl makes no interpretation of either the key or the value for an association. Storage management is facilitated by storing with each association a procedure to call when the interpreter is deleted. This procedure can dispose of the storage occupied by the client's data in any way it sees fit. Tcl_SetAssocData creates an association between a string key and a user specified datum in the given interpreter. If there is already an association with the given key, Tcl_SetAssocData overwrites it with the new information. It is up to callers to organize their use of names to avoid conflicts, for example, by using package names as the keys. If the deleteProc argument is non-NULL it specifies the address of a procedure to invoke if the interpreter is deleted before the association is deleted. DeleteProc should have arguments and result that match the type Tcl_InterpDeleteProc: typedef void Tcl_InterpDeleteProc( ClientData clientData, Tcl_Interp *interp); When deleteProc is invoked the clientData and interp arguments will be the same as the corresponding arguments passed to Tcl_SetAssocData. The deletion procedure will not be invoked if the association is deleted before the interpreter is deleted. Tcl_GetAssocData returns the datum stored in the association with the specified key in the given interpreter, and if the delProcPtr field is non-NULL, the address indicated by it gets the address of the delete procedure stored with this association. If no association with the specified key exists in the given interpreter Tcl_GetAssocData returns NULL. Tcl_DeleteAssocData deletes an association with a specified key in the given interpreter. Then it calls the deletion procedure. KEYWORDS
association, data, deletion procedure, interpreter, key Tcl 7.5 Tcl_SetAssocData(3)