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??
--
> 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
>
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
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
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
$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
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";
#!/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]");
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
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
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,
> 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
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
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
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
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";
>
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
> 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
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
> [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
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
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
> "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
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
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
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
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]
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
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
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
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
31 matches
Mail list logo