Re: Looping through lines stored in a scalar

2008-01-03 Thread Jean-Rene David
* Paul Johnson [2008.01.01 22:10]: > The most direct analogy would be to use an > in-memory file: > > open my $fh, "<", \$scalar; > print while <$fh>; Very nice. Thanks. I didn't understand what John and Chas were trying to say until I saw the term "in-memory file". Exactly the kind of stuff I

How to make "a(b" as "a\(b"?

2008-01-03 Thread Murali
Hi, I have a scalar variable $x whose value is "a(b" I am trying to replace the paranthesis with a backslash followed by parenthesis, I mean, ( to \( $x =~ s/\(/\\(/g; However this is making $x as "a\\(b" which is not what I want. Can somebody please help me with the regular expression here?

Using 'sendmail'

2008-01-03 Thread Gurpreet Singh
Hi All, I am a beginner of perl and sorry if I am asking something silly. I have written the following code using some pre-made scripts on net. #!/usr/bin/perl l1:print"Enter your E-Mail ID"; my $from=; l2:print"Enter receipt's E-Mail ID"; my $to=; print"Enter Subject"; my $sub=;

Re: Using 'sendmail'

2008-01-03 Thread Aruna Goke
Gurpreet Singh wrote: Hi All, I am a beginner of perl and sorry if I am asking something silly. I have written the following code using some pre-made scripts on net. #!/usr/bin/perl l1:print"Enter your E-Mail ID"; my $from=; l2:print"Enter receipt's E-Mail ID"; my $to=; print"Enter

Re: How to make "a(b" as "a\(b"?

2008-01-03 Thread John W. Krahn
Murali wrote: Hi, Hello, I have a scalar variable $x whose value is "a(b" I am trying to replace the paranthesis with a backslash followed by parenthesis, I mean, ( to \( $x =~ s/\(/\\(/g; However this is making $x as "a\\(b" which is not what I want. Can somebody please help me with the

Re: How to make "a(b" as "a\(b"?

2008-01-03 Thread John W. Krahn
Murali wrote: > Hi, Hello, > I have a scalar variable $x whose value is "a(b" > > I am trying to replace the paranthesis with a backslash followed by > parenthesis, I mean, ( to \( > > $x =~ s/\(/\\(/g; > > However this is making $x as "a\\(b" which is not what I want. > > Can somebody please he

Re: Using 'sendmail'

2008-01-03 Thread John W. Krahn
Gurpreet Singh wrote: > Hi All, Hello, > I am a beginner of perl and sorry if I am asking something silly. > I have written the following code using some pre-made scripts on net. > > > #!/usr/bin/perl You should have these two lines next: use warnings; use strict; > l1:print"Enter your E-Mai

Re: Using 'sendmail'

2008-01-03 Thread John W. Krahn
Gurpreet Singh wrote: Hi All, Hello, I am a beginner of perl and sorry if I am asking something silly. I have written the following code using some pre-made scripts on net. #!/usr/bin/perl You should have these two lines next: use warnings; use strict; l1:print"Enter your E-Mail ID";

removing duplicate lines across files.

2008-01-03 Thread Siva Prasad
Hi Gurus, I want to remove duplicate lines across files. Below is the detailed problem, I have file1 file2,file3,file4,file5, The lines in file1 are there in file2,file3,file4,file5 I want to remove all the lines which are there in file1 from file2,file3,file4,file5. Can

Re: Memory Usage of my Script

2008-01-03 Thread Spiros Denaxas
On Jan 3, 4:10 am, [EMAIL PROTECTED] (Yitzle) wrote: > Hi. > I've got two scripts I am running and they both consume large amounts > of memory (10MB). > How would I go about finding where the memory is being used and > figuring out how to reduce the memory footprint. > > Both scripts start off with

Re: removing duplicate lines across files.

2008-01-03 Thread John W. Krahn
Siva Prasad wrote: Hi Gurus, Hello, I want to remove duplicate lines across files. Below is the detailed problem, I have file1 file2,file3,file4,file5, The lines in file1 are there in file2,file3,file4,file5 I want to remove all the lines which are there in file1 from file2,file3,file4,

Re: removing duplicate lines across files.

2008-01-03 Thread Rob Dixon
Siva Prasad wrote: I want to remove duplicate lines across files. Below is the detailed problem, I have file1 file2,file3,file4,file5, The lines in file1 are there in file2,file3,file4,file5 I want to remove all the lines which are there in file1 from file2,file3,file4,file5. Can anyb

Re: Problem with adding a connection with Win32::NetResource

2008-01-03 Thread Nash
On Jan 3, 12:19 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > If you mean that it doesn't report an error if you write > >    AddConnection({ RemoteName => 'Nash' }); > > then it's simply because you haven't asked it to do anything. You don't > get a local connection to a resource though - nothin

How to extract the HTML tag?

2008-01-03 Thread howa
e.g. apple orange apple orange I want to extract "div" from the input thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Memory Usage of my Script

2008-01-03 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > Hi. > I've got two scripts I am running and they both consume large amounts > of memory (10MB). > How would I go about finding where the memory is being used and > figuring out how to reduce the memory footprint. > > Both scripts start off with: > > #!/usr/bin/p

Re: How to extract the HTML tag?

2008-01-03 Thread Chas. Owens
On Jan 3, 2008 6:19 AM, howa <[EMAIL PROTECTED]> wrote: > e.g. > > apple orange > apple orange > > > I want to extract "div" from the input > > thanks. Take a look at the various HTML* modules on CPAN. Personally, I like HTML::TreeBuilder*. It represents the HTML document as a tree of HTML

Re: How to extract the HTML tag?

2008-01-03 Thread howa
On 1月3日, 下午7時19分, [EMAIL PROTECTED] (Howa) wrote: > e.g. > > apple orange > apple orange > > I want to extract "div" from the input > > thanks. This is my current codes: # use strict; my $str = " apple "; if ($str =~ /<(.*?)>/gi) {

Re: How to extract the HTML tag?

2008-01-03 Thread Chas. Owens
On Jan 3, 2008 8:27 AM, howa <[EMAIL PROTECTED]> wrote: snip > And it should handle other rare cases, e.g. > > my $str = " apple "; snip And right there you showed why regexes are not good for parsing HTML (and XML). That problem is non-trival and therefore we have modules that take care of the

Re: How to make "a(b" as "a\(b"?

2008-01-03 Thread Chas. Owens
On Jan 2, 2008 11:11 PM, Murali <[EMAIL PROTECTED]> wrote: > Hi, > > I have a scalar variable $x whose value is "a(b" > > I am trying to replace the paranthesis with a backslash followed by > parenthesis, I mean, ( to \( > > $x =~ s/\(/\\(/g; > > However this is making $x as "a\\(b" which is not wh

Re: How to extract the HTML tag?

2008-01-03 Thread howa
On 1月3日, 下午10時00分, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Jan 3, 2008 8:27 AM, howa <[EMAIL PROTECTED]> wrote: > snip> And it should handle other rare cases, e.g. > > > my $str = " apple "; > > snip > > And right there you showed why regexes are not good for parsing HTML > (and XML). That p

Re: How to extract the HTML tag?

2008-01-03 Thread Tom Phoenix
On Jan 3, 2008 6:41 AM, howa <[EMAIL PROTECTED]> wrote: > > And right there you showed why regexes are not good for parsing HTML > > (and XML). That problem is non-trival and therefore we have modules > > that take care of the messy parsing that is necessary to get the > > information you want.

Re: checking $@

2008-01-03 Thread Chas. Owens
On Jan 2, 2008 8:11 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > Chas. Owens schreef: snip > > If you have code that is setting $@ then you have bad code; > > eval sets [EMAIL PROTECTED] Not all code that uses eval, is bad code. > ;-) snip When I said "is setting $@" I meant other than by the eval mec

Creating your own module

2008-01-03 Thread Shilpi Harpavat
Hi, I am trying to use h2xs to create a module called Utilities.pm to put some common function sthat my perl scripts call under one module. I ran the folliwng command to generate the module skeleton and it failed with the following errors. I am totally new to perl and any help would be highl

How to leave the list

2008-01-03 Thread Tom Phoenix
On Jan 2, 2008 7:27 PM, Nihilism Machine <[EMAIL PROTECTED]> wrote: > i tried the unsubscribe email and the help email addy for this list, i > still cant unsubscribe, the emails produce no results/returned emails > etc. ugh. That's frustrating. But which is it, no results or returned emails? Mayb

Re: How to extract the HTML tag?

2008-01-03 Thread Chas. Owens
On Jan 3, 2008 9:41 AM, howa <[EMAIL PROTECTED]> wrote: > On 1月3日, 下午10時00分, [EMAIL PROTECTED] (Chas. Owens) wrote: > > > On Jan 3, 2008 8:27 AM, howa <[EMAIL PROTECTED]> wrote: > > snip> And it should handle other rare cases, e.g. > > > > > my $str = " apple "; > > > > snip > > > > And right the

Re: Creating your own module

2008-01-03 Thread Chas. Owens
On Jan 3, 2008 12:50 PM, Shilpi Harpavat <[EMAIL PROTECTED]> wrote: > Hi, > I am trying to use h2xs to create a module called Utilities.pm to put > some common function sthat my perl scripts call under one module. I ran > the folliwng command to generate the module skeleton and it failed with > t

Re: Using 'sendmail'

2008-01-03 Thread Mark Wagner
On 1/2/08, Gurpreet Singh <[EMAIL PROTECTED]> wrote: > Hi All, > > I am a beginner of perl and sorry if I am asking something silly. > I have written the following code using some pre-made scripts on net. > open (MAIL,"|/usr/sbin/sendmail"); > print MAIL "To: $to\n"; If you're providing the reci

Re: Extract attribute from huge xml file

2008-01-03 Thread annettehollingshead
On Dec 10 2007, 3:43 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Dec 10, 2007 8:24 AM, Tim Bowden <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 2007-12-10 at 13:14 +, Beginner wrote: > > > Hi, > > > > I have a huge XML file, 1.7GB, 53080215 lines. I am trying to extract > > > an attribute fr

Re: Extract attribute from huge xml file

2008-01-03 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > On Dec 10 2007, 3:43 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > On Dec 10, 2007 8:24 AM, Tim Bowden <[EMAIL PROTECTED]> wrote: > > Unfortunately that won't work with structured data like XML. You best > > bet is to use something like XML::Twig to grab the top level re