one small question

2006-07-27 Thread anand kumar
Hi all, Can any one say a command or procedure to find out on which OS/Platform does our current perl script is running. Thanks in advance for the help Reards Anand Kumar - Here’s a new way to find what you're

Re: File handling using CGI

2006-07-27 Thread Prabu
I BioKid wrote: One simple question - I need to accept a file from the user and to store it as temp1. then I need to give this file as an input of another program : I wrote a script like this, but it is not working : Help ? #!/usr/bin/perl -w use CGI; my $q = new CGI; my $file =

Re: one small question

2006-07-27 Thread John W. Krahn
anand kumar wrote: Hi all, Hello, Can any one say a command or procedure to find out on which OS/Platform does our current perl script is running. The $^O variable is probably what you want. perldoc perlvar John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL

Re: File handling using CGI

2006-07-27 Thread I BioKid
Dear Prabu and all, My purpose is simple, I have a web-form, that will accept a file, I need to use this file as an input of a program in my server, then I need to print the out put on the web page. I am able to do the second part, but am not able to get the users file to a variable or array ?

RE: File handling using CGI

2006-07-27 Thread Charles K. Clarkson
I BioKid wrote: : I am able to do the second part, but am not able to get : the users file to a variable or array ? Read the Files and I/O section of the perlintro file in the perl documentation. HTH, Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate Web Programmer 254

RE: how to write content of file to an array / variable ?

2006-07-27 Thread Jeff Peng
my $file = $q-param('file'); Are you sure the $file exist on your system actually? open (FOO, temp1); Under CGI,you maybe always need to specify a full path to the file.Maybe you would write: open Foo,/your/path/temp1 or die $!; while ($file) Before reading,you should open the $file

sending output to file

2006-07-27 Thread Sayed, Irfan \(Irfan\)
Hi All, I need to send / print / write the output of one command to a file through perl script can anybody plz help. Regards Irfan.

Re: sending output to file

2006-07-27 Thread Prabu
Sayed, Irfan (Irfan) wrote: Hi All, I need to send / print / write the output of one command to a file through perl script can anybody plz help. Regards Irfan. Hope this helps perl -e 'print `command file`;' Example: perl -e 'print `ls -l output`;' -- Prabu.M.A When I was

Re: PATH env variable and open()

2006-07-27 Thread Ken Foskey
On Wed, 2006-07-26 at 11:28 -0700, Travis Thornhill wrote: Does anyone have any idea why setting $ENV{PATH} = would cause the open() function to fail? The file I'm trying to open exists, and some debug printing shows that I'm in the directory where it exists. If that is literal then it

Re: File handling using CGI

2006-07-27 Thread Ken Foskey
On Wed, 2006-07-26 at 23:57 +0530, I BioKid wrote: One simple question - I need to accept a file from the user and to store it as temp1. then I need to give this file as an input of another program : I wrote a script like this, but it is not working : Help ? #!/usr/bin/perl -w use CGI; my

Implement find command

2006-07-27 Thread Anoop Kurup
Hi, Can u help me in the coding of the Find function. I need to customize find so that it accepts values of type *.sh etc with last modification of time of +$time and of $file_type file type. If such a file is found within the $base_dir directory then that file should be deleted. Cheers, Anoop

Dynamically choosing CGI file based on form output

2006-07-27 Thread Mike Martin
I have the following code which should 1. Give user a choice of actions 2. Based on these go to the specified script I have the following issues 1. The Submit button needs clicking twice after selection 2. Only one value can be chosen, to choose another the form must be reloaded from scratch

Other ways to assign a filehandle to a variable?

2006-07-27 Thread Roman Daszczyszak
After reading Randal's March 2000 LM column and learning that you can assign a filehandle to a scalar by doing something like: open(FILE, $filename) or die whatever; $value = *FILE{IO}; I am wondering if there are other, perhaps better, ways of doing this? FYI, I googled for assigning

sending output to file

2006-07-27 Thread Sayed, Irfan \(Irfan\)
Hi All, I need to send / print / write the output of one command to a file through perl script can anybody plz help. Regards Irfan.

Re: sending output to file

2006-07-27 Thread Beginner
On 27 Jul 2006 at 22:20, Sayed, Irfan (Irfan) wrote: I need to send / print / write the output of one command to a file through perl script can anybody plz help. deja vu...didn't I see this 2 hours ago! perldoc -q system or perlfaq8#how_can_i_capture_stderr_from_an_external_command --

File opeartions help

2006-07-27 Thread Sayed, Irfan \(Irfan\)
Hi, I am executing following code. i need to send the output of system($cmd); command to the file . how do i do that plz help Regards Irfan. #/usr/atria/bin/Perl -w use strict; use warnings; my $CT = /usr/atria/bin/cleartool; my @vob_list = `$CT lsvob -s`; my $fname =

Re: Implement find command

2006-07-27 Thread Joshua Colson
On Thu, 2006-07-27 at 19:19 +0530, Anoop Kurup wrote: Hi, Can u help me in the coding of the Find function. I need to customize find so that it accepts values of type *.sh etc with last modification of time of +$time and of $file_type file type. If such a file is found within the $base_dir

Re: File opeartions help

2006-07-27 Thread Hal Wigoda
why do you keep on asking the same question? On Jul 27, 2006, at 9:47 AM, Sayed, Irfan ((Irfan)) wrote: Hi, I am executing following code. i need to send the output of system($cmd); command to the file . how do i do that plz help Regards Irfan. #/usr/atria/bin/Perl -w

Re: File opeartions help

2006-07-27 Thread Joshua Colson
On Thu, 2006-07-27 at 22:47 +0800, Sayed, Irfan (Irfan) wrote: Hi, I am executing following code. i need to send the output of system($cmd); command to the file . how do i do that plz help This question has already been answered twice this morning. Please watch for responses to the

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread Dr.Ruud
Roman Daszczyszak schreef: After reading Randal's March 2000 LM column and learning that you can assign a filehandle to a scalar by doing something like: open(FILE, $filename) or die whatever; $value = *FILE{IO}; I am wondering if there are other, perhaps better, ways of doing this? FYI,

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread JupiterHost.Net
Use lexical ones in the first place. open my $fh, '', $filename or die open $filename, stopped ; And if you're gogint to die you might as well say why :) ... or die open $filename failed: $! ; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: sending output to file

2006-07-27 Thread Mumia W.
On 07/27/2006 09:20 AM, Sayed, Irfan (Irfan) wrote: Hi All, I need to send / print / write the output of one command to a file through perl script can anybody plz help. Regards Irfan. The Perl documentation which you've already read shows you how to do this. As reminders, look

RE: File opeartions help

2006-07-27 Thread Timothy Johnson
Try backticks instead of the system() call to capture the outputh. E.g. my @results = `$cmd`; -Original Message- From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED] Sent: Thursday, July 27, 2006 7:48 AM To: beginners@perl.org Subject: File opeartions help Hi, I am executing

Re: get only filenames and not directory names under a specific path.

2006-07-27 Thread Alan_C
On Wednesday 26 July 2006 00:59, Rob Dixon wrote: Hello Alan Alan_C wrote: On Tuesday 25 July 2006 15:56, Rob Dixon wrote: Nishi Bhonsle wrote: [ snip ] [ snip ] [ snip ] #!/usr/bin/perl use strict; use warnings; my @dir = do { # opendir my $dh,

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread Dr.Ruud
JupiterHost.Net schreef: Use lexical ones in the first place. open my $fh, '', $filename or die open $filename, stopped ; And if you're gogint to die you might as well say why :) ... or die open $filename failed: $! ; Yes, I meant: open my $fh, '', $filename or die open $filename,

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread Dave Gray
For posterity: http://perl.plover.com/local.html#3_The_First_Class_Filehandle_Tr -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

RE: Dynamically choosing CGI file based on form output

2006-07-27 Thread Charles K. Clarkson
Mike Martin wrote: : I have the following code which should : : 1. Give user a choice of actions : 2. Based on these go to the specified script : : I have the following issues : : 1. The Submit button needs clicking twice after selection : 2. Only one value can be chosen, to choose another the

queuing up user input via writes to STDIN

2006-07-27 Thread Gavin Bowlby
All: I have a program that reads STDIN for user commands while the program is running. I'm adding the capability to queue up user commands from the shell command line when the program is invoked. I'd like to be able to queue the command line data up in STDIN, so that when the program goes into

Re: queuing up user input via writes to STDIN

2006-07-27 Thread John W. Krahn
Gavin Bowlby wrote: All: Hello, I have a program that reads STDIN for user commands while the program is running. I'm adding the capability to queue up user commands from the shell command line when the program is invoked. I'd like to be able to queue the command line data up in STDIN,