searching for a string

2003-03-18 Thread mark sony
Hi I was trying the following code : open ( fh , "test1.txt"); while () { $string = "the lucky coin"; if ($string =~ m/(\b)the(\s)(\b)lucky(\s)(\b)coin(\b)$/) { print "Yup,exists.\n"; } else { print "nope \n"; } } But the results are not as expected. I was thinking of the following : search for "

Re: Good Perl cgi book?

2003-03-18 Thread Curt2302
I'm currently using the resources at this website. I think it should be useful to you. http://learn.perl.org/library/beginning_perl/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: shared cookies

2003-03-18 Thread Todd Wade
"Wiggins D'Anconia" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hytham Shehab wrote: > > hi guys, > > i have multiple domain names - etc multiple sites - that i would like to > > share cookies inbetween, how can i - literally - do that, and is it enough > > to use HTTP::Cooki

Re: searching a string

2003-03-18 Thread Octavian Rasnita
If the text is contained in $text, then: if ($text =~ /the\s+lucky\s+coin/ism) { print "ok"; } Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Original Message - From: "mark sony" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2003 1:13 PM Sub

Re: persistent connection

2003-03-18 Thread Todd Wade
"Uma Ramdoss" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hai, > i am writing a simple browser using LWP::UserAgent > i dont know how to make persistent connection. i think > LWP sends connection-close header by default. i used > keepalive header but no use. can anyone help w

Re: Problem with regular expressions!!!

2003-03-18 Thread drieux
On Tuesday, Mar 18, 2003, at 15:46 US/Pacific, Peter Kappus wrote: I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... [..] I think the OP may have a problem with wh

Re: Problem with regular expressions!!!

2003-03-18 Thread Wiggins d'Anconia
Hughes, Andrew wrote: This is a newbie observation, but aren't you not supposed to name one of your own variables with a number as the first value after a $, @, or % as in the case of $2? Could this be part of the problem? Just to make sure this doesn't slip through, in his case $2 refers to th

Re: shared cookies

2003-03-18 Thread Wiggins d'Anconia
Hytham Shehab wrote: hi guys, i have multiple domain names - etc multiple sites - that i would like to share cookies inbetween, how can i - literally - do that, and is it enough to use HTTP::Cookies !? Mostly you can't, which is why I suppose the list has been so quiet. This is a security issu

RE: Problem with regular expressions!!!

2003-03-18 Thread Peter Kappus
I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... -Peter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Problem with regular expressions!!!

2003-03-18 Thread Marcelo Taube
hmmm, sorry. That "]" is not in my original code and it's not the problem i just made a mistake when writing the code here in the email. It's cool to know that it worked fine in your computer, i guess i did it right the first time. Somehow it doesn't work, i will keep looking at it. A quest

Re: Problem with regular expressions!!!

2003-03-18 Thread Rob Benton
It looks odd to me b/c * and ? are both quantifiers which usually triggers an error when you try to run it. See if this works for you: $file_completename =~ /([^.]*)\.(.*)/; On Tue, 2003-03-18 at 15:28, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working proper

Re: Problem with regular expressions!!!

2003-03-18 Thread Brett W. McCoy
On Tue, 18 Mar 2003, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working properly and > i don't understand why!! > > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! >

RE: Problem with regular expressions!!!

2003-03-18 Thread Kipp, James
> > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! > } > # did u turn on warnings and use strict ?? did you catch the ] at the end of $extension? i tried this on

RE: Problem with regular expressions!!!

2003-03-18 Thread Hughes, Andrew
This is a newbie observation, but aren't you not supposed to name one of your own variables with a number as the first value after a $, @, or % as in the case of $2? Could this be part of the problem? Andrew -Original Message- From: Marcelo Taube [mailto:[EMAIL PROTECTED] Sent: Tuesday,

Problem with regular expressions!!!

2003-03-18 Thread Marcelo Taube
As u probably have guessed some part of my code is not working properly and i don't understand why!! This is the code. # $file_completename =~ /(.*?)\.(.*)/; if ($2 eq $extension]) { #DO SOMETHING!!! } # As u see, i'm trying

Re: Good Perl cgi book?

2003-03-18 Thread Brett W. McCoy
On Tue, 18 Mar 2003, Dennis Stout wrote: > That is the mother of all perl books. It's also more of a reference book than > anything else. Altho if you're that type of learner, it'll be a great read. > It should also sit on the bookshelf of any Perl programmer, regardless of > whether they use it

Re: Good Perl cgi book?

2003-03-18 Thread Dennis Stout
> Get the mother of all perl books: > > "Programming Perl" (from O'reilly) > by Larry Wall (perl creator), Tom Christainsen, and Jon Orwant. That is the mother of all perl books. It's also more of a reference book than anything else. Altho if you're that type of learner, it'll be a great read. I

Re: Good Perl cgi book?

2003-03-18 Thread Kevin Meltzer
Blatant and shameless self-promotion.. see my sig.. :) On Mon, Mar 17, 2003 at 05:30:44PM -0500, Bob X ([EMAIL PROTECTED]) said something similar to: > What is the best book for a beginner to get started with on Perl and CGI? > > Bob -- [Writing CGI Applications with Perl - http://perlcgi-book

Re: Good Perl cgi book?

2003-03-18 Thread WilliamGunther
Elizabeth Castro's Perl and CGI for the WWW: Visual Quickstart Guide. In a message dated 3/18/2003 8:45:04 AM Eastern Standard Time, [EMAIL PROTECTED] writes: > What is the best book for a beginner to get started with on Perl and CGI? >

RE: Good Perl cgi book?

2003-03-18 Thread Peter Kappus
Get the mother of all perl books: "Programming Perl" (from O'reilly) by Larry Wall (perl creator), Tom Christainsen, and Jon Orwant. It moves at a comfortable pace and lets you dig as deep as you want. It's also actually a fun read! Try saying that about most programming books. (of course, I am

Re: Good Perl cgi book?

2003-03-18 Thread javamaster
Bob X wrote: What is the best book for a beginner to get started with on Perl and CGI? Bob MY favorite is /Sams Teach Yourself Perl in 24 Hours./ Tim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Good Perl cgi book?

2003-03-18 Thread Scot Robnett
These all helped me... - Learning Perl - Perl/CGI Cookbook - CGI Programming with Perl - Standard POD documentation - http://www.perldoc.com Scot Robnett inSite Internet Solutions -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Good Perl cgi book?

2003-03-18 Thread Bob X
What is the best book for a beginner to get started with on Perl and CGI? Bob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Searching a string from a file

2003-03-18 Thread mark sony
Note: Forwarded message attached -- Orignal Message -- From: "mark sony" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Re: searching a string ___ Odomos - the only mosquito protection outside 4

Re: Re: searching a string

2003-03-18 Thread mark sony
Hi It is giving the found status everytime even when there are no strings: My script: #!/usr/local/bin/perl -w #use strict; #use warnings; while () { $string = "the\n\tlucky\n\t\tcoins"; if ($string =~ m/^(\s)*the(\s)*lucky(\s)*coins(\s)*$/) { print "Yup,exists.\n"; } else { print "nope \n"; } }

Re: delete pattern from text file

2003-03-18 Thread zentara
On Mon, 17 Mar 2003 12:30:02 -0500, [EMAIL PROTECTED] (Andrew Hughes) wrote: >submit the file gets read into memory. If I open the file as open >(DELETEFILE, ">>" . etc., the list gets overwritten entirely with nothing. >If I open the file as open (DELETEFILE, "" . etc, the info gets stored into

Re: searching a string

2003-03-18 Thread WilliamGunther
$string = "the\n\tlucky\n\t\tcoin"; if ($string =~ m/^(\s)*the(\s)*lucky(\s)*coin(\s)*$/) { print "Yup"; }

Re: searching a string

2003-03-18 Thread Dennis Stout
What I would do is elliminate all the extra white space; s/\w/ /g; s/\r\n/ /g; then do a match. /the lucky coin/; Dennis - Original Message - From: "mark sony" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2003 02 13 Subject: searching a string > Hi > i am sear

searching a string

2003-03-18 Thread mark sony
Hi i am searching for a string of consecutive words say "the lucky coin" These may be in one line or different line separated by blank lines such as 1>the lucky coin 2>thelucky coin 3>the lucky coin Whats the way in perl ? mark ___