[29753] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 997 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 2 00:09:40 2007

Date: Thu, 1 Nov 2007 21:09:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 1 Nov 2007     Volume: 11 Number: 997

Today's topics:
    Re: !Help: can't get into perl -MCPAN -e shell <mmccaws@comcast.net>
    Re: !Help: can't get into perl -MCPAN -e shell <mmccaws@comcast.net>
    Re: Get length of returned array without storing? <ced@blv-sam-01.ca.boeing.com>
    Re: Get length of returned array without storing? <tadmc@seesig.invalid>
    Re: Get length of returned array without storing? <No_4@dsl.pipex.com>
    Re: Get length of returned array without storing? <jl_post@hotmail.com>
    Re: Get length of returned array without storing? <uri@stemsystems.com>
        How to convert csv file to XML using XML::Simple? <jegan472@comcast.net>
    Re: Looking for a module (or anything) to grab a webcam <tadmc@seesig.invalid>
        Perl module for accessing dbase files <bill@ts1000.us>
    Re: Perl module for accessing dbase files <spamtrap@dot-app.org>
    Re: Problems with Airthmetic Operators in a hash <rvtol+news@isolution.nl>
    Re: Script to find largest files <tadmc@seesig.invalid>
    Re: Simple string search <jordilin@gmail.com>
    Re: string matching doesn't work <wahab-mail@gmx.de>
    Re: string matching doesn't work <asolkar@gmail.com>
    Re: string matching doesn't work <tadmc@seesig.invalid>
    Re: string matching doesn't work <rvtol+news@isolution.nl>
        That should read all refer to XML::Simple <jegan472@comcast.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 01 Nov 2007 16:32:16 -0700
From:  mmccaws2 <mmccaws@comcast.net>
Subject: Re: !Help: can't get into perl -MCPAN -e shell
Message-Id: <1193959936.274479.245720@e34g2000pro.googlegroups.com>

On Nov 1, 1:55 pm, brian d  foy <brian.d....@gmail.com> wrote:
> [[ This message was both posted and mailed: see
>    the "To," "Cc," and "Newsgroups" headers for details. ]]
>
> In article <1193862880.246245.35...@o3g2000hsb.googlegroups.com>,
>
> smallpond <smallp...@juno.com> wrote:
> > On Oct 31, 11:47 am, mmccaws2 <mmcc...@comcast.net> wrote:
> > > I try to login in at command line.  It gives me the output below.  It
> > > then kicks me out of the perl shell.  What do I need to do to be able
> > > to use it?
>
> I'm not sure what this means. Are you talking about logging into your
> user account and getting this error before you type any commands?
>
> A complete transcript of your session would be helpful. :)
>
> > > Here is the error message:
>
> > > Can't load '/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
> > > IO.so' for module IO: Exec format error at /opt/perl/lib/5.8.3/
> > > IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
>
> Can you run anything else with perl or is it just this module giving
> you problems?
>
> What happens when you try:
>
>    $ perl -MIO -e 0
>
> If that doesn't work, I suggest re-installing perl. You have something
> wrong with a core module.

Anytime I try to use a perl shell I get similar error messages.
even for
perl -e shell
perl -MCPAN -e shell
and now
{ the output for all three is below.}
$ perl -MIO -e 0
Can't load '/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
IO.so' for module IO: Exec format error at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
 at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/IO.pm line 11
Compilation failed in require.
BEGIN failed--compilation aborted.
$ perl -e shell
$ perl -MCPAN -e shell
Can't load '/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
IO.so' for module IO: Exec format error at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
 at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/IO.pm line 11
Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
thread-multi/IO/Handle.pm line 260.
BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/IO/Handle.pm line 260.
Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
thread-multi/IO/Seekable.pm line 101.
BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/IO/Seekable.pm line 101.
Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
thread-multi/IO/File.pm line 117.
BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/
IA64.ARCHREV_0-thread-multi/IO/File.pm line 117.
Compilation failed in require at /opt/perl/lib/5.8.3/FileHandle.pm
line 9.
Compilation failed in require at /opt/perl/lib/5.8.3/CPAN.pm line 26.
BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/CPAN.pm line
26.
Compilation failed in require.
BEGIN failed--compilation aborted.



------------------------------

Date: Thu, 01 Nov 2007 16:38:21 -0700
From:  mmccaws2 <mmccaws@comcast.net>
Subject: Re: !Help: can't get into perl -MCPAN -e shell
Message-Id: <1193960301.929798.245470@q3g2000prf.googlegroups.com>

On Nov 1, 4:32 pm, mmccaws2 <mmcc...@comcast.net> wrote:
> On Nov 1, 1:55 pm, brian d  foy <brian.d....@gmail.com> wrote:
>
>
>
> > [[ This message was both posted and mailed: see
> >    the "To," "Cc," and "Newsgroups" headers for details. ]]
>
> > In article <1193862880.246245.35...@o3g2000hsb.googlegroups.com>,
>
> > smallpond <smallp...@juno.com> wrote:
> > > On Oct 31, 11:47 am, mmccaws2 <mmcc...@comcast.net> wrote:
> > > > I try to login in at command line.  It gives me the output below.  It
> > > > then kicks me out of the perl shell.  What do I need to do to be able
> > > > to use it?
>
> > I'm not sure what this means. Are you talking about logging into your
> > user account and getting this error before you type any commands?
>
> > A complete transcript of your session would be helpful. :)
>
> > > > Here is the error message:
>
> > > > Can't load '/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
> > > > IO.so' for module IO: Exec format error at /opt/perl/lib/5.8.3/
> > > > IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
>
> > Can you run anything else with perl or is it just this module giving
> > you problems?
>
> > What happens when you try:
>
> >    $ perl -MIO -e 0
>
> > If that doesn't work, I suggest re-installing perl. You have something
> > wrong with a core module.
>
> Anytime I try to use a perl shell I get similar error messages.
> even for
> perl -e shell
> perl -MCPAN -e shell
> and now
> { the output for all three is below.}
> $ perl -MIO -e 0
> Can't load '/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
> IO.so' for module IO: Exec format error at /opt/perl/lib/5.8.3/
> IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
>  at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/IO.pm line 11
> Compilation failed in require.
> BEGIN failed--compilation aborted.
> $ perl -e shell
> $ perl -MCPAN -e shell
> Can't load '/opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/auto/IO/
> IO.so' for module IO: Exec format error at /opt/perl/lib/5.8.3/
> IA64.ARCHREV_0-thread-multi/XSLoader.pm line 68.
>  at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-thread-multi/IO.pm line 11
> Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
> thread-multi/IO/Handle.pm line 260.
> BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/
> IA64.ARCHREV_0-thread-multi/IO/Handle.pm line 260.
> Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
> thread-multi/IO/Seekable.pm line 101.
> BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/
> IA64.ARCHREV_0-thread-multi/IO/Seekable.pm line 101.
> Compilation failed in require at /opt/perl/lib/5.8.3/IA64.ARCHREV_0-
> thread-multi/IO/File.pm line 117.
> BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/
> IA64.ARCHREV_0-thread-multi/IO/File.pm line 117.
> Compilation failed in require at /opt/perl/lib/5.8.3/FileHandle.pm
> line 9.
> Compilation failed in require at /opt/perl/lib/5.8.3/CPAN.pm line 26.
> BEGIN failed--compilation aborted at /opt/perl/lib/5.8.3/CPAN.pm line
> 26.
> Compilation failed in require.
> BEGIN failed--compilation aborted.

Oh yes, we coordinated a reboot and the above output is even after the
reboot.

Thanks
Mike



------------------------------

Date: Thu, 01 Nov 2007 15:53:31 -0700
From:  "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Get length of returned array without storing?
Message-Id: <1193957611.651185.323550@v23g2000prn.googlegroups.com>

> ...
> You could use an anonymous array:
>
> my $length = @{ $win->lbMacros1->GetSelItems() };
>                ^                              ^
 I'm sure you meant:   @{[$win->lbMacros1->GetSelItems()]};


--
Charles DeRykus



------------------------------

Date: Thu, 1 Nov 2007 17:49:33 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Get length of returned array without storing?
Message-Id: <slrnfiklvt.hbj.tadmc@tadmc30.sbcglobal.net>

jl_post@hotmail.com <jl_post@hotmail.com> wrote:


> you can easily get the
> length of a list in scalar context


No you can't.

A list cannot even exist in a scalar context.


> you'd write:
>
>       my $length = () = ('a', 'b', 'c');  # $length is 3


But now the list is _not_ in a scalar context. You have put the
list into a list context.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Thu, 01 Nov 2007 23:15:41 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Get length of returned array without storing?
Message-Id: <M-qdnQ5n8f23w7faRVnygwA@pipex.net>

xhoster@gmail.com wrote:
> Big and Blue <No_4@dsl.pipex.com> wrote:
>> boole wrote:
>>> I want to get the length of that array without storing the result in
>>> an array variable.
>>     my $len = (func_call());
> 
> No, that does the same thing as not using the extra parens.  Maybe you
> mean this:
> 
> my $len = () = func_call();

    Thanks - that's the effect I was looking for (so Uri - a pointer in the 
right direction, rather than a guess - although it was untested).

    Of course, if the function itself checked its context and just return 
the length in a scalar context then this all becomes irrelevant.   I was 
assuming it doesn't and won't.



-- 
              Just because I've written it doesn't mean that
                   either you or I have to believe it.


------------------------------

Date: Thu, 01 Nov 2007 16:40:51 -0700
From:  "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: Get length of returned array without storing?
Message-Id: <1193960451.104340.108930@50g2000hsm.googlegroups.com>

jl_post@hotmail.com <jl_p...@hotmail.com> wrote:
> > you can easily get the
> > length of a list in scalar context

On Nov 1, 4:49 pm, Tad McClellan <ta...@seesig.invalid> wrote:
> No you can't.
>
> A list cannot even exist in a scalar context.


   This might be just a matter of semantics, but when I wrote:

> you can easily get the length of a list in scalar context

I didn't mean:

> you can easily get the length of [a list in scalar context]

but rather:

> you can easily get the [length of a list] in scalar context

or even:

> [when in scalar context (such as assigning to a scalar
> or using scalar()),] you can easily get the length
> of a list

   I didn't mean to imply that the list itself was in scalar context,
but just the final operation was (which in the case of:

      my $length = () = ('a', 'b', 'c');  # $length is 3

would be the left-most '=' operator).

   I can see how the way I worded that might be a bit ambiguous, but I
do think my examples clarified what I meant (and more importantly,
answered the original poster's question).

   -- Jean-Luc



------------------------------

Date: Fri, 02 Nov 2007 01:39:00 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Get length of returned array without storing?
Message-Id: <x7abpxxw7f.fsf@mail.sysarch.com>

>>>>> "BaB" == Big and Blue <No_4@dsl.pipex.com> writes:

  BaB> xhoster@gmail.com wrote:
  >> Big and Blue <No_4@dsl.pipex.com> wrote:
  >>> boole wrote:
  >>>> I want to get the length of that array without storing the result in
  >>>> an array variable.
  >>> my $len = (func_call());
  >> No, that does the same thing as not using the extra parens.  Maybe you
  >> mean this:
  >> my $len = () = func_call();

  BaB>     Thanks - that's the effect I was looking for (so Uri - a pointer in
  BaB>     the right direction, rather than a guess - although it was untested).

i don't like the () = trick anyhow. also i never seem to want the length
of lists. i always want the data. maybe i think differently but temp
lists just to generate counts seems like a waste. 

  BaB>     Of course, if the function itself checked its context and just
  BaB>     return the length in a scalar context then this all becomes
  BaB>     irrelevant.   I was assuming it doesn't and won't.

that is also a poor assumption. you can check the context and return
many things besides the count in scalar context. i have modules that
would return an array ref of the data instead of a list/array
itself. some code may return some other info like a handle or object in
scalar context that may be used in chaining calls (a style i don't like
either). it is up to the module designer and not the users of the module
that determines what is returned.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Thu, 01 Nov 2007 22:54:09 -0400
From: James Egan <jegan472@comcast.net>
Subject: How to convert csv file to XML using XML::Simple?
Message-Id: <EIWdnSZxXKHMDLfanZ2dnUVZ_v3inZ2d@comcast.com>

I need to take a comma separated value (csv) file and convert it to XML.
I'm trying to do this with XML::Writer.  Using XML::Writer I can see how
to convert FROM an XML document, but I don't see how to take a csv file
and convert it to XML.  If I had a csv file like this:

Robert, Smith, 123 Main St.
Jane, Smith, 456 Market St.
William, Watson, 789 First Ave.


How would I convert that to an XML file like this:

<?xml version="1.0" ?>
<ADDRESSBOOK>
  <CONTACT>
    <FIRST_NAME> Robert  </FIRST_NAME>
    <LAST_NAME> Smith </LAST_NAME>
    <ADDRESS> 123 Main St. </ADDRESS>
  </CONTACT>
  <CONTACT>
    <FIRST_NAME> Jane  </FIRST_NAME>
    <LAST_NAME> Smith </LAST_NAME>
    <ADDRESS> 456 Market St. </ADDRESS>
  </CONTACT>
  <CONTACT>
    <FIRST_NAME> William  </FIRST_NAME>
    <LAST_NAME> Watson </LAST_NAME>
    <ADDRESS> 789 First Ave. </ADDRESS>
  </CONTACT>
</ADDRESSBOOK>


Any help would be greatly appreciated!



------------------------------

Date: Thu, 1 Nov 2007 17:53:07 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Looking for a module (or anything) to grab a webcam image
Message-Id: <slrnfikm6j.hbj.tadmc@tadmc30.sbcglobal.net>

J. Gleixner <glex_no-spam@qwest-spam-no.invalid> wrote:
> PB wrote:
>> A perldoc -q query didn't turn up anything camera- or webcam-related
>> that looked useful; neither did a CPAN module search nor a Google Groups
>> search or a Google Web search.
>
> Oh Really.


Message-ID: <1135012130.032784.304980@g14g2000cwa.googlegroups.com>


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Thu, 01 Nov 2007 17:16:43 -0700
From:  Bill H <bill@ts1000.us>
Subject: Perl module for accessing dbase files
Message-Id: <1193962603.557425.37800@o38g2000hse.googlegroups.com>

Has anyone used any of the modules on cpan for creating and
manipulating dbase style database files? The few I found on there seem
to be pretty old (one was from 1999).

I am looking for the ability to create, edit, append and sort dbase
files that will be accessed through an intranet "web-based" interface.
The reason behind using dbase versus msql or others is that the
clients have all their data in dbase format and use stand alone
programs to work with it also.

Any / all help appreciated

Bill H



------------------------------

Date: Thu, 01 Nov 2007 22:12:23 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Perl module for accessing dbase files
Message-Id: <m1640ljszc.fsf@dot-app.org>

Bill H <bill@ts1000.us> writes:

> Has anyone used any of the modules on cpan for creating and
> manipulating dbase style database files? The few I found on there seem
> to be pretty old (one was from 1999).

I would go ahead and try DBD::XBase. Sure, it hasn't been updated since 1999,
but DBD::* modules are just drivers. I doubt that there have been any sig-
nificant changes to the .dbf and related file formats since then, so it may
simply be the case that DBD::XBase hasn't *needed* an update.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Thu, 1 Nov 2007 23:11:36 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Problems with Airthmetic Operators in a hash
Message-Id: <fgdmjr.150.1@news.isolution.nl>

coolchick schreef:

> I am trying to go through a file and grab all the arithmetic operators
> using a perl hash.
> It is not working for me. What am I doing wrong? I think my issue is
> with the key value that I can't escape. HELP!
>
> #!/usr/bin/perl
>
> %operators = ('+',0,'-',0,'=',0,'*',0,'/',0);
>
> $FILE="operator.txt";
> open(FILE) or die("Could not open $FILE.");
>
> foreach $line (<FILE>) {
>
>          while (($key,$value) = each(%operators)){
>                     if ($line =~ /\$key/) {
>                        $operators{$key}=$value+1;
>                 }
>        }
> }

perldoc -f quotemeta
perldoc -f index
perldoc -f keys

You are aware that you are only counting maximally one of each operator
per line?

You don't need the each(), becausee you can do $operators{$key}++.

-- 
Affijn, Ruud

"Gewoon is een tijger."



------------------------------

Date: Thu, 1 Nov 2007 17:44:51 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Script to find largest files
Message-Id: <slrnfikln3.hbj.tadmc@tadmc30.sbcglobal.net>

groups.user@gmail.com <groups.user@gmail.com> wrote:


> i'm looking for a script


Then you are in the wrong place. Try a search engine.

This is the place to post if you want to *write* a script.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Thu, 01 Nov 2007 15:33:18 -0700
From:  jordilin <jordilin@gmail.com>
Subject: Re: Simple string search
Message-Id: <1193956398.696803.201630@50g2000hsm.googlegroups.com>

On 1 nov, 18:25, Josef Moellers <5502109103600...@t-online.de> wrote:
> Jack wrote:
> > hi guys,
> > A little problem here. I am very new to perl and i am having a problem
> > search for a substring in a file. So here is a sample
>
> > (this is my id for id="wksOI*84sk_")
> > (this is my id for id="@s3dSSos_")
> > (this is my id for id="dksWDkps_")
>
> > So i have page with 20 of these lines. all I am interested in the id
> > part of each line ie, wksOl*84sk_  . As you maybe able to tell the id
> > part of each line is 12 char and it always ends with _"). I think the
> > regex must be for  an expression that starts with id=" and ends with
> > ") with 12 letters in the middle. So once this id has been found I
> > need to write it in a file.
>
> This is somewhat inconsistent. The example you gave (wksOl*84sk_) is
> only 11 characters long.
>
> > I know with m/regex/ I can find stuff, but I don' t how to return the
> > cryptic id.
>
> > Any solutions.
>
> if ($string =~ m/id="(.{12})"/) {
>      $desired_id = $1;
>
> }
>
> --
> Mails please to josef dot moellers
> and I'm on gmx dot de.

I have quickly written the following and tested it successfully:

while (<>) {
	if (/^\(.* id="(.*)"\)/) {
		       	print "$1\n";
		}
}

This works.
Best regards,
jordi



------------------------------

Date: Thu, 01 Nov 2007 22:53:31 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: string matching doesn't work
Message-Id: <fgdit2$otm$1@mlucom4.urz.uni-halle.de>

Jack wrote:
> Hello, I have a little problem. i am trying to extract some text from
> a file. I need to get the first names and last names as well as the
> data between the <TD> tags which corresponds to Current Status. For
> example:
> 
> <h1>Mr. firstname lastname</h1>
> <th class="profile"><nobr>Current Status</nobr></th><td
> class="profile" colspan="2">Some data</td>
> so i need firstname lastname as well as some data. my current string
> looks like this but it doesn't work.
>  if (@content =~ m/<h1>Mr.*<\/h1>/){
>                 print "here " . $1;
>         }


If you use this more often and in a production
environment, you might be better of after
learning one of the HTML-Parser modules:

http://search.cpan.org/~gaas/HTML-Parser-3.56/

But if its only an occasional thing to do,
you can built a regular expression for
extraction, like:

  ...

  my $html='
   <h1>Mr. firstname lastname</h1>
   <th class="profile"><nobr>Current Status</nobr></th>
   <td class="profile" colspan="2">Some data</td>
  ';

  my $expr = qr{
                <h1> ([^<]+) </h1>        # stuff in h1 => $1
                .+?                       # jump to the next td
                <td[^>]+> ([^<]+) </td>   # stuff in td => $2
               }sx;


  print "h1 => |$1|, td => |$2|\n" while $html =~ /$expr/g;

  ...

Regards

M.


------------------------------

Date: Thu, 01 Nov 2007 22:23:23 -0000
From:  Mahesh Asolkar <asolkar@gmail.com>
Subject: Re: string matching doesn't work
Message-Id: <1193955803.719812.182440@y27g2000pre.googlegroups.com>

On Nov 1, 2:48 pm, Jack <accpac...@hotmail.com> wrote:
> Hello, I have a little problem. i am trying to extract some text from
> a file. I need to get the first names and last names as well as the
> data between the <TD> tags which corresponds to Current Status. For
> example:
>
> <h1>Mr. firstname lastname</h1>
> <th class="profile"><nobr>Current Status</nobr></th><td
> class="profile" colspan="2">Some data</td>
>
> so i need firstname lastname as well as some data. my current string
> looks like this but it doesn't work.
>
>  if (@content =~ m/<h1>Mr.*<\/h1>/){
>                 print "here " . $1;
>         }
>
> Please help....

I would use something like the HTML::TreeBuilder module to extract
information out of HTML data.

If you want to stick with pattern matching, following should be
informative:

perldoc perlretut (or http://perldoc.perl.org/perlretut.html)
perldoc perlre (or http://perldoc.perl.org/perlre.html)

HTH,
Mahesh.



------------------------------

Date: Thu, 1 Nov 2007 17:43:21 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: string matching doesn't work
Message-Id: <slrnfiklk9.hbj.tadmc@tadmc30.sbcglobal.net>

Jack <accpactec@hotmail.com> wrote:

>  if (@content =~ m/<h1>Mr.*<\/h1>/){


The match operator works on a string, not on an array.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Thu, 1 Nov 2007 23:47:15 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: string matching doesn't work
Message-Id: <fgdp62.1co.1@news.isolution.nl>

Jack schreef:

>  if (@content =~ m/<h1>Mr.*<\/h1>/){
>                 print "here " . $1;
>         }

$ perl -le'
# use warnings;
    @c = qw(abc de fghi);
    if (@c =~ /([bdg0-9])/) {
        print $1;
    }
'
3

-- 
Affijn, Ruud

"Gewoon is een tijger."


------------------------------

Date: Thu, 01 Nov 2007 23:02:35 -0400
From: James Egan <jegan472@comcast.net>
Subject: That should read all refer to XML::Simple
Message-Id: <L7WdnYnbhPvWDrfanZ2dnUVZ_vqpnZ2d@comcast.com>

That should read all refer to XML::Simple, not XML::Writer.




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 997
**************************************


home help back first fref pref prev next nref lref last post