Javascript and perl

2005-09-27 Thread Umesh T G
Hello List, Below is my index.pl #!/usr/bin/perl use Env; print "Content-Type: text/html\n\n\n"; chdir("/path/to/dir"); @files=`ls -1`; ## load all the html files.. print "\n"; print "\n"; print < function submit_form() { document.show_fi

RE: Javascript and perl

2005-09-27 Thread Thomas Bätzler
Hi, Umesh T G <[EMAIL PROTECTED]> wrote: > Below is my index.pl Some comments: > #!/usr/bin/perl # consider using -T fpr taint mode use strict; use warnings; # consider using the CGI module, too. > use Env; > print "Content-Type: text/html\n\n\n"; One \n too many. > chdir("/path/to/dir");

lock on hashtable value

2005-09-27 Thread Valerio Giacomelli
hi all... i have a question.. I am realizing an application multithreaded, and my problem is that I'd like to make lock on single values of a hashtable.. how can i make it?my hash is shared with share($hash); $hash = \%hash; but all elements of this are not shared.. so how can i share al

hi

2005-09-27 Thread ZHAO, BING
Hi, How do you INPUT the output( of a file) to the designated file? To be specific, if the file being output generates a score/number which needs to be subsequently input into another file, how to you set up the output and input? Thannks a lot. bz -- To unsubscribe, e-

RE: hi

2005-09-27 Thread Thomas Bätzler
ZHAO, BING <[EMAIL PROTECTED]> asked: > How do you INPUT the output( of a file) to the > designated file? To be specific, if the file being output > generates a score/number which needs to be subsequently input > into another file, how to you set up the output and input? >

Re: hi

2005-09-27 Thread Xavier Noria
On Sep 26, 2005, at 22:20, ZHAO, BING wrote: Hi, How do you INPUT the output( of a file) to the designated file? To be specific, if the file being output generates a score/number which needs to be subsequently input into another file, how to you set up the output and input? L

Re: Need a list of files in a dir.

2005-09-27 Thread bright true
Hello , in your examples you're opening "files" not dir's , to open a directory use this instead opendir(DIR,$dirname) or die $!; my @content = readdir(DIR); closedir(DIR); then to read files inside it , for (@content){ print ; } that's it , if you need to remove ("." and "..") which means the

PERL's equivalent to an "include file"

2005-09-27 Thread Shelly Brown
I would like to include a PERL file within an html or asp file. How do I do that? I'm working on a Windows server. -- Shelly Brown

Re: PERL's equivalent to an "include file"

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Shelly Brown wrote: > I would like to include a PERL file within an html or asp file. How do I do > that? I'm working on a Windows server. You're looking for a templating framework. Perl offers several, including: Template Toolkit ("TT") HTML::Template HTML::Mason (or si

Re: PERL's equivalent to an "include file"

2005-09-27 Thread Shelly Brown
I would like to display the daily calendar information from a perl script: http://webapps.sbuniv.edu/daycal/ within an html page so it looks like this: http://www.sbuniv.edu/. Right now I have to manually enter the calendar information. I would like for it to be dynamic. Make sense? On 9/27/05, Sh

Re: PERL's equivalent to an "include file"

2005-09-27 Thread Wiggins d'Anconia
Please bottom post... Shelly Brown wrote: > I would like to display the daily calendar information from a perl script: > http://webapps.sbuniv.edu/daycal/ within an html page so it looks like this: > http://www.sbuniv.edu/. Right now I have to manually enter the calendar > information. I would lik

Re: PERL's equivalent to an "include file"

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Shelly Brown wrote: > I would like to display the daily calendar information from a perl > script: http://webapps.sbuniv.edu/daycal/ within an html page so it > looks like this: http://www.sbuniv.edu/. Right now I have to manually > enter the calendar information. I would l

Re: PERL's equivalent to an "include file"

2005-09-27 Thread Shelly Brown
Yes! That works. Thank you so much for your time. On 9/27/05, Chris Devers <[EMAIL PROTECTED]> wrote: > > On Tue, 27 Sep 2005, Shelly Brown wrote: > > > I would like to display the daily calendar information from a perl > > script: http://webapps.sbuniv.edu/daycal/ within an html page so it > > lo

Shift Question

2005-09-27 Thread Dave Adams
QUESTION: What is the purpose of the line "my $msg = shift;"? I am guessing it is for the @_ array but what list element is there to be shifted off? It seems that the shift function is in a lot of subroutines and I am confused as to their purpose. #!/bin/perl -w (my $PROGNAME = $0) =~ s/^.*\///;

Block Confusion

2005-09-27 Thread Ryan Frantz
Perlers, I'm struggling; I'm using WMI to monitor a few processes (kinda like my last disk monitor) but my output repeats the first process in a list for as many items as I have in the list. See below: use warnings; use strict; use Win32::OLE('in'); my $megaBytes = "1048576"; my $serverObj =

general retry function

2005-09-27 Thread Ing. Branislav Gerzo
Hi Perlers, I have one nice question for you, I was run into common problem: need to repeat certain number of times something, until is succesful. For example - download webpage, FTP upload, connect to some host and so on. I ask you for some general (or it can't be possible - FTP upload) function,

RE: Shift Question

2005-09-27 Thread Ryan Frantz
> -Original Message- > From: Dave Adams [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 27, 2005 5:17 PM > To: beginners perl > Subject: Shift Question > > QUESTION: What is the purpose of the line "my $msg = shift;"? I am > guessing it is for the @_ array but what list element is

RE: Shift Question

2005-09-27 Thread Ryan Frantz
> -Original Message- > From: Ryan Frantz > Sent: Tuesday, September 27, 2005 5:27 PM > To: Dave Adams; beginners perl > Subject: RE: Shift Question > > > > > -Original Message- > > From: Dave Adams [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, September 27, 2005 5:17 PM > > To:

Shift Question

2005-09-27 Thread Mulander
If I understood you question properly you want to know why people use shift in subrutines and how does shift work. I will try to make it short: shift works on lists, it removes the first element of the list ( the 0 indexed element ) and returns it as a lvalue ( if there are no more elements in a l

Re: Shift Question

2005-09-27 Thread Wiggins d'Anconia
Mulander wrote: > If I understood you question properly you want to know why people use > shift in subrutines and how does shift work. > > I will try to make it short: > shift works on lists, it removes the first element of the list ( the 0 > indexed element ) and returns it as a lvalue ( if there

Re: Shift Question

2005-09-27 Thread John W. Krahn
Mulander wrote: > If I understood you question properly you want to know why people use > shift in subrutines and how does shift work. > > I will try to make it short: > shift works on lists, it removes the first element of the list perldoc -q "What is the difference between a list and an array"

Re: Shift Question

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Dave Adams wrote: > What is the purpose of the line "my $msg = shift;"? In the context of subroutines, it copies the first scalar argument passed to the routine to the variable $msg. If more than one argument was passed, the others aren't touched by this statement -- as yo

eval without warnings

2005-09-27 Thread Bryan R Harris
I'd like to evaluate user input only where it makes sense, e.g. "2*(3+2)" ==> 10 "2*dog" ==> "2*dog" "mysquarefunction(2)" ==> 4 "3*mysquarefunction(2)" ==> 12 "some guy" ==> "some guy" I've tried: if ($val =~ m|[0-9]|) { $val = eval $val; } and { no warnings; eval { $val2 = eva

Re: general retry function

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Ing. Branislav Gerzo wrote: > Could be anyone so nice and write it ? I'm sure someone *could*, but I wouldn't count on it happening :-) > I have some snippets here, using eval {} and catch errors with calling > recursive sub, but I don't think thats the best option. That'

Re: eval without warnings

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Bryan R Harris wrote: > I'd like to evaluate user input only where it makes sense, e.g. > > "2*(3+2)" ==> 10 > "2*dog" ==> "2*dog" > "mysquarefunction(2)" ==> 4 > "3*mysquarefunction(2)" ==> 12 > "some guy" ==> "some guy" What happens when they put something in like "sys

how to use perl modules

2005-09-27 Thread Abhishek Dave
hello all, i've wrote a small test subroutine in my file name test.pm and in the same directory i worte a perl file in which i've to call this subroutine in this perl program I dont know how to use perl modules pls let me knwo abt that as it will solve my lots of problems test.pm sub ReturnVa

Re: general retry function

2005-09-27 Thread Wiggins d'Anconia
Ing. Branislav Gerzo wrote: > Hi Perlers, > > I have one nice question for you, I was run into common problem: > need to repeat certain number of times something, until is succesful. > For example - download webpage, FTP upload, connect to some host and > so on. > I ask you for some general (or it

Re: how to use perl modules

2005-09-27 Thread Wiggins d'Anconia
Abhishek Dave wrote: > hello all, > i've wrote a small test subroutine in my file name test.pm and in the same > directory i worte > a perl file in which i've to call this subroutine in this perl program > Capitals, punctuation, and full words are a good idea when posting to a public forum. Poor

Re: eval without warnings

2005-09-27 Thread Bryan R Harris
> On Tue, 27 Sep 2005, Bryan R Harris wrote: > >> I'd like to evaluate user input only where it makes sense, e.g. >> >> "2*(3+2)" ==> 10 >> "2*dog" ==> "2*dog" >> "mysquarefunction(2)" ==> 4 >> "3*mysquarefunction(2)" ==> 12 >> "some guy" ==> "some guy" > > What happens when they put somethin

Re: Block Confusion

2005-09-27 Thread Jeff 'japhy' Pinyan
On Sep 27, Ryan Frantz said: # list the processes to hunt for my @findProcesses = ( "putty", "firefox", ); foreach my $process (in $serverObj->InstancesOf("Win32_PerfFormattedData_PerfProc_Process")) { foreach my $matchProcess ( @findProcesses ) { if ( $process->{Name} =~ /$matchProcess/o

Re: eval without warnings

2005-09-27 Thread Jeff 'japhy' Pinyan
On Sep 27, Bryan R Harris said: "2*(3+2)" ==> 10 "2*dog" ==> "2*dog" "mysquarefunction(2)" ==> 4 "3*mysquarefunction(2)" ==> 12 "some guy" ==> "some guy" Here's a solution that works for the cases you've provided: sub try_eval { local $@; my $warning; local $SIG{__WARN__} = sub

RE: Block Confusion

2005-09-27 Thread Ryan Frantz
> -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 27, 2005 8:20 PM > To: Ryan Frantz > Cc: beginners perl > Subject: Re: Block Confusion > > On Sep 27, Ryan Frantz said: > > > # list the processes to hunt for > > my @findProcesses = (

how to make charts using GD

2005-09-27 Thread Aditi Gupta
Hello everybody, I have a perl code that generates a sequence of values which i want to plot on y-axis against 1,2,3... on x-axis. I've read that GD::Graph could be used for it. But I've never done modular programming. Also, I don't know how to install modules from CPAN. Are there any other easier

Re: how to use perl modules

2005-09-27 Thread Jabir Ahmed
--- test.pm --- package test; sub ReturnValue() { my $a=10; return ($a); } 1; # as a module usually has a return value --- call.pl -

RE: how to make charts using GD

2005-09-27 Thread Thomas Bätzler
Hello, Aditi Gupta <[EMAIL PROTECTED]> asked: > I have a perl code that generates a sequence of values which > i want to plot on y-axis against 1,2,3... on x-axis. I've > read that GD::Graph could be used for it. But I've never done > modular programming. Also, I don't know how to install >