Serious pattern matching.

2002-06-13 Thread Langa Kentane
Greetz, I need some help with IP address matching. For instance I have a log with an IP address 10.3.2.1 and 10.3.4.5. I want to match all IP addresses in the 10.3.0.0 mask 255.255.0.0 range. How would I do this? Another thing is I would like to match any IP address on the log file for instance I

perl with unix commands

2002-06-13 Thread Ronnie Livingston
Hi, I have a textfile with a list of gifs (ex. planet.gif, star.gif)and I have a perl program which grabs one of the filenames randomly. What I want to do is use the filename and copy it to random.gif but I keep getting the error: cp: cannot access planet.gif I have been using this in my perl p

Re: email body question still

2002-06-13 Thread Sudarsan Raghavan
tom poe wrote: > Hi: I really appreciate the input on separating $header and $body from those > on the list so far. The suggested modules all seem too complicated to me, so > I continue to read Chapter One, over and over. In the meantime, I think I > have something close to what I want to acco

email body question still

2002-06-13 Thread tom poe
Hi: I really appreciate the input on separating $header and $body from those on the list so far. The suggested modules all seem too complicated to me, so I continue to read Chapter One, over and over. In the meantime, I think I have something close to what I want to accomplish, but it still

RE: Searching for a specific spot on a page

2002-06-13 Thread Troy May
Thank you Shawn! That worked too! You guys are great! :) Troy -Original Message- From: Shawn [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 9:19 PM To: Troy May; [EMAIL PROTECTED] Subject: Re: Searching for a specific spot on a page my $string="someHTML"; my @split=split(/

Re: Searching for a specific spot on a page

2002-06-13 Thread Shawn
my $string="someHTML"; my @split=split(/()/,$string); my $newstring=@split[0,1].$replacement.@split[3,4]; or my $string="someHTML"; $string=~s/(.*?).*?(.*)/$1$replacement$2/ms; Not sure if the 'm' modifier is needed on the substitution... Anyway, these should do what you are looking for...but

RE: Searching for a specific spot on a page

2002-06-13 Thread Troy May
Thank you, that worked! :) By the way, I'm thinking of a new thing that I want to do. How would I alter this to open another page the same way, but replace the html code BETWEEN two "" with the same $html? I could rename the second "" if that would be easier. But I'm looking at regexes to do

Re: "lazy" variable declaration

2002-06-13 Thread Todd Wade
"David T-G" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hmmm... Well, I'll grant you that, but what about the example above? It > would only be undef for the first N lines that are short, and once it > gets loaded then it will get reset instead. It seems

RE: scripting windoze

2002-06-13 Thread Timothy Johnson
Look for the Win32::SetupSup module. I think it has the functions you need. -Original Message- From: Reed Lawson To: [EMAIL PROTECTED] Sent: 6/13/02 11:17 AM Subject: scripting windoze Hi, Is there a way to: Launch a win32 app Send keyboard commands to it wait

Re: How to open STDOUT ?

2002-06-13 Thread John W. Krahn
Todd Wade wrote: > > "Franck Fasano" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > I have recuperated a module from the web and I interfaced > > with it but STDOUT is closed . > > If I do a : print STDOUT "hello\n" in my script, nothing appeared . > >

Re: "lazy" variable declaration

2002-06-13 Thread Todd Wade
"Janek Schleicher" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > use strict; use warnings; wasn't made only to make the Perl Community luckier. > It can help to avoid typical mistakes like > (a) mispelling of a variable > (b) using of an undefined variab

Re: How to open STDOUT ?

2002-06-13 Thread Todd Wade
"Franck Fasano" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I have recuperated a module from the web and I interfaced > with it but STDOUT is closed . > If I do a : print STDOUT "hello\n" in my script, nothing appeared . > > I don't know where STDOU

Re: Syntax of mkdir()

2002-06-13 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hallo! Hello, > I'm a novice Perl programmer. I want to make a subdirectory in the > path: /data/home/collette/exponat. My code looks like this: > > $invnummer = $FORM{'invnummer'}; > $path = "/data/home/collette/exponat"; > chdir(path); You are missi

Re: Syntax of mkdir()

2002-06-13 Thread bss96kci
Hallo! I'm a novice Perl programmer. I want to make a subdirectory in the path: /data/home/collette/exponat. My code looks like this: $invnummer = $FORM{'invnummer'}; $path = "/data/home/collette/exponat"; chdir(path); if ($invnummer ne "") { mkdir($invnummer, 0755) || die ("Cannot mkdir $invnumm

Re: display a section of text

2002-06-13 Thread Jenda Krynicky
From: "Michael Pratt" <[EMAIL PROTECTED]> > Well that doesnt give me what I want. I want to search a text file > for a Key word then display the contents to a second keyword. > > For example take the above paragraph and display just ' want to search > a text file for a Key word ' thats it. I

Re: display a section of text

2002-06-13 Thread Michael Pratt
Well that doesnt give me what I want. I want to search a text file for a Key word then display the contents to a second keyword. For example take the above paragraph and display just ' want to search a text file for a Key word ' thats it. Thanks Mike "Jenda Krynicky" <[EMAIL PROTECTED]> wr

Re: accessing database via network using DBI

2002-06-13 Thread learn perl
Hi Jenda, Thanks for your info~ it wasn't on the book any where? =) as for DSN lookup I have my own code to search for available drivers ^^ Eric #begin code #!d:\perl\bin\perl.exe -w #This tool is used to check for connection strings to the #avai

Re: accessing database via network using DBI

2002-06-13 Thread Jenda Krynicky
From: learn perl <[EMAIL PROTECTED]> > Thanks, that's what I thought of doing. But is there a way to connect > to the remote database (MS SQL server) w/o going thru DSN? $db = DBI->connect( 'DBI:ODBC:Driver=SQL Server; Server=The_name_or_IP_of_Server; Database=D

Re: Formatting output

2002-06-13 Thread John W. Krahn
Frank Newland wrote: > > I want to format the output of my database query. > > Current code > while (@row =$sth->fetchrow() ) { > print join(',',@row); > } > > Results > 1.38, .0396,.0076 > > Desired Results > 1.38, 0.0396, 0.0076 $ perl -le'print join ", ", map { sprintf "%.4f", $_ } ( 1

Re: accessing database via network using DBI

2002-06-13 Thread learn perl
Thanks, that's what I thought of doing. But is there a way to connect to the remote database (MS SQL server) w/o going thru DSN? Thanks Eric On Thu, 13 Jun 2002, Jenda Krynicky wrote: > From: learn perl <[EMAIL PROTECTED]> > > > Hi folks, need some help in accessing a ODBC database (SQL serve

Re: Controlling Novell products with Perl

2002-06-13 Thread Bill Akins
I would also be interested in seeing what others have come up with. Bill Akins, CNE Sr. OSA Emory Healthcare (404) 712-2879 - Office 12674 - PIC [EMAIL PROTECTED] >>> "Nigel Peck" <[EMAIL PROTECTED]> 06/13/02 04:03AM >>> Does anyone have experience of using Perl to control any Novell product

Re: accessing database via network using DBI

2002-06-13 Thread Jenda Krynicky
From: learn perl <[EMAIL PROTECTED]> > Hi folks, need some help in accessing a ODBC database (SQL server) > using DBI via the nextwork. > > usually, if the database is on local machine, I just use the > datasource $dbh=DBI->connect("DBI:ODBC:databasename",$username, > $password, %attr); > > but

accessing database via network using DBI

2002-06-13 Thread learn perl
Hi folks, need some help in accessing a ODBC database (SQL server) using DBI via the nextwork. usually, if the database is on local machine, I just use the datasource $dbh=DBI->connect("DBI:ODBC:databasename",$username, $password, %attr); but how do I complete this connection if the database is

Update ODBC

2002-06-13 Thread Ned Cunningham
I am trying to update an Access database table field with a increment number. I cant seem to place the update piece in the right place. Is this the right path to take? Snip #!/usr/bin/perl use Win32::ODBC; $DSN = "KIDSN"; $Dir = "E:/kimcon/conv/"; $DBase = "Ki720.mdb"; $Driver = "Microsoft Acc

scripting windoze

2002-06-13 Thread Reed Lawson
Hi, Is there a way to: Launch a win32 app Send keyboard commands to it wait for it to finish close it from perl? I'm making a CDRW every day for testing and I am tired of running my perl based build script starting Easy CD Creator start dis

Re: display a section of text

2002-06-13 Thread Jenda Krynicky
From: Mike <[EMAIL PROTECTED]> > How can I scan a text file for a key word then display it down to a > second keyword. I know in VB the command is somthing like instr() If you want a direct counterpart of the VB's inStr() then it's index() perldoc -f index (This is supposed to be run.

Re: Formatting output

2002-06-13 Thread Jeff 'japhy' Pinyan
On Jun 13, Frank Newland said: >Results >1.38, .0396,.0076 > >Desired Results >1.38, 0.0396, 0.0076 > >$row[0] = sprintf("%04d",$row[2]); ## results in ==> 0. >$row[1] = sprintf("%0d.%04d",$row[4]); ## results in ==>0. %d is for INTEGERS. You have floating points, so use %f. -- Jef

Re: Formatting output

2002-06-13 Thread Ovid
> I want to format the output of my database query. > Current code > while (@row =$sth->fetchrow() ) { > print join(',',@row); > } > > Results > 1.38, .0396,.0076 > > Desired Results > 1.38, 0.0396, 0.0076 Frank, It's tough for me to be sure exactly what you are wanting for formatting, so

Re: Killing Idle Users

2002-06-13 Thread John W. Krahn
Anthony Akens wrote: > > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > > > > "John W. Krahn" wrote: > > > > > > #!/usr/bin/perl -w > > > use strict; > > > > > > my $results = '/home/danb/killemresults'; > > > open RES, '>>', $results or die "Cannot open $results: $!"; > > > print "\n" . localt

Formatting output

2002-06-13 Thread Frank Newland
All, I want to format the output of my database query. Current code while (@row =$sth->fetchrow() ) { print join(',',@row); } Results 1.38, .0396,.0076 Desired Results 1.38, 0.0396, 0.0076 Here's what I've tried.. but none of these formats appear $row[0] = sprintf("%04d",$row[2]); ##

Re: perl EXCEL app/Win32::OLE

2002-06-13 Thread M z
Dear Sir, Thanks again. could you please help me do something very basic again as you saved me before. I'm trying to retrieve a certain row, column, for example A1. instead of traversing each row and column I want to have control over specific cells and print out a specific cell. Do you know w

RE: Win32 reg?

2002-06-13 Thread Timothy Johnson
Hmm. I"m in training all week, and I feel so powerless without my tools. If I remember correctly, then what you need to do is find the W2k key where the NICs are enumerated and retrieve a list of GUIDs, then head back to the key below and use the information you just got to find and change the

RE: Killing Idle Users

2002-06-13 Thread Akens, Anthony
This solution seems to kill anything, here's a snippet of the log. As you can see, it's hitting things low idle times. (I of course commented out the kill line) mmorgan killing process idPID 80350 on pts/0 because minutes equal 1 CLanko killing process idPID 109034 on pts/1 because

Re: literal to regex

2002-06-13 Thread Jenda Krynicky
From: Nikola Janceski <[EMAIL PROTECTED]> > I want to convert a bunch of strings to regexs but I want all special > characters to be interpreted as themselves literally. so . will be \. > and * will \*. > > so what do I need to change here: > > my @idl_object_ext = map { qr/$_/ } > qw( _g.h s

RE: literal to regex

2002-06-13 Thread Shishir K. Singh
Think you need to use \Q$string\E -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:05 AM To: Beginners (E-mail) Subject: literal to regex I want to convert a bunch of strings to regexs but I want all special characters to be interpret

literal to regex

2002-06-13 Thread Nikola Janceski
I want to convert a bunch of strings to regexs but I want all special characters to be interpreted as themselves literally. so . will be \. and * will \*. so what do I need to change here: my @idl_object_ext = map { qr/$_/ } qw( _g.h s_g.cc c_g.cc ); Delivery Queue

How to open STDOUT ?

2002-06-13 Thread Franck FASANO
Hi, I have recuperated a module from the web and I interfaced with it but STDOUT is closed . If I do a : print STDOUT "hello\n" in my script, nothing appeared . I don't know where STDOUT is closed and how to re-open it ? If someone have an idea... ? Thanks in advance. Franck. -- To unsubscri

RE: Changing a map on an HL server via Perl

2002-06-13 Thread Ron Powell
Some asking around on the hlds_linux mailing list produced this: http://kkrcon.sourceforge.net Its very cool :) Ron > -Original Message- > From: Joey Tesmer [mailto:[EMAIL PROTECTED]] > Sent: Saturday, June 08, 2002 5:08 PM > To: [EMAIL PROTECTED] > Subject: Changing a map on an HL se

RE: Win32 reg?

2002-06-13 Thread Langa Kentane
I tried that but unfortunately does not seem to have an effect on it. If you look further down the structure under interfaces that's where i should be setting the DNS server but unfortunately that will not be the same from computer to computer and I have not been able to find a way to determine th

Re: Hash reference

2002-06-13 Thread Chas Owens
On Wed, 2002-06-12 at 23:30, W. Huang wrote: > Hi, > > I have a refence to a hash, which is $hashref. I want to print out the > name of the hash ( which is "%hash" ) from $hashref, but don't know how. > Could you please help? thanks! > > #- > %hash= { >apple => "red", >bana => "yell

Re: perl EXCEL app/Win32::OLE

2002-06-13 Thread Arul, Rex\(NEA-IMAP\)
perl EXCEL app/Win32::OLEYou should have your pathSeparatorChar as "\\" and not "/". Since you are using Microsoft's Excel Engine, the Excel APIs are very strict about the path syntax and therefore, Perl's separatorChar of "/" (forward slash) will not work! Cheers, Rex - Original Message -

Re: Searching for a specific spot on a page

2002-06-13 Thread Ramprasad A Padmanabhan
Do it this way if( open(IN,$file)) { local($/)=undef; $filestr = ; } close IN; $SEARCH = ''; $filestr=~s/$SEARCH/$SEARCH $HTML/; open(OUT,">$file") || die "$!"; print OUT $filestr; close OUT; Troy May wrote: > Hello, > > I'm trying to do a news feed type of script from an admin page.

perl EXCEL app/Win32::OLE

2002-06-13 Thread M z
Dear all, i have a simple and silly question really..I downloaded this from the web, tried it, checked several times to ensure that my file location was correct and still had problemsthe error message is very obvious but I've checked file location SEVERAL times...please help...oh yeah, I do h

Re: Writing to an existing MS Excel file

2002-06-13 Thread Jenda Krynicky
From: "Rob" <[EMAIL PROTECTED]> > Does anyone have any advice on how to write to an EXISTING MS Excel > file? The goal is to have a script update values in an excel file. > > Thanks, > Rob use Win32::OLE; $excel = new Win32::OLE 'Excel.Application', 'quit()'; #$excel->{Visible} = 1; $excel->Ope

Re: Hash reference

2002-06-13 Thread Jenda Krynicky
From: "W. Huang" <[EMAIL PROTECTED]> > I have a refence to a hash, which is $hashref. I want to print out the > name of the hash ( which is "%hash" ) from $hashref, but don't know > how. Could you please help? thanks! > > #- > %hash= { >apple => "red", >bana => "yellow", > }; > $has

Controlling Novell products with Perl

2002-06-13 Thread Nigel Peck
Does anyone have experience of using Perl to control any Novell products such as Netware, eDirectory (NDS) etc. I don't have a specific requirement at present but we do a lot of Novell stuff and I am interested to know what can be/has been done. Apologies if this question is a bit general but I

Re: Setting NT/Win2k networking params

2002-06-13 Thread Nigel Peck
You should be able to do this through Windows Management Instrumentation (WMI) which is a service that you will need to start on 2K and a download for NT (http://www.microsoft.com/scripting/ I think). This opens up an object oriented interface to doing just about anything you want to Windows. I h

Re: How to read formulas from an Excel file

2002-06-13 Thread Felix Geerinckx
on Thu, 13 Jun 2002 00:20:25 GMT, [EMAIL PROTECTED] (Rob) wrote: > I need to write to an existing excel file, which is not supported > by any existing module. Did you check out Win32::OLE? -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT