array

2001-09-03 Thread nafiseh saberi
hi. I want to write program that read from log file of system in ISP and report some special field in web. (with perl). do I put all information in log file ,to associative array and work on it??? I read the help of array in perl.com but mot enough . can you help me?? --

RE: Changing Variables

2001-09-03 Thread Govinderjit Dhinsa
> I want to print a weekly transaction statement using perl. I have written > most of the perl code but I incorporated the dates I needed within the > program. i want the program to be more interactive. It needs to ask the > user to enter the start and end dates for the statement. these will be >

Graphical interface

2001-09-03 Thread Dusan Juhas
Hi, are there any more perl graphical interfaces than Tk? Tk seems to have problems with Czech localization and also it's a bit old-fashioned. (I apologize all Tk users) It must be runnable on Windows and Unix platforms. Qt and Gtk seem to be useful only for C(++) programs but not for perl. Is it

creating a daemon

2001-09-03 Thread peter grotz
hi all, I need a program to run like a daemon. it should do: look in a directory for some flag-files, if some exist the daemon should start other programs, then the daemon should sleep for let´s say 5 seconds and begin again... how must I create such a daemon and how can I stop him working with a

Re:Parse a file

2001-09-03 Thread Jorge Goncalvez
Hi, folks, I have to parse a file which looks like this: dhcpd : LOG_INFO : DHCPDISCOVER from 52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00 via eth0 and I wanted to extract only this 52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00 How can I do this with R.E. Thanks. -- To unsubscribe, e

RE: Parse a file

2001-09-03 Thread John Edwards
$data = "dhcpd : LOG_INFO : DHCPDISCOVER from 52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00 via eth0"; ($new) = $data =~ /from\s+(.*)\s+via/; print $new; That should do it, as long as the data string you are looking for is consistently surrounded by "from" and "via"; HTH John -Original

Re: creating a daemon

2001-09-03 Thread register
i did not understand the part about working with samll scripts but you could do somehting like this ... not tested #!perl while(1) { if ( -s $flag_file_location ) { system($command_to_execute) or warn "Cannot execute command\n";

error... help

2001-09-03 Thread agc
#!/usr/bin/perl #Cambiar la linea anterior para que corresponsa a su sistema #ejecutando "which perl" le dice conde esta el ejecutable unshift (@INC, $ENV{'W2H_POSTPROCESS_PATH'}); require "XXX_cfg.pl"; # config file $database="test"; # Open input and output files */ open(INFILE,"<$ARGV[0]");

solved the prpblem but... please

2001-09-03 Thread agc
well I solved the thng, but the thing is that I am only reading the very first line... it is suppouse to read all the lines that the document have... I know I have a mistake some where but belive me in my head the if while and so on are on a loop. here is the code #!/usr/bin/perl #Cambiar la l

Re: solved the prpblem but... please

2001-09-03 Thread Nigel Wetters
buffer1 is undefined, and so the line print OUTFILE "$buffer1"; prints nothing. A good idea when having problems such as this is to run the program using warnings - change your first line to #!/usr/bin/perl -w --Nigel >>> agc 09/03/01 03:31pm >>> well I solved the thng, but the thing

Re: creating a daemon

2001-09-03 Thread Gary Stainburn
Hi all, I seem to remember a long time ago, a small guide to creating a daemon, wich included such topics as detaching stdin/out/err from the starting tty, chdiring to root so as not to prevent unmounting /home etc. Does this ring a bell with anyone? Gary On Monday 03 September 2001 2:46 pm,

RE: Dates

2001-09-03 Thread Govinderjit Dhinsa
> I want to print a weekly transaction statement using perl. > It should ask the user to enter the start date and the end date > e.g:$start_date = 30/08/01(dd/mm/yy) > > $end_date = 05/09/01 > This information will filter through a transactions file to print out the > statement within

why doesn't this work

2001-09-03 Thread dan radom
I'm very new to perl. I have been trying to reweite some of my shell scripts to learn the language. Here's what I've got... #!/usr/local/bin/perl -w if ( $#ARGV+1 !=2 ) { print "\n"; print "usage cat.pl port up\/down\n"; print "\n"; exit; } chomp( $port = $ARG

Re: why doesn't this work

2001-09-03 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 3, dan radom said: >if ( $#ARGV+1 !=2 ) { That's better written as: if (@ARGV != 2) { >print "\n"; >print "usage cat.pl port up\/down\n"; >print "\n"; >exit; >} >#if (( $status ne 1 ) || ( $status ne 2 )) { >#print "\n"; >#print "port s

RE: why doesn't this work

2001-09-03 Thread John Edwards
unless ( $status == (1 || 2) ) { print "\nport status must be either up or down\n\n"; exit; } else { system("/usr/bin/snmpset hostname password interfaces.ifTable.ifEntry.ifAdminStatus.$port i $status"); } Your commented lines were not woking because you were checking usin

Re: why doesn't this work

2001-09-03 Thread dan radom
Thanks. That got it. dan * Jeff 'japhy/Marillion' Pinyan ([EMAIL PROTECTED]) wrote: > On Sep 3, dan radom said: > > >if ( $#ARGV+1 !=2 ) { > > That's better written as: > > if (@ARGV != 2) { > > >print "\n"; > >print "usage cat.pl port up\/down\n"; > >print "\n"; >

RE: why doesn't this work

2001-09-03 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 3, John Edwards said: >unless ( $status == (1 || 2) ) { >print "\nport status must be either up or down\n\n"; >exit; >} else { > system("/usr/bin/snmpset hostname password >interfaces.ifTable.ifEntry.ifAdminStatus.$port i $status"); >} > >The above says "unless status

Re: why doesn't this work

2001-09-03 Thread smoot
> dan radom <[EMAIL PROTECTED]> said: You have a logic error. The if test should be: if (! ( $status eq 1 || $status eq 2)) { > #if (( $status ne 1 ) || ( $status ne 2 )) { A few other "style" pointers follow: You can replace this: if ( $#ARGV+1 !=2) { with if ( @ARGV != 2) { @arrayname

Re: Graphical interface

2001-09-03 Thread Michael D. Risser
On Monday 03 September 2001 07:15 am, Dusan Juhas wrote: > Hi, > > are there any more perl graphical interfaces than Tk? > Tk seems to have problems with Czech localization and also > it's a bit old-fashioned. (I apologize all Tk users) > It must be runnable on Windows and Unix platforms. > Qt and

Re: why doesn't this work

2001-09-03 Thread smoot
> [EMAIL PROTECTED] said: > > dan radom <[EMAIL PROTECTED]> said: > > You have a logic error. The if test should be: > > if (! ( $status eq 1 || $status eq 2)) { Well, I know better than that. Should be "=" not "eq". -- Smoot Carl-Mitchell Consultant -- To unsubscribe, e-mail: [EMAIL PR

setting permissions in Win98

2001-09-03 Thread Danny Reyna
how do i set permissions "within" the cgi script.. as when i trying to chmod using an ftp client doesnt work for me... using win98 -- i need to set permissions to be able to have people submit to a flat file databse using HTML forms and 2 CGI scripts. your help is appreciated. Danny

Form Results

2001-09-03 Thread Allison Davis
Can anyone tell me if I can include in my script an option to right the results of the form to an an individual txt file for each person filing out the form, so I will have individual text files on our server until I delete them. We are accepting applications on the web and I want individual file

Re: Form Results

2001-09-03 Thread Randal L. Schwartz
> "Allison" == Allison Davis <[EMAIL PROTECTED]> writes: Allison> Can anyone tell me if I can include in my script an option to Allison> right the results of the form to an an individual txt file Allison> for each person filing out the form, so I will have Allison> individual text files on ou

Re: creating a daemon

2001-09-03 Thread victor
There is a big section in the Perl Cookbook( O'Reilly) that show you step by step detail of how to create a daemon. peter grotz wrote: > hi all, > I need a program to run like a daemon. it should do: > look in a directory for some flag-files, if some exist the daemon > should start other prog

cron, perl and iTunes

2001-09-03 Thread Chris Garaffa
Hey everyone, Here's a question concerning Apple's iTunes, cron, and tying them together with perl. I want iTunes to be quit at 5:30 AM monday through friday. OK, so I know how to setup a crontab file. That's no problem. I can get iTunes to quit (using kill), provided I know its pid. So, I go

Using different versions of a module

2001-09-03 Thread Roland Praehofer
Hi, I'd like to use a newer version of the GD module Is it possible to have two versions of it on the same machine, as the System Admin is not willing to update ? I've installed it into my home directory but now, if I try to use it in my programs I get errors like: GD object version 1.19 does

Multi dimension arrays

2001-09-03 Thread Gordon Barr
Is there a way of handling these in perl? (I am converting some programs from UNIX awk that make extensive use of this feature). Any advice would be much appreciated. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Killing a deamon

2001-09-03 Thread Daniel Falkenberg
List, Is there a quiker way to restart a perl daemon in UNIX rather than having to do a kill -9 PID then start the service again using ./name_of_file.pl. Is there any easy way like restarting the httpd daemon service httpd restart? Kind Regards, Daniel Falkenberg -Original Message- Fr

References?

2001-09-03 Thread Bert de Jong
Hi all, I'm reading a beginners tutorial on Perl. While I read the digression on true/false values, there was something like: "For the sake of completeness, it should also be mentioned that references always count as true. However, it is beyond the scope of this beginners book to discuss refe

RE: References?

2001-09-03 Thread HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)
You will find a lot more than I would be able to type quickly by looking at the 'perlref' manpage. Just type perldoc perlref at your shell prompt. -- Marcus | -Original Message- | From: Bert de Jong [mailto:[EMAIL PROTECTED]] | Sent: Tuesday, September 04, 2001 9:09 AM | To: [EMAIL P

Re: Multi dimension arrays

2001-09-03 Thread Pradeep Reddy
hi, You can simulate multi-dimensional arrays using references. For information about references see 'perlreftut' and 'perlref' manpages. eg. @array = ( [ "hello","world"]; [ "quick","brown"]; ); is a two dimentional array. if you want to acces