Re: using perl in a c code

2003-12-02 Thread Manish Uskaikar
I am a student of perl, who is amazed by the power of perl, when it comes to regular expressions. I have learned Omnimark / flex and many other tools, but found that Perl is better than all(This is my personal opinion). Let me assure the group that it is not for any harmful use. I am trying to pars

Calling a program in win32 with spaces in the path to the .exe

2003-12-02 Thread PerlDiscuss - Perl Newsgroups and mailing lists
How do you handle spaces in a system call to an .exe @args = (C:/Program Files/Total War/Medieval - Total War/Medieval_TW.exe"); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[Fwd: log file parser into a database]

2003-12-02 Thread Thorsten Scherler
--- Begin Message --- Hello, I am looking for information about reporting of different log-files. Something like http://www.logreport.org/ or http://www.mrunix.net/webalizer/. It should be able to analysis FTP, LDAP, http, Sendmail... To get started I am looking for a "parser" that reads the lo

Re: using perl in a c code

2003-12-02 Thread Ramprasad A Padmanabhan
On Tue, 2003-12-02 at 15:56, Manish Uskaikar wrote: > I am a student of perl, who is amazed by the power of perl, when it comes to > regular expressions. I have learned Omnimark / flex and many other tools, > but found that Perl is better than all(This is my personal opinion). Let me > assure the

RE: Encrypting PERL source code...

2003-12-02 Thread Ichim, Adrian N.
> -Original Message- > From: [EMAIL PROTECTED] > > Can anyone suggest where I might be able to find (hopefully a freeware > or shareware script..) a program that runs either on a windows system > or a PERL script that would "encrypt" a perl script by doing > such things as > removing whi

RE: Can' t read all bytes from Socket

2003-12-02 Thread Kipp, James
> I happened to be working on a TCP/IP server when this > hit my desk > and having Programming Perl open to the correct page, thought > I might as > well quote the "select..." line from the client code... > > select ((select(Server), $| = 1)[0]; > print Server "Howdy\n"; > $answer

Mechanize 500 connect failed

2003-12-02 Thread Paul Kraus
We discussed this some in an earlier thread but I have yet to resolve the issue. About 15% of them I run my script it will fail with this error. 500 Connect failed: Unknown error, Unknown Error at line ... The script is sound as it runs fine the rest of the time. I thought maybe its because the

precompiled regular expressions

2003-12-02 Thread mcdavis941
Hi, whats the right way to precompile a regular expression that gets used multiple times without changing. I don't think I can use /o, because the specific line of code which performs the pattern match is used to check various patterns against various values at various times. None the less,

Re: CGI - DBI

2003-12-02 Thread Todd W.
"Jerry Rocteur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > > I was wondering, can anyone point me to some precooked Perl CGI scripts > that already do data entry, I can browse and search my tables already > in CGI and DBD but I loathe to make what I've done look reasona

RE: Encrypting PERL source code...

2003-12-02 Thread Jenda Krynicky
From: "Ichim, Adrian N." <[EMAIL PROTECTED]> > > -Original Message- > > From: [EMAIL PROTECTED] > > > > Can anyone suggest where I might be able to find (hopefully a > > freeware or shareware script..) a program that runs either on a > > windows system or a PERL script that would "encrypt"

Re: using perl in a c code

2003-12-02 Thread Andrew Gaffney
Ramprasad A Padmanabhan wrote: I choose to write code in perl , unless I am forced to write it in C , either because my system just hangs if I use perl ( like some threaded applications ) or because my BOSS wants so ;-) That's why its nice to have a not-too-techie boss. I just throw all sorts of j

RE: using perl in a c code

2003-12-02 Thread Dan Muey
> Ramprasad A Padmanabhan wrote: > > I choose to write code in perl , unless I am forced to > write it in C , > > either because my system just hangs if I use perl ( like some > > threaded applications ) or because my BOSS wants so ;-) > > That's why its nice to have a not-too-techie boss. I j

RE: Net::SSH and Net::FTP?

2003-12-02 Thread Dan Muey
> > > > I would like to use SSH to login to a remote system, then > using FTP, > > upload a file from the remote machine to another machine which will > > display the data. If I can automate this process, I think > I'll be in > > great shape, tell me does this code seem like it would work >

Config file

2003-12-02 Thread Rod
What is the best way to read a config file for a perl script. I have some very ugly code that can do it, but I would like to find something cleaner. Thanks, Rod. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: precompiled regular expressions

2003-12-02 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > Hi, whats the right way to precompile a regular expression > that gets used multiple times without changing. > > I don't think I can use /o, because the specific line of code > which performs the pattern match is used to check various > patterns against various values

RE: Config file

2003-12-02 Thread Darbesio Eugenio
>>-Original Message- >>From: Rod [mailto:[EMAIL PROTECTED] >>Sent: martedì 2 dicembre 2003 16.55 >>To: beginners >>Subject: Config file >> >> >>What is the best way to read a config file for a perl script. I have >>some very ugly code that can do it, but I would like to find something >

RE: Config file

2003-12-02 Thread Tom Kinzer
I've used Config::IniFiles before and it works very nice, especially nice if you do a tie into a hash for all your values. http://search.cpan.org/~wadg/Config-IniFiles-2.38/IniFiles.pm -Tom Kinzer -Original Message- From: Rod [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003

RE: Config file

2003-12-02 Thread Bakken, Luke
> What is the best way to read a config file for a perl script. I have > some very ugly code that can do it, but I would like to find > something > cleaner. I've used Config::General for several production projects and it works quite well. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

Re: fixed width variable

2003-12-02 Thread Rob Dixon
Jeff Tillotson wrote: > > I have been searching for a way to do this and have not had any luck. > > I am using localtime() to determine the day of the month. I need to > make sure the variable it returns will always be 2 digits and padded > with zeros. For example currently it is like: > $var = (

RE: Mechanize 500 connect failed

2003-12-02 Thread Paul Kraus
This is really annoying I get the same issue when I run the script from a Linux server as I do an a windows xp workstation. > -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 02, 2003 8:31 AM > To: [EMAIL PROTECTED] > Subject: Mechanize 500 conne

RE: Config file

2003-12-02 Thread Dan Muey
> What is the best way to read a config file for a perl script. I have > some very ugly code that can do it, but I would like to find > something > cleaner. That depends very very much on the format of the config file. You could use open() to read the file and parse it's contents into some ki

breaking lines with perl

2003-12-02 Thread David T-G
Hi, all -- I have some database sql dumps that look like insert into table (f1,f2,f3) values (v1a,v2a,v3a),(v1b,v2b,v3b),... where of course the insert lines are whopping long. I would like to break these lines at the commas like insert into table (f1,f2,f3) values (v1a,v2a,v3a), (v1b,v2

New Folder Creation

2003-12-02 Thread Browning, James
Can someone point me in the right direction to find a simple script that will automate the creation of folders as needed? I've looked but can't find what I need. Pardon my ignorance, James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: breaking lines with perl

2003-12-02 Thread James Edward Gray II
On Dec 2, 2003, at 10:44 AM, David T-G wrote: Hi, all -- I have some database sql dumps that look like insert into table (f1,f2,f3) values (v1a,v2a,v3a),(v1b,v2b,v3b),... where of course the insert lines are whopping long. I would like to break these lines at the commas like insert into ta

Re: New Folder Creation

2003-12-02 Thread Rob Dixon
James Browning wrote: > > Can someone point me in the right direction to find a simple script that > will automate the creation of folders as needed? > > I've looked but can't find what I need. Hi James. Well, it depends on what you mean by 'as needed'. The 'mkdir' built-in will create a director

RE: New Folder Creation

2003-12-02 Thread Bob Showalter
Browning, James wrote: > Can someone point me in the right direction to find a simple script > that will automate the creation of folders as needed? See also the standard File::Path module. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: breaking lines with perl

2003-12-02 Thread David T-G
James, et al -- ...and then James Edward Gray II said... % % On Dec 2, 2003, at 10:44 AM, David T-G wrote: % % > insert into table (f1,f2,f3) values (v1a,v2a,v3a),(v1b,v2b,v3b),... ... % >break these lines at the commas like % > % > insert into table (f1,f2,f3) values (v1a,v2a,v3a), % > (v1b,

Script Exit Status

2003-12-02 Thread Paul Kraus
Is there a way to have a perl script exit with a status code? For instance I have ascript that calls another script via system("somescript"); I want to then be able to get the exit status of that script. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: Config file

2003-12-02 Thread drieux
On Dec 2, 2003, at 7:55 AM, Rod wrote: What is the best way to read a config file for a perl script. I have some very ugly code that can do it, but I would like to find something cleaner. I like the Config::General module someone has recommended, amongst the trade offs that one will have to resolv

RE: Script Exit Status

2003-12-02 Thread Kipp, James
> > > Is there a way to have a perl script exit with a status code? > > For instance I have ascript that calls another script via > system("somescript"); > > I want to then be able to get the exit status of that script. > > Paul Have you seen the perldoc for system ? The return value i

RE: Script Exit Status

2003-12-02 Thread Tim Johnson
Perldoc -f exit -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 9:32 AM To: [EMAIL PROTECTED] Subject: Script Exit Status Is there a way to have a perl script exit with a status code? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Law of Kharma - was Re: using perl in a c code

2003-12-02 Thread drieux
On Dec 2, 2003, at 6:58 AM, Andrew Gaffney wrote: Ramprasad A Padmanabhan wrote: I choose to write code in perl , unless I am forced to write it in C , either because my system just hangs if I use perl ( like some threaded applications ) or because my BOSS wants so ;-) That's why its nice to hav

Re: New Folder Creation

2003-12-02 Thread drieux
On Dec 2, 2003, at 8:46 AM, Browning, James wrote: Can someone point me in the right direction to find a simple script that will automate the creation of folders as needed? how exactly are you defining 'as needed'??? I have a cron job that I use to traverse where my blog has plonked stuff, and

Re: New Folder Creation

2003-12-02 Thread Rob Dixon
Bob Showalter wrote: > > Browning, James wrote: > > Can someone point me in the right direction to find a simple script > > that will automate the creation of folders as needed? > > See also the standard File::Path module. Of course you're probably right Bob. 'As needed' is likely to mean the crea

perl -ne 'if(/rcn/) {print "$ARGV: $_" unless -d}' *

2003-12-02 Thread Jerry Rocteur
Hi, I'm trying to use perl for most shell stuff and this is some of the stuff I'm using for grep .. perl -ne 'print "$ARGV: $_" if /jerry/i ' * perl -ne 'print if /jer{1,}y/i ' * perl -ne 'print unless /jer{1,}y/i ' * I'm enjoying this as I can do a lot more than I can with the old egrep on o

Re: Config file

2003-12-02 Thread Wiggins d Anconia
> > On Dec 2, 2003, at 7:55 AM, Rod wrote: > > Do you need to have complex configuration stuff, > if so why not lookt at the LibXml approach... > Particularly I suggest XML::Simple it allows you to both create your config file and read in your config file using standard Perl data constructs

RE: breaking lines with perl

2003-12-02 Thread Tom Kinzer
QA checks out, it does work with the data supplied. (Naivete will have to checked with the real data.) You could add some nice indent formatting if you like by adding a tab to Jame's expression: s/\),\s*/),\n\t/ -Tom Kinzer -Original Message- From: James Edward Gray II [mailto:[EMA

Re: perl -ne 'if(/rcn/) {print "$ARGV: $_" unless -d}' *

2003-12-02 Thread david
Jerry Rocteur wrote: > Hi, > > I'm trying to use perl for most shell stuff and this is some of the > stuff I'm using for grep .. > > perl -ne 'print "$ARGV: $_" if /jerry/i ' * > perl -ne 'print if /jer{1,}y/i ' * > perl -ne 'print unless /jer{1,}y/i ' * > > I'm enjoying this as I can do a lo

Re: perl -ne 'if(/rcn/) {print "$ARGV: $_" unless -d}' *

2003-12-02 Thread John W. Krahn
Jerry Rocteur wrote: > > Hi, Hello, > I'm trying to use perl for most shell stuff and this is some of the > stuff I'm using for grep .. > > perl -ne 'print "$ARGV: $_" if /jerry/i ' * > perl -ne 'print if /jer{1,}y/i ' * > perl -ne 'print unless /jer{1,}y/i ' * > > I'm enjoying this as I can

search and replace using regex

2003-12-02 Thread Saskia van der Elst
I have trouble executing a search and replace through all files in a certain directory. I want to replace " _A_Z.new") || die "Couldn't open file.new for writing!\n"; while(){ $_ =~ s/"_\ } The docs don't answer all my questions. Any help will be highly appreciated. I wish there was an a

RE: search and replace using regex

2003-12-02 Thread Tom Kinzer
You may want to start looking at some XML parsing modules, but assuming this is a quickie, I can point out that your problem is starting with the use of forward slash. Remember: your forward slash is your separator for the regular exp. Try replacing it with something else like | or % and go from

Reading files

2003-12-02 Thread mgoland
Hello All, I am trying to open a file once , and then duplicate it's File Handle. I am trying to workout example straight from FAQ5, with no luck. I will basicly trying to open a file, dup off a few handles and spread them across other processes. Here is the code #!/usr/bin/perl -w $file="./tex

RE: Reading files

2003-12-02 Thread Tom Kinzer
start off by putting some "or die"s on those file opens. where are you breaking or what is the error message? not sure what the problem is exactly. -Tom Kinzer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 9:53 AM To: [EMAIL PROTE

RE: Reading files

2003-12-02 Thread Dan Muey
> Hello All, > I am trying to open a file once , and then duplicate it's > File Handle. I am trying to workout example straight from > FAQ5, with no luck. I will basicly trying to open a file, dup > off a few handles and spread them across other processes. > Here is the code > Try use strict;

RE: Reading files

2003-12-02 Thread Tom Kinzer
I don't see $LOG being set...strict would catch that. -Tom Kinzer > Hello All, > I am trying to open a file once , and then duplicate it's > File Handle. I am trying to workout example straight from > FAQ5, with no luck. I will basicly trying to open a file, dup > off a few handles and sprea

Re: search and replace using regex

2003-12-02 Thread drieux
On Dec 3, 2003, at 12:25 PM, Saskia van der Elst wrote: I have trouble executing a search and replace through all files in a certain directory. I want to replace " _ Can I match a white-space? I have tried the following regex: s/ _\[..] I agree with Tom that you get better mileage by putting

network programming?

2003-12-02 Thread McMahon, Chris
Hello... I'm starting to encounter a number of pretty sophisticated network thingies of all descriptions, and I'd be interested in anyone's experience writing network sniffers, drivers, test harnesses, or other frobnabulators in Perl. In particular, I just discovered IO::Socket:

Re: network programming?

2003-12-02 Thread drieux
On Dec 2, 2003, at 1:22 PM, McMahon, Chris wrote: [..] In particular, I just discovered IO::Socket::Multicast on CPAN which looks very interesting, along with the rest of the IO::Socket family. I've got a little experience with TCP/IP servers in Perl, and I've been surfing ntop output on the corp

Re: network programming?

2003-12-02 Thread James Edward Gray II
On Dec 2, 2003, at 3:22 PM, McMahon, Chris wrote: Hello... Howdy. [snip background] I'd be interested in any descriptions, stories, warnings, links, or snippets about Useful Perl Network Stuff. If it's too OT, feel free to email me off the list. Network Programming with Perl is the book

Re: network programming?

2003-12-02 Thread Wiggins d Anconia
> > > Hello... > I'm starting to encounter a number of pretty sophisticated network > thingies of all descriptions, and I'd be interested in anyone's experience > writing network sniffers, drivers, test harnesses, or other frobnabulators > in Perl. > In particular, I just discover

RE: using perl in a c code

2003-12-02 Thread Dan Muey
> On Dec 1, 2003, at 6:22 AM, Ramprasad A Padmanabhan wrote: > [..] > > Instead Can I just embed this perl code in my c program > > I will be happy if someone can give some links to examples > on the net > > That is very very sexxy! I was rea

Perl underreporting bytes to write?

2003-12-02 Thread Marco Gazzetta
Greetings! I am using cdbkup to (what else?) backup my system on CD. It is quite the reliable program, and I was very surprised to find it had a nasty bug. In short, whenever I tried to perform a backup that didn't fit on one CD, the program would create ISO images that were consistently too la

Upgrade to 5.8 breaks IIS?

2003-12-02 Thread Clinton
Hi Upgraded my version of Perl (and the relevant modules) but it brings IIS down when I call a PerlScript via the net. Reverted to 5.6 and no problems. It's not critical. But if anybody has any ideas? ActiveState 5.8 on WinNT Server 6a Application Log Reports: An object call caused an exceptio

RE: Perl underreporting bytes to write?

2003-12-02 Thread Dan Muey
> Greetings! > > I am using cdbkup to (what else?) backup my system on CD. It I'm not familiar with cdbkup. Is it doen in Perl? Perhaps a link to info about it would be helpful. > is quite the > reliable program, and I was very surprised to find it had a nasty bug. > > In short, whenever I tr

Re: using perl in a c code

2003-12-02 Thread drieux
On Dec 2, 2003, at 3:40 PM, Dan Muey wrote: [..] What Id' really like to be able to do is compile it as simplepage.cgi and see if I can get it to do me a little page: http://www.whatever.com/simplepage.cgi Or http://www.whatever.com/simplepage.cgi?name=waldo This is a very cool idea, I'd love to be

Re: CGI - DBI

2003-12-02 Thread R. Joseph Newton
Jerry Rocteur wrote: > Hi, > > I'm enjoying writing scripts using DBI, I'm doing it with Sybase and > MySQL and it is a whole lot of fun. > > I'd like to stick some stuff on the web and I've started playing with > CGI but I hate this, almost as much as I hate creating HTML docs ;-) > > Anyway, I d

Re: Perl underreporting bytes to write?

2003-12-02 Thread drieux
On Dec 2, 2003, at 6:17 AM, Marco Gazzetta wrote: [..] I am using cdbkup to (what else?) backup my system on CD. It is quite the reliable program, and I was very surprised to find it had a nasty bug. In short, whenever I tried to perform a backup that didn't fit on one CD, the program would crea

Re: Upgrade to 5.8 breaks IIS?

2003-12-02 Thread drieux
On Dec 2, 2003, at 4:26 PM, Clinton wrote: [..] Upgraded my version of Perl (and the relevant modules) but it brings IIS down when I call a PerlScript via the net. Reverted to 5.6 and no problems. It's not critical. But if anybody has any ideas? ActiveState 5.8 on WinNT Server 6a [..] Have yo

Re: Reading files

2003-12-02 Thread Mark Goland
Sorry for not being more clear. The problem is that it doesnt seem to be able to read of the duped handle { $line2 is empty on }. - Original Message - From: "Tom Kinzer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 02, 2003 4:15 PM Subject: RE: Reading files > I d

RE: Reading files

2003-12-02 Thread Tom Kinzer
OK, but how about: 1)where is $LOG being set? 2)does it get past the dies shown below? 3)got strict? it's 'fer your own good, you know! ;) -Tom Kinzer #!/usr/bin/perl -w $file="./text"; $|=1; use Fcntl; use IO::Handle; $D_LOG = $ENV{MHCONTEXTFD}; open($LOG, "< logfile") or die "Unable to o

Re: Config file

2003-12-02 Thread R. Joseph Newton
Rod wrote: > What is the best way to read a config file for a perl script. I have > some very ugly code that can do it, but I would like to find something > cleaner. > > Thanks, > Rod. It depends on how the config file is set up. Asuming that your config file is a simple name= value per line fi