<yours> In the above example i had to escape the quotes to use them. </yours>
There's nothing wrong with escaping quotes, but Perl has enough quote notations that it is almost never a "have to" to escape them. You could define your variables like this: my $bilbo = qq{Bilbo,"Why I like rings" Freemont Press, 1998,}; my $frodo = qq{Frodo, "Why I don't" Bridgedale Freemans, 183}; That will incorporate the double quotes into your variable without having to escape them. That can just make them easier to read since there is no escape character to confuse when reading. Again, nothing wrong with what you did, I just wanted to point out that escaping was not a "Have to". Steve H. -----Original Message----- From: david wright [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 5:21 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: one question to end the day on . . . Timothy B wrote: "Hello out there - I have learned a lot of Perl today, but I am still trying to figure one more thing out. How can I go through a file and extract all the text between certain delimiters - for example I have: Bilbo, "Why I like rings" Freemont Press, 1998. Frodo, "Why I don't" Bridgedale Freemans, 1832 Etc I want to get: Why I like rings Why I don't It seems like there should be a real quick way to do this. . . thoughts? tim" You could look at the page and see what the phrases have in common, then make a regex delimiter to extract them. see below: #!/usr/bin/perl -w use strict; my $bilbo = "Bilbo,\"Why I like rings\" Freemont Press, 1998,"; my $frodo = "Frodo, \"Why I don't\" Bridgedale Freemans, 183"; my @array=($bilbo,$frodo); #I want to get: #Why I like rings #Why I don't foreach(@array){ (/(".*")/) ? print $1 . "\n" : print "not your string\n"; } In the above example i had to escape the quotes to use them. If you have a whole plain text file of you can just use the open(FILE, "myHobit") || die "$!"; then use a similar search. Have fun. -dw5 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]