RE: Module for DNS to find MX Records ?

2002-07-03 Thread Toby Stuart
http://search.cpan.org/ Net::DNS::* ??? There might be something there that does what you need. -Original Message- From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 3:32 PM To: [EMAIL PROTECTED] Subject: Module for DNS to find MX Records ? Hello Al

Module for DNS to find MX Records ?

2002-07-03 Thread Ramprasad A Padmanabhan
Hello All, I am working on a mailing project on LINUX and would like to know the Mx records of hosts from a text file in a perl program I know I can use programs like dig but they dont provide friendly o/ps There must be some module written to do dns lookups :-) Any pointers ? Thnx Ram -

Re: df hang inside script

2002-07-03 Thread drieux
On Wednesday, July 3, 2002, at 06:18 , Deb wrote: [..] > I can't just check for certain filesystems, I have to "know" what is > mounted at a given time... But the fact that there is NFS server/ > client game where they no longer make nice - well, I need to discover > that before issuing the df c

Re: Regular Expression Help sought

2002-07-03 Thread Sunish Kapoor
Dear Katy, It works great after the changed the regular expression to as given by u below..! Thanks a ton for the help.but may I request for a small explanation of the line $file =~ s/((^|\n\n).+?)\n/$1 /g; Sunish Katy Brownfield wrote: > Or, instead of changing the input file, change the

Re: df hang inside script

2002-07-03 Thread Deb
* Anders Holm <[EMAIL PROTECTED]> [2002-07-02 10:31:29 +0100]: > Why not see if the NFS has bombed out before trying to use it? Maybe just > trying to do an ls or something which wouldn't need to hang your process, > but rather give you a failure notice? (Sorry for the long time in getting back

Re: need readers

2002-07-03 Thread drieux
On Wednesday, July 3, 2002, at 01:42 , Peter Scott wrote: > At 01:17 PM 7/3/02 -0700, drieux wrote: >> So for those of you with 'editorial skills' >> and the time, please review and kvetch with >> me about >> >> http://www.wetware.com/drieux/pbl/perlTrick/CBO/PingIt/ >> >> as a way to lo

Re: make yp oneliner

2002-07-03 Thread John W . Krahn
On Monday 01 July 2002 07:25, David vd Geer Inhuur tbv IPlib wrote: > Hi, Hello, > Does anyone know how to make it a one-liner ?? > > @regel = split(/ /, `ypmatch IPlib auto.setuser`); > chomp @regel; Use /\s+/ or ' ' instead of / / and you won't need chomp. my @regel = split ' ', `ypmatch IPl

RE: extracting text

2002-07-03 Thread Timothy Johnson
Just in case you hadn't come across these before: 1. Check out perldoc perlre and, since it is a bit hard to understand, so check out other references on regular expressions where necessary. Regular expressions are a vast and complicated subject when you first start to learn them, but it looks

RE: Exporting variables from a module

2002-07-03 Thread John Almberg
# > package Config; # # You might want another Name here - since there is a Config.pm # already out there how about # # package Almberg::WebConfig; Duh! That was it. I should have realized I was conflicting with another module when I read the error message. Thanks loads. My head was ge

RE: DBI problem -- Fetch() without execute() error on trivial case.

2002-07-03 Thread vanHardenbergP
From: [EMAIL PROTECTED] > As you can see, it *does* fetch and return the record I ask for. I > just don't understand why I'm getting error messages. > > Cheers, > Peter > > CODE: > > #!/usr/bin/perl -w > use DBI; > use strict; > > my $dbh = DBI->connect("DBI:mysql:ADA","root","p

Re: extracting text

2002-07-03 Thread Janek Schleicher
Charlie Farinella wrote at Wed, 03 Jul 2002 23:51:44 +0200: > I have the following script that prints email addresses enclosed in <> from a >logfile. It works > by removing everything up to and including the bracket on the left, and then doing >the same on the > right. I would like to be able

Re: Shopping cart 2

2002-07-03 Thread Jenda Krynicky
From: "anthony" <[EMAIL PROTECTED]> > what if the customer does NOT use cookies, i think you should make a > file foreach custom with their IP address. and another script that > check every now and then if the files has not been active for two > whole hours then delete the file.

Re: need readers

2002-07-03 Thread bob ackerman
On Wednesday, July 3, 2002, at 01:17 PM, drieux wrote: > > volks, > > http://www.wetware.com/drieux/pbl/perlTrick/CBO/PingIt/ > > as a way to look at evolving code upward from the > simple idea oops: One could in theory just take this Forth Script and "go" - modify it as appropriate

Re: Shopping cart 2

2002-07-03 Thread anthony
Hi, what if the customer does NOT use cookies, i think you should make a file foreach custom with their IP address. and another script that check every now and then if the files has not been active for two whole hours then delete the file. Anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED]

extracting text

2002-07-03 Thread Charlie Farinella
I have the following script that prints email addresses enclosed in <> from a logfile. It works by removing everything up to and including the bracket on the left, and then doing the same on the right. I would like to be able to just extract the text between the brackets. I have been unable to

Re: write array refs shorter?

2002-07-03 Thread drieux
On Wednesday, July 3, 2002, at 01:13 , John W. Krahn wrote: points to all for answering the OP's specific question >> sub eatArrays >> { >> my @array1 = @{$_[0]}; >> my @array2 = @{$_[1]}; >> >> ..blah.. >> } I guess my problem here is why are we worrying about the

Re: need readers

2002-07-03 Thread Peter Scott
At 01:17 PM 7/3/02 -0700, drieux wrote: >volks, > >I am trying to help with understanding >'what is basic/beginner' level - so I >have tried to put together a step by step >walk through from the simple concept to >the code in execution - close to what would >solve the Problem Description. > >So f

Dump an Excel Spreadsheet

2002-07-03 Thread Doug Lentz
I'm working on a script to create an Excel spreadsheet programatically, using Spreadsheet::WriteExcel. I'm using a spreadsheet written by my boss as the specification. No problems yet, but coding is tedious. I find myself thinking, "I should write a script utilizing Parse:Excel to dump an Excel sp

need readers

2002-07-03 Thread drieux
volks, I am trying to help with understanding 'what is basic/beginner' level - so I have tried to put together a step by step walk through from the simple concept to the code in execution - close to what would solve the Problem Description. So for those of you with 'editorial skills' and the ti

Re: Exporting variables from a module

2002-07-03 Thread drieux
On Wednesday, July 3, 2002, at 12:37 , John Almberg wrote: > Okay, I've been beating my head against this one all day! Hope someone can > help. > > I'm trying to export some scalars from a module. Just some configuration > information. The whole module is as follows: > >

Re: write array refs shorter?

2002-07-03 Thread John W. Krahn
Michael Rauh wrote: > > hi, Hello, > is there a shorter way to write this: > > sub eatArrays > { > my @array1 = @{$_[0]}; > my @array2 = @{$_[1]}; > > ..blah.. > } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

RE: How to pass the value of $@ to a subroutine

2002-07-03 Thread Shishir K. Singh
>Thanks! Changing: >my $message = @_; >to: >my ($message) = @_; >did put the correct value in the string. >If anyone cares to explain the difference between the code I had and the code >Shishir suggested so I can understand why this makes a difference, I'm all >ears! @_ is an array. You wer

RE: How to pass the value of $@ to a subroutine

2002-07-03 Thread David . Wagner
Basically with the @_ and not having parens is like $var = scalar(@_); # which is one since @_ is to subs what @ARGV is to incoming Arguments passed to a module. So by doing the parens, you are populating the variables on the left with values being passed into the

Re: How to pass the value of $@ to a subroutine

2002-07-03 Thread Ian Zapczynski
Thanks! Changing: my $message = @_; to: my ($message) = @_; did put the correct value in the string. If anyone cares to explain the difference between the code I had and the code Shishir suggested so I can understand why this makes a difference, I'm all ears! Thanks again, -Ian "Shishir K.

Exporting variables from a module

2002-07-03 Thread John Almberg
Okay, I've been beating my head against this one all day! Hope someone can help. I'm trying to export some scalars from a module. Just some configuration information. The whole module is as follows: ~~~ package Config; our ($HOME_DIR, $INC_URL);

RE: How to pass the value of $@ to a subroutine

2002-07-03 Thread Shishir K. Singh
>Hello all, >What I want to do is simple - if an error occurs on my previous command >(in this case, making an FTP connection via Net::FTP), I want to send >the value of $@ to a subroutine which sends an e-mail containing the >value of $@ in the body. However, it is clear that I don't understan

Re: DBI problem -- Fetch() without execute() error on trivial case.

2002-07-03 Thread Felix Geerinckx
on Wed, 03 Jul 2002 18:55:25 GMT, <[EMAIL PROTECTED]> wrote: > I've been lurking for a few months and figured I'd pose a question > that I've been banging my head against for a while. (I've already told this in another thread today: Don't do this, it hurts :-) > If anyone can recommend a good

How to pass the value of $@ to a subroutine

2002-07-03 Thread Ian Zapczynski
Hello all, What I want to do is simple - if an error occurs on my previous command (in this case, making an FTP connection via Net::FTP), I want to send the value of $@ to a subroutine which sends an e-mail containing the value of $@ in the body. However, it is clear that I don't understand what

Re: DBI problem -- Fetch() without execute() error on trivial case.

2002-07-03 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > As you can see, it *does* fetch and return the record I ask for. I > just don't understand why I'm getting error messages. > > Cheers, > Peter > > CODE: > > #!/usr/bin/perl -w > use DBI; > use strict; > > my $dbh = DBI->connect("DBI:mysql:ADA","root","p

RE: Quick Question

2002-07-03 Thread Timothy Johnson
$date =~ /(\d{2})(\d{2})(\d{4})/; my($month,$day,$year) = ($1,$2,$3); -Original Message- From: William J Black [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 12:00 PM To: [EMAIL PROTECTED] Subject: RE: Quick Question Hi all, If I have a string, for examle: $date = "0607200

Re: Quick Question

2002-07-03 Thread Andy Lester
> If I have a string, for examle: $date = "06072002"; > How could I separate this in to three separate vars so that $mon=06, > $day=07 and $year=2002. What do you have? You have two digits, and two digits, and four digits. In regex talk, that looks like this: /(\d\d)(\d\d)(\d\d\d\d)/ or /(\d{2

RE: Quick Question

2002-07-03 Thread William J Black
Hi all, If I have a string, for examle: $date = "06072002"; How could I separate this in to three separate vars so that $mon=06, $day=07 and $year=2002. thanks, William Black - Duke Energy IM - Systems Mgmt Tools Support 401 S. College St., Charlotte NC (704) 382-3787 Voice -- To unsubscri

RE: Get Month/Day/Year from a date (was: Quick Question)

2002-07-03 Thread Janek Schleicher
William J Black wrote at Wed, 03 Jul 2002 20:25:02 +0200: > If I have a string, for examle: $date = "06072002"; How could I separate this in to >three separate > vars so that $mon=06, $day=07 and $year=2002. > my ($mon, $day, $year) = $date =~ /(..)(..)()/; Greetings, Janek -- To unsub

DBI problem -- Fetch() without execute() error on trivial case.

2002-07-03 Thread vanHardenbergP
Hiya fellow Perlheads, I've been lurking for a few months and figured I'd pose a question that I've been banging my head against for a while. I have tried googling and I have R the FM, but I can't find any clear indication of what the problem with the code below is. This error message I get back

RE: Quick Question

2002-07-03 Thread William J Black
Hi all, If I have a string, for examle: $date = "06072002"; How could I separate this in to three separate vars so that $mon=06, $day=07 and $year=2002. thanks, William Black Duke Energy IM - Systems Mgmt Tools Support 401 S. College St., Charlotte NC (704) 382-3787 Voice -- To unsubscribe,

Shopping cart 2

2002-07-03 Thread Mariusz
Thank you for all the advice. I looked through free scripts and I found most of them too sophisticated for what I need. The site I'm working on will only collect orders and email them - then someone will call the customer, verify and process the order (they do not want to do credit cards over t

Re: Regular Expression Help sought

2002-07-03 Thread Katy Brownfield
Or, instead of changing the input file, change the regular expression to also detect the beginning of the string. $file =~ s/((^|\n\n).+?)\n/$1 /g; Katy Timothy Johnson wrote: > > > I think you'll need 2 blank lines. > > -Original Message- > From: Sunish Kapoor > To: Nigel Peck > Cc:

RE: PPM3 - libwww-perl

2002-07-03 Thread ss004b3324
Hi, > download? ActiveState only has a limited module repository. > > http://www.activestate.com/PPMPackages/5.6plus/ Try: http://www.activestate.com/PPMPackages/zips/6xx-builds-only/ There is: Tuesday, January 02, 2001 7:36 PM 565993 libwww-perl.zip Hth, Shaun --- Outgoing mail is ce

RE: Correlating Log entries

2002-07-03 Thread Anders Holm
Thanks Felix. That's gotten me going again.. ;) Now I'll just figure out how to take one error at a time and then evaluate what it contains, and count the number of times it ocurs to then print out what I've found.. easy enough, eh? ;) Ah well, now I have something to work from in any case!! Ch

Re: Validate linux user

2002-07-03 Thread Peter Scott
At 10:33 AM 7/3/02 -0500, Jose Vicente Paredes Loor. wrote: >Hi, again >I am looking for help to validate a linux user. >I mean, the user, writes username and password and the script returns true or >false if login is correct or incorrect. > >Please help me % perldoc -f crypt [snip]

RE: \p4view

2002-07-03 Thread Nigel Peck
Yes you're right, that's exactly what happened. Donwloading 633 now. Thanks :-) >>> Timothy Johnson <[EMAIL PROTECTED]> 07/03/02 04:43pm >>> You probably need to upgrade from ActivePerl 5.6.1 build 631. There was a bug in that build that would cause this to happen if you ran a verify --upgrad

RE: \p4view

2002-07-03 Thread Timothy Johnson
You probably need to upgrade from ActivePerl 5.6.1 build 631. There was a bug in that build that would cause this to happen if you ran a verify --upgrade from PPM. You may also have problems with the Windows Installer holding up your system for a while trying to "fix" your ActivePerl installat

Validate linux user

2002-07-03 Thread Jose Vicente Paredes Loor.
Hi, again I am looking for help to validate a linux user. I mean, the user, writes username and password and the script returns true or false if login is correct or incorrect. Please help me Thanks a lot. Bye. - This mail sent throu

c:\p4view

2002-07-03 Thread Nigel Peck
I've been having a lot of problems installing modules on my Win2K system (as some of you may remember). While installing a module today it said "could not find "C:\p4view\Apps\ActivePerl\MSI\data\ActivePerl\Perl\lib\CORE\perl.h" None of that directory structure exists on my system and never has.

RE: shopping cart

2002-07-03 Thread Langa Kentane
Your greatest concern here should be security, yours and that of your customers. I would say take something that is already developed. There are plenty available for free. Try http://freshmeat.net/ and do a search. > -Original Message- > From: Mariusz [mailto:[EMAIL PROTECTED]] > Sent:

RE: PPM3 Repositories

2002-07-03 Thread Timothy Johnson
Dave Roth has a repository with a few very useful modules, like Win32::AdminMisc and Win32::Daemon at http://www.roth.net/perl/packages. Jenda Krynicky hosts some useful modules on his site, including Win32::Lanman and Mail::Sender at http://jenda.krynicky.cz/perl. The Win32::Lanman available

RE: Regular Expression Help sought

2002-07-03 Thread Timothy Johnson
I think you'll need 2 blank lines. -Original Message- From: Sunish Kapoor To: Nigel Peck Cc: [EMAIL PROTECTED] Sent: 7/3/02 6:51 PM Subject: Re: Regular Expression Help sought Dear Nigel, Thanks a ton for the script..It works fine though it skips the first record even though I make t

Re: Correlating Log entries

2002-07-03 Thread Felix Geerinckx
on Wed, 03 Jul 2002 13:56:22 GMT, Anders Holm wrote: > I'm banging my head in trying to get the logic behind doing this, so > any pointers are appreciated.. (Don't do that, it hurts ;-) > AlarmInd:At=1025647244084,Point=Adm.Monitor,Text=process stops due to > client disconnected,Code=1, > > So

Re: Processing text

2002-07-03 Thread Elaine -HFB- Ashton
Jo [[EMAIL PROTECTED]] quoth: *> *>The original file was saved on a windows machine, and i copy/pasted it through a linux text editor. I noticed when i edit the original file using vi, down the bottom next to the file name is [dos]. Im thinking this has something to do with it. http://history.

Re: PPM3 Repositories

2002-07-03 Thread Elaine -HFB- Ashton
Nigel Peck [[EMAIL PROTECTED]] quoth: *>Are there any other PPM repositories worth noting other than the *>standard ActiveState ones? (I know about the Mod_Perl one) Since I don't do Wintel I don't know much about PPM but I'm aware of a few things that may be helpful. CPANPLUS is a 'still-in-dev

Correlating Log entries

2002-07-03 Thread Anders Holm
Hi Folks! I'm banging my head in trying to get the logic behind doing this, so any pointers are appreciated.. I'm (trying to anyway ;) parse a log file, which would contain: AlarmInd:At=1025647244084,Point=Adm.Monitor,Text=process stops due to client disconnected,Code=1, So, here is an Alarm I

framegrabbing

2002-07-03 Thread Mat Harris
I am creating a web-based video monitoring suit on RedHat. I have got xawtv to show images live from a miniature camera and also to grab frames. my question is: Can Perl use xawtv (or another free app) to gram images from the camera and display it on a web page? it should update itself regula

Re: Regular Expression Help sought

2002-07-03 Thread Sunish Kapoor
Dear Nigel, Thanks a ton for the script..It works fine though it skips the first record even though I make the file begin with a blank line by simply hitting enter ! Regards Sunish Nigel Peck wrote: > My first attempt, which may be a bit simplified, would be to substitute > any newline, which

Re: shopping cart

2002-07-03 Thread zentara
On Tue, 2 Jul 2002 22:39:41 -0500, [EMAIL PROTECTED] (Mariusz) wrote: >I'm trying to built a simple shopping cart and I'm not sure where to start. I do not >want to create a db at this point and the order will be simply e-mailed. Does this >solution make any sense (that's what the cgi would do)

Re: write array refs shorter?

2002-07-03 Thread Jeff 'japhy' Pinyan
On Jul 3, Michael Rauh said: >that's ok, but is it possible to put especially the > >my $arrayRef1 = shift; >my @array1 = @$arrayRef1; > >into one expression? my @array1 = @{ shift() }; my @array1 = @{ +shift }; my @array1 = @{ shift @_ }; But not my @array1 = @{ shift }; -- Jeff "

PPM3 Repositories

2002-07-03 Thread Nigel Peck
Are there any other PPM repositories worth noting other than the standard ActiveState ones? (I know about the Mod_Perl one) Thanks Nigel ITM Business Solutions Unit 4 Nine Trees Trading Estate Morthen Road Rotherham S66 9JG Reception Tel: 01709 703288 Fax: 01709 701549 Help Desk Tel:01709 530

RE: PPM3 - libwww-perl

2002-07-03 Thread Nigel Peck
You are right, but when I search through ppm3 it shows up as being there (libwww-perl), strange. Thanks Nigel >>> "Hanson, Robert" <[EMAIL PROTECTED]> 07/03/02 02:11pm >>> I didn't see any libwww on their site... are you sure that they have it for download? ActiveState only has a limited module

RE: PPM3 - libwww-perl

2002-07-03 Thread Hanson, Robert
I didn't see any libwww on their site... are you sure that they have it for download? ActiveState only has a limited module repository. http://www.activestate.com/PPMPackages/5.6plus/ Rob -Original Message- From: Nigel Peck [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 5:54

Re: write array refs shorter?

2002-07-03 Thread Felix Geerinckx
on Wed, 03 Jul 2002 09:51:37 GMT, Michael Rauh wrote: > that's ok, but is it possible to put especially the > > my $arrayRef1 = shift; > my @array1 = @$arrayRef1; > > into one expression? my @array1 = @{+shift}; or my @array1 = @{shift()}; -- felix -- To unsubscribe, e-mail: [EM

Regular Expression Help sought

2002-07-03 Thread Sunish Kapoor
Hi All, I am new to Perl and need help to solve this one ! I have a txt file and the contents of the file are as below : ---CONTENTS OF TEXT FILE-- Abdullah Ahmed Hassan Trading Location Ruwi Souk St, Ruwi Bus Hrs 0930-1300:1630-2200 P.O. Box 197 Ruwi

RE: How would I go about "watching a directory"?

2002-07-03 Thread Rupert Heesom
Thanks for the response, guys. I'm pleased that I don't have to write such a thing from scratch, Especially as I'm fairly new to Perl! Well, when I've been manually testing the file processing, it hasn't taken much time (20->30secs). And I'm not expecting much traffic, so I can take it easy wit

RE: How would I go about "watching a directory"?

2002-07-03 Thread Jenda Krynicky
From: "Rupert Heesom" <[EMAIL PROTECTED]> > Thanks for the response, guys. I'm pleased that I don't have to write > such a thing from scratch, Especially as I'm fairly new to Perl! > > Well, when I've been manually testing the file processing, it hasn't > taken much time (20->30secs). And I'm

PPM3 - libwww-perl

2002-07-03 Thread Nigel Peck
When I try to install libwww-perl through ppm3 from the ActiveState repository I get Error: PPD for 'R:/inetpub/wwwroot/www2.activestate.com/PPMPackages/5.6-plus/libwww-perl.ppd' could not be found. Am I doing anything wrong? I've tried it on 2 machines and they both give the same error. ITM

Re: write array refs shorter?

2002-07-03 Thread Michael Rauh
[EMAIL PROTECTED] schrieb: > > my ($arrayRef1, $arrayRef2) = @_; > that's ok, but is it possible to put especially the my $arrayRef1 = shift; my @array1 = @$arrayRef1; into one expression? greetings michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: write array refs shorter?

2002-07-03 Thread Janek Schleicher
Michael Rauh wrote at Wed, 03 Jul 2002 11:07:42 +0200: > is there a shorter way to write this: > > sub eatArrays > { > my $arrayRef1 = shift; > my $arrayRef2 = shift; my ($arrayRef1, $arrayRef2) = @_; :-) Cheerio, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: How to Tweek The DOS Prompt

2002-07-03 Thread Nigel Peck
You can create a shortcut to command.com (win9x) or cmd.exe (winNT, Win2k, WinXP) and put the directory you want in the start-in bit of the shortcut properties. >>> "Yasen Petrov" <[EMAIL PROTECTED]> 07/03/02 05:41am >>> Hi there, Anytime I run the DOS prompt it shows: C:\WINDOWS\Desltop>. And I

Re: write array refs shorter?

2002-07-03 Thread Michael Rauh
> my @array1 = @$attRef1; > my @array2 = @$attRef2; -^^^ "attRef" should of course read "arrayRef". -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

write array refs shorter?

2002-07-03 Thread Michael Rauh
hi, is there a shorter way to write this: sub eatArrays { my $arrayRef1 = shift; my $arrayRef2 = shift; my @array1 = @$attRef1; my @array2 = @$attRef2; ..blah.. } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

Re: Regex help!

2002-07-03 Thread Janek Schleicher
Troy May wrote at Wed, 03 Jul 2002 07:58:10 +0200: > Hello, I'm trying to match images by the extension. Either .jpg or .gif > > Here's what I wrote: > > $plup =~ m/\(\^\.\.gif\|\^\.\.jpg)/\ > > Is it all screwed up? I'm not real good with regexes. $plup =~ /\.(gif|jpg)$/; Greetings, Jane

Re: shopping cart

2002-07-03 Thread Michael Fowler
On Tue, Jul 02, 2002 at 10:39:41PM -0500, Mariusz wrote: > I'm trying to built a simple shopping cart and I'm not sure where to > start. I do not want to create a db at this point and the order will be > simply e-mailed. Does this solution make any sense (that's what the cgi > would do)? : I'm go

Re: Regex help!

2002-07-03 Thread John W. Krahn
Timothy Johnson wrote: > > m/(^.+\.gif|^.+\.jpg)/ > > which would still be wrong, because you can't put anchors and such in a > regex, but if we move everything except the characters we want to compare > out of the (|), we get: Actually, you can put anchors in a regular expression. Your exam

RE: executing c program from perl and calling subroutines

2002-07-03 Thread Anders Holm
Hi. [snip] > How can I call a subroutine which is defined in another file i.e. > the calling > perlscript and the function are in different files. [snip] When asking a new question, consider either a new thread or cutting down the text of the message, whichever you prefer.. ;) You are looking a

Re: Opening files for writing that dont exist

2002-07-03 Thread Michael Fowler
On Wed, Jul 03, 2002 at 01:15:39AM +0800, Connie Chan wrote: > For pure perl Code, you may try : > if (-e "filename") { print "existed" } > else { open (FH, ">filename"); .. ; close (FH)} This is a bad idea, as you've introduced a race condition. What happens if I symlink 'filename' to some

Re: Opening files for writing that dont exist

2002-07-03 Thread Michael Fowler
On Tue, Jul 02, 2002 at 11:46:26AM -0400, James Baster wrote: > I want to open a temporary file somwhere and I am facing the problem of > making sure I dont write to an already existing temporary file, thus > curropting some other process somewhere else. Securely opening temporary files can be

RE: Opening files for writing that dont exist

2002-07-03 Thread James B
Shishir K. Singh wrote: >>Hi, > >>I want to open a temporary file somwhere and I am facing the problem of >>making sure I dont write to an already existing temporary file, thus >>curropting some other process somewhere else. Is there a way of telling >>perl to open a new file for writing but to