RE: RE: matching INSIDE characters (regexp)

2003-05-28 Thread Jaschar Otto
ok, that shouldn't be that hard if every line is in the same format. open FILE,"somefile.log"; while () { $string = $_; $string =~ s/\[(\d{2})\/(\w{3})\/(\d{4}):(\d{2}):(\d{2}):(\d{2})\+\]//; } close FILE; $1 is the day, $2 the month $3 the year , $4 the hour $5 the minutes, $6 the s

RE: cgi LWP::Simple script and Apache

2003-05-28 Thread Dan Muey
Please reply to the list and not just to me so everyone can help/learn. First things first. Before you get into parseing the result of get() Make sure it's getting the right thing. 1) Can you open http://www.google.com/ in a browser on that machine? 2) use strict; always! 3) Do you get google'

RE: matching INSIDE characters (regexp)

2003-05-28 Thread Bob Showalter
Ben Crane wrote: > Jaschar Otto, > > Yep, you're right with the second guess :-) I didn't > explain it too well so apologies from me. Actually, > I'm creating a log file parser where the results can > be placed into a mysql database. > > Most log file analyzers use [15/Jan/2003:11:25:46 > +]

Re: encryption of perl script

2003-05-28 Thread James Edward Gray II
perldoc -q hide Explains the choices pretty well. The document is pretty negative and basically takes the "there is no totally secure method" angle, even while it explains what to try. It's right, of course, but my opinion is a little different. The people that get around things like the Filt

RE: matching INSIDE characters (regexp)

2003-05-28 Thread Ben Crane
Jaschar Otto, Yep, you're right with the second guess :-) I didn't explain it too well so apologies from me. Actually, I'm creating a log file parser where the results can be placed into a mysql database. Most log file analyzers use [15/Jan/2003:11:25:46 +] and split the date and time...but

RE: Virus help anybody!!!

2003-05-28 Thread Kipp, James
Have you tried AVG? http://www.grisoft.com/ -Original Message- From: SNAG [mailto:[EMAIL PROTECTED] Sent: Saturday, June 28, 2003 5:34 AM To: beginners Perl Subject: Virus help anybody!!! I know this group is not about virii, I'm just asking incase somebody found the answer. I have some

RE: catch errors

2003-05-28 Thread NYIMI Jose (BMB)
perldoc -f eval eval{ #your try } if($@){ #your catch } Be aware that eval "" and eval{} don't have the same behavior. José. > -Original Message- > From: Moshe [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 27, 2003 8:27 PM > To: [EMAIL PROTECTED] > Subject: catch error

RE: using @ARGV to get user-defined arguments

2003-05-28 Thread Bob Showalter
cbgb wrote: > ATM I can use @ARGV by forcing it to read specified files > (see sample below). But how can I turn it into a subroutine > that accepts any filenames and can be called within a script, eg: > &myroutine("fileA","fileB") ? > > thanks > Chris > > > #!/usr/bin/perl -Tw > > @ARGV=("te

RE: encryption of perl script

2003-05-28 Thread Jaschar Otto
> Sakthivel <[EMAIL PROTECTED]> 28.05.2003 10:31:09 >>> >Hi, >Is there any command to encrypt the perl script code. How about compiling it ? i don't know of any other possibility to make it unreadable. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: encryption of perl script

2003-05-28 Thread WC -Sx- Jones
On Wednesday, May 28, 2003, at 04:31 AM, Sakthivel wrote: Hi, Is there any command to encrypt the perl script code. No, why? Are you trying to hide your code? http://InSecurity.org/ _Sx ('>iudicium ferat //\ Have Computer - v_/_Will Hack... \|/ ___

RE: matching INSIDE characters (regexp)

2003-05-28 Thread Jaschar Otto
hmm... i re-read what you wrote and i think i guessed wrong in my first reply :-) you've got a string like abcdef[12/asdsad[32/asdas and you want both numbers ? you might be able to use : $string = "abcdef[12/asdsad[32/asdas"; $i = 0; while ($string =~ /\[(\d{2})\/) { $string =~ s/\[(\d

Re: Problems with URL parameters.

2003-05-28 Thread zentara
On Wed, 28 May 2003 01:00:51 -0500, [EMAIL PROTECTED] (Nicholas Davey) wrote: >The problem I am having is this: When I pass a parameter via a URL, my >script isnt picking it up, and my if statement is working. > >Here is the basic idea behind my script (all PERL standards are followed on >my host.

RE: matching INSIDE characters (regexp)

2003-05-28 Thread Jaschar Otto
>>> Ben Crane <[EMAIL PROTECTED]> 28.05.2003 13:24:28 >>> >Anyone know how to match characters that occur within >a set of other characters? >e.g: [15/ I want the 15...get [15/ using /\[(\d{2}\/)/ >which is what it gives me, but I want to match >starting/ending characters anywhere within a string >

matching INSIDE characters (regexp)

2003-05-28 Thread Ben Crane
Hi all, Anyone know how to match characters that occur within a set of other characters? e.g: [15/ I want the 15...get [15/ using /\[(\d{2}\/)/ which is what it gives me, but I want to match starting/ending characters anywhere within a string and take the value between the start/end characters?

Re: global variable

2003-05-28 Thread Tassilo von Parseval
On Wed, May 28, 2003 at 12:05:41PM +0200 anthony wrote: > i have a script with my modules. > i.e > #!/usr/bin/perl > use strict; > use warnings; > use Config::IniFiles; > my $cfg = new Config::IniFiles( -file => "/path/configfile.ini" ); > use lib '/path/tomy/Module'; > use MyModule; > use TestMod

global variable

2003-05-28 Thread anthony
Hi, i have a script with my modules. i.e #!/usr/bin/perl use strict; use warnings; use Config::IniFiles; my $cfg = new Config::IniFiles( -file => "/path/configfile.ini" ); use lib '/path/tomy/Module'; use MyModule; use TestModule; now i would like $cfg to be global , so that all module can use th

Virus help anybody!!!

2003-05-28 Thread SNAG
I know this group is not about virii, I'm just asking incase somebody found the answer. I have some backups zipped which is apparently infected with a trojan called Flashkiller.b, why I say apparently, is cause not Norton AV, McAfee, or any of those detect the virus/trojan. I use AntiVir avai

encryption of perl script

2003-05-28 Thread Sakthivel
Hi, Is there any command to encrypt the perl script code. Regards, sakthi.

Problems with URL parameters.

2003-05-28 Thread Nicholas Davey
Hi. Im not totaly new to programming in general. I am fairly new to PERL though. I have used PERL to do many useful things on my RH system, but I have never done anything on the web. I have my own website *under construction* which I am writing in PERL. I was using ColdFusion, but my host doesnt s

using @ARGV to get user-defined arguments

2003-05-28 Thread cbgb
---apologies if this turns out to be a double-posting--- ATM I can use @ARGV by forcing it to read specified files (see sample below). But how can I turn it into a subroutine that accepts any filenames and can be called within a script, eg: &myroutine("fileA","fileB") ? thanks Chris #!/usr/bin/

Re: point of references

2003-05-28 Thread Dick Penny
> To really understand how they work, you just gotta use them. It is great for > passing arrays or hashed to subroutines, etc... > My major use of references is to pass back anonymous( sp?) arrays or hashes from OO modules. Dick Penny -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: How do I check disk space through Perl?

2003-05-28 Thread Jaschar Otto
use Win32::OLE; $wmi = Win32::OLE->GetObject ("winmgmts://$server/root/cimv2"); ($harddisk) = (in $wmi->InstancesOf ('Win32_DiskDrive')); $sectors = $harddisk->{TotalSectors}; $bytes = $harddisk->{BytesPerSector}; $total = $sect * $byte; $total = $tota/1024;# B -> KB $total = $tota/102

RE: GetOpt Help

2003-05-28 Thread NYIMI Jose (BMB)
perldoc perlpod or http://www.perldoc.com/perl5.8.0/pod/perlpod.html No i have never used pod to document my code, however many modules from cpan do. Never really wanted till now ;) For the help, i use the here doc as follow for instance : my $helptxt=< -of [-f] [-h] -f force blabla -h display t

using @ARGV to get user-defined arguments

2003-05-28 Thread cbgb
ATM I can use @ARGV by forcing it to read specified files (see sample below). But how can I turn it into a subroutine that accepts any filenames and can be called within a script, eg: &myroutine("fileA","fileB") ? thanks Chris #!/usr/bin/perl -Tw @ARGV=("textfile","craig"); foreach $arg (@ARGV

RE: Calculate the values of 3 arrays to one

2003-05-28 Thread NYIMI Jose (BMB)
Without any optmisation :), try this: #!/usr/bin/perl -w use strict; use Data::Dumper; my @array1 = ("0", "5", "7"); my @array2 = ("10", "20", "21"); my @array3 = ("2", "25", "4"); my @res=(); my $i; for($i=0;$i<3;$i++){ $res[$i]=$array1[$i] + $array2[$i] + $array3[$i]; } print Dumper([E

RE: qotd boiler

2003-05-28 Thread Cy Kurtz
Hi, Charles, thanks for your help. It happened today. The nice people at 'The Quotations Page' sent me some quotes that exceeded one line. My script went down in flames. Nothing serious, just misplaced text. Fortunately your script worked great(woohoo!). Cy P.S. I'm still kinda busy with some non