[25518] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7762 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 9 18:06:07 2005

Date: Wed, 9 Feb 2005 15:05:35 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 Feb 2005     Volume: 10 Number: 7762

Today's topics:
    Re: Alternative in regexps <nobull@mail.com>
    Re: Alternative in regexps <nobull@mail.com>
    Re: Alternative in regexps <someone@example.com>
    Re: Alternative in regexps <matternc@comcast.net>
    Re: back references <abigail@abigail.nl>
        Coding habits [Was: Alternative in regexps] <grabek@invalid.com>
    Re: Coding habits [Was: Alternative in regexps] <grabek@invalid.com>
    Re: Coding habits [Was: Alternative in regexps] <nobull@mail.com>
    Re: Easy Method to 'slurp' a line toeknized by split <rhugga@yahoo.com>
    Re: Easy Method to 'slurp' a line toeknized by split <rhugga@yahoo.com>
    Re: Easy Method to 'slurp' a line toeknized by split <rhugga@yahoo.com>
    Re: Easy Method to 'slurp' a line toeknized by split <ebohlman@omsdev.com>
        Error & quot <metri.jain@gmail.com>
    Re: Error & quot <yyusenet@yahoo.com>
    Re: Error & quot <metri.jain@gmail.com>
    Re: Error & quot <postmaster@castleamber.com>
        fetch a manay URL's <news@example.com>
    Re: fetch a manay URL's <ebohlman@omsdev.com>
    Re: fetch a manay URL's <postmaster@castleamber.com>
        fetching a URL  <news@example.com>
    Re: Getting a hash into a savable format <yyusenet@yahoo.com>
    Re: Getting a hash into a savable format <yyusenet@yahoo.com>
    Re: Have issues trying to compile Math::Pari on AIX.... <noeldamonmiller@gmail.com>
        help with an anonymous array of anonymous hashes <noeldamonmiller@gmail.com>
        installing modules to ActiveState Perl from cpan downlo ioneabu@yahoo.com
    Re: memory for regex engine <glex_nospam@qwest.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 9 Feb 2005 11:41:33 -0800
From: "nobull@mail.com" <nobull@mail.com>
Subject: Re: Alternative in regexps
Message-Id: <1107978093.200028.5450@f14g2000cwb.googlegroups.com>

Lukasz Grabun wrote:

[of parsing HTML with a regex ]

> Anyway, this one does not work; or rather it does the work
> but only under special circumstances

Yes, that's why you should parse HTML using an HTML parser not attempt
to do it with just regex.

Modules for parsing HTML can be found on CPAN.



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

Date: 9 Feb 2005 11:51:28 -0800
From: "nobull@mail.com" <nobull@mail.com>
Subject: Re: Alternative in regexps
Message-Id: <1107978688.935169.38010@o13g2000cwo.googlegroups.com>

Lukasz Grabun wrote:
> I am very new to perl so please don't critisize my poor
> coding skills.

Can you explain why you think it would be good to wait until your bad
coding habits become deeply established before you do anything about
them?



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

Date: Wed, 09 Feb 2005 19:55:33 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Alternative in regexps
Message-Id: <VUtOd.16351$K54.4452@edtnps84>

Lukasz Grabun wrote:
> 
> Say there is a HTML code containting HTML tags (oh, really?) to which we 
> want to add id="p-$number" attribute. The number, after each insertion, 
> is increased by, say, five in order to make ids unique. I guess it can 
> be easily done with regexps though I couldn't figure out the way. Here's 
> what I've come up with so far:
> 
> #!/usr/bin/perl -w

use warnings;
use strict;


> # getting input values
> $prefix = $ARGV[0]; $infile = $ARGV[1]; $outfile = $ARGV[2];

my ( $prefix, $infile, $outfile ) = @ARGV;


> open(INPUT,"<$infile");
> open(OUTPUT,">$outfile");

You should verify that the files were opened correctly:

open INPUT,  '<', $infile  or die "Cannot open $infile: $!";
open OUTPUT, '>', $outfile or die "Cannot open $outfile: $!";


> $number = 5;

my $number = 5;


> while (<INPUT>)
> {
> 
> # match any element worth adding an id to
> 
>     if (s/(\<p)|(\<h1)|(\<h2)|(\<h3)|(\<h4)|(\<h5)|(\<h6)|
>        (\<blockquote)|(\<ul)|(\<ol)|(\<em)|(\<strong)/$1 
> 	id=\"$prefix-$number\"/)
> 	{ $number += 5; } # and increase the counter

You are using capturing parentheses for each tag so '<p' is in $1, '<h1' is in 
$2, '<h2' is in $3, etc.  You need a single pair of capturing parentheses.

      if ( s/(<(?:p|h[1-6]|blockquote|ul|ol|em|strong))/$1 
id="$prefix-$number"/g ) {


>     print OUTPUT $_;
> }


John
-- 
use Perl;
program
fulfillment


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

Date: Wed, 09 Feb 2005 16:00:55 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Alternative in regexps
Message-Id: <NeqdnQDibuCa55ffRVn-oQ@comcast.com>

Lukasz Grabun wrote:

> Hello,
> 
> Say there is a HTML code containting HTML tags (oh, really?) to which we
> want to add id="p-$number" attribute. The number, after each insertion,
> is increased by, say, five in order to make ids unique. I guess it can
> be easily done with regexps though I couldn't figure out the way. 

No, it can't. Do NOT parse HTML with regular expressions.  That way lies
madness.

> Here's 
> what I've come up with so far:

<snip>
> 
> 
> Could anyone, please, provide me with few tips or a proper google query?
> Thanks in advance.

Go to CPAN, get an HTML-parsing module that looks like it'll meet your
needs, live happily ever after.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: 09 Feb 2005 21:08:48 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: back references
Message-Id: <slrnd0kuv0.g2.abigail@alexandra.abigail.nl>

REH (bogus@nowhere.net) wrote on MMMMCLXXX September MCMXCIII in
<URL:news:cudhe9$igo3@cui1.lmms.lmco.com>:
&&  
&&  "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
&&  news:cudbuc$n1g$2@mamenchi.zrz.TU-Berlin.DE...
&& > > I'm sorry for being vague.  I mean using backreferences in the
&&  replacement
&& > > part of a regular expression.  I need to have a "\1" immediately
&&  followed by
&& > > a number, such as "\11" but the last one is not part of the
&&  backreference.
&& >
&& > You don't use that kind of backreference in the replacement part, you
&& > use the capturing variables $1, $2, etc.  This is simple string
&& > interpolation:  "${1}2".
&& >
&& > Anno
&&  
&&  Thank you.  That's interesting.  I've always used the backslash form and
&&  Perl allowed it.  Is there a difference between the two?


Yes. The backslash form was there to make it easy for sed programmers
to move to Perl. Which made sense, oh, 15 years ago. The dollar variables
will work regardless of their number - if you have 322 sets of parenthesis,
$322 will be whatever the 322th pair of parenthesis matched.

\322, on the other hand, will be the character Ò. See, a backslash 
followed by numbers is an octal escape. It's just that a backslash
followed by a single digit is special cased in the replacement part
of a s///.

Using \ followed by a single digit in the replacement part of a substitution
has triggered a warning since at least perl 5.000.

Perhaps it's time you enable warnings.

What interests me is, what made you use the backslash form? Who taught you?


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: Wed, 9 Feb 2005 19:57:38 +0000 (UTC)
From: Lukasz Grabun <grabek@invalid.com>
Subject: Coding habits [Was: Alternative in regexps]
Message-Id: <slrnd0kqq0.2pb.grabek@localhost.localdomain>

On 9 Feb 2005 11:51:28 -0800, nobull@mail.com wrote:

> Can you explain why you think it would be good to wait until your bad
> coding habits become deeply established before you do anything about
> them?

You can't really call them habits as they're no habits at all; one can 
have habits connected with anything he/she is not aware of. I've been 
programming in perl for three days right now; formerly I've been doing 
some C and awk and can't really tell anything bad about habits (not that 
I can tell anything good, but that's another kettle of fish).

Anyway, could you possibly point me to some good tutorial on "coding 
habits" - as you call them - regarding perl, in particular? Or rather, 
explain what was done incorrectly in the code I posted an hour ago? 
Thanks in advance.



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

Date: Wed, 9 Feb 2005 19:59:03 +0000 (UTC)
From: Lukasz Grabun <grabek@invalid.com>
Subject: Re: Coding habits [Was: Alternative in regexps]
Message-Id: <slrnd0kqsl.2pb.grabek@localhost.localdomain>

On Wed, 9 Feb 2005 19:57:38 +0000 (UTC), Lukasz Grabun wrote:

> You can't really call them habits as they're no habits at all; one can 

*slaps forehead* can't, of course.



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

Date: 9 Feb 2005 12:41:11 -0800
From: "nobull@mail.com" <nobull@mail.com>
Subject: Re: Coding habits [Was: Alternative in regexps]
Message-Id: <1107981671.482421.286280@c13g2000cwb.googlegroups.com>


Lukasz Grabun wrote:

> ... explain what was done incorrectly in the code I posted an hour
ago? 

See John W. Krahn's response.



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

Date: 9 Feb 2005 11:23:23 -0800
From: "Rhugga" <rhugga@yahoo.com>
Subject: Re: Easy Method to 'slurp' a line toeknized by split
Message-Id: <1107977003.164564.321770@c13g2000cwb.googlegroups.com>


Maybe I am seeing a bug on SLES 9 then. I initially tried an approach
like this:

my ($log_count, $log_month, $log_day, $log_time, $log_hostname,
      $log_proc_info, $log_message) = split( / /, $line);

I was getting errant non-consistent results. (which is why  I dummied
it down to the brute force approach I posted in the orignal post) The
code I listed above is in a debug type of setup right now. I'll look at
it again, just working on not much sleep and haven't written much perl
in the last 5 years so very rusty. Ironcially, I parse the local
timestamp into vars in the same way as you are suggesting for my data
and that works fine.

@ARGS is in all caps because it is my preference to set all caps for
var names of 'un-refined' data. By un-refined meaning something I
intend to do with it later on. When I see @ARGS or @MYVAR for example,
that tells me this is raw data generated from a split() or something
similiar. Just a personal preference. I'm the only one that sees my
code so I dont need to adhere to coding standards as one would in a
team envrionment.

The reason why my() is missing is because the code you see is inside a
loop, I define all those vars before the loop using my(). Once one
iteration of the loop ends I no longer have a need for anything stored
in those vars. (as this is getting shoved into oracle)

Thanks for all the suggestions, I defintely have much more to go on
now.

Thx



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

Date: 9 Feb 2005 11:24:28 -0800
From: "Rhugga" <rhugga@yahoo.com>
Subject: Re: Easy Method to 'slurp' a line toeknized by split
Message-Id: <1107977068.579418.259720@o13g2000cwo.googlegroups.com>


Maybe I am seeing a bug on SLES 9 then. I initially tried an approach
like this:

my ($log_count, $log_month, $log_day, $log_time, $log_hostname,
      $log_proc_info, $log_message) = split( / /, $line);

I was getting errant non-consistent results. (which is why  I dummied
it down to the brute force approach I posted in the orignal post) The
code I listed above is in a debug type of setup right now. I'll look at
it again, just working on not much sleep and haven't written much perl
in the last 5 years so very rusty. Ironcially, I parse the local
timestamp into vars in the same way as you are suggesting for my data
and that works fine.

@ARGS is in all caps because it is my preference to set all caps for
var names of 'un-refined' data. By un-refined meaning something I
intend to do with it later on. When I see @ARGS or @MYVAR for example,
that tells me this is raw data generated from a split() or something
similiar. Just a personal preference. I'm the only one that sees my
code so I dont need to adhere to coding standards as one would in a
team envrionment.

The reason why my() is missing is because the code you see is inside a
loop, I define all those vars before the loop using my(). Once one
iteration of the loop ends I no longer have a need for anything stored
in those vars. (as this is getting shoved into oracle)

Thanks for all the suggestions, I defintely have much more to go on
now.

Thx



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

Date: 9 Feb 2005 11:28:27 -0800
From: "Rhugga" <rhugga@yahoo.com>
Subject: Re: Easy Method to 'slurp' a line toeknized by split
Message-Id: <1107977307.527668.281960@f14g2000cwb.googlegroups.com>


Just FYI:

@ARGS = (split / /, $line, 7);

This works perfectly, so much thanks for that suggestion.  I just need
to revert back to my ($count, $month, ...) = (split / /, $line, 7);

Thx all.



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

Date: 9 Feb 2005 21:40:19 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Easy Method to 'slurp' a line toeknized by split
Message-Id: <Xns95F8A0B5BDC0ebohlmanomsdevcom@130.133.1.4>

"Rhugga" <rhugga@yahoo.com> wrote in news:1107977068.579418.259720
@o13g2000cwo.googlegroups.com:

> The reason why my() is missing is because the code you see is inside a
> loop, I define all those vars before the loop using my(). Once one
> iteration of the loop ends I no longer have a need for anything stored
> in those vars. (as this is getting shoved into oracle)

If the variables are used only inside the loop, you should be declaring 
them inside the loop.  Variables should have the narrowest possible scope; 
among other things, it will make it easier to understand/modify your code 
when you come back to it six months later.


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

Date: 9 Feb 2005 13:22:07 -0800
From: "geek" <metri.jain@gmail.com>
Subject: Error & quot
Message-Id: <1107984127.002384.8340@l41g2000cwc.googlegroups.com>

Hi all,

I am getting following error when I try to run the script a part of
which is shown below.

Error:<PRE>syntax error at sem_reg_test.cgi line 192, near &quot;|| die
&quot;$0&quot;

Any help will be appreciated.

Thanks,
MJ

=========================================================================
else {
      open(COURSEINFO,$coursefile)
       || die "$0:  Could not read course information ($coursefile):
$!\n";

#   flock(COURSEINFO, 1);

   while (<COURSEINFO>) {
      # remove trailing newline
      chomp;

      # save comments and blank lines
      if (/^#/ || /^\s*$/) {
          push(@courses_new, $_);
          next;
      }



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

Date: Wed, 09 Feb 2005 15:29:06 -0700
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: Error & quot
Message-Id: <cue2rh$e22$3@news.xmission.com>

geek wrote:
> Hi all,
> 
> I am getting following error when I try to run the script a part of
> which is shown below.
   It would help for you to show the complete script, not only part.
> 
> Error:<PRE>syntax error at sem_reg_test.cgi line 192, near &quot;|| die
> &quot;$0&quot;
   Where is line 192?  I don't see a $quot anywhere inside of the 
following piece of code.
> 
> Any help will be appreciated.
> 
> Thanks,
> MJ
> 
> =========================================================================
> else {
>       open(COURSEINFO,$coursefile)
>        || die "$0:  Could not read course information ($coursefile):
> $!\n";
> 
> #   flock(COURSEINFO, 1);
> 
>    while (<COURSEINFO>) {
>       # remove trailing newline
>       chomp;
> 
>       # save comments and blank lines
>       if (/^#/ || /^\s*$/) {
>           push(@courses_new, $_);
>           next;
>       }
> 

It might be pretty hard for anyone to debug the piece of code you have 
provided.  Please provide some code that can be run without typing the 
other 200 lines of it.  Thanks,
-- 
k g a b e r t (@at@) x m i s s i o n (.dot.) c o m

* 	After "extensive" research, I noticed
*	that yyusenet@yahoo.com received 12
*	spam e-mail messages after just two
*	posts on usenet groups.  If you want
*	to email me, use the "encrypted"
*	email address at the beginning of my
*	signature.


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

Date: 9 Feb 2005 14:36:54 -0800
From: "geek" <metri.jain@gmail.com>
Subject: Re: Error & quot
Message-Id: <1107988614.548493.71810@c13g2000cwb.googlegroups.com>

Sorry for the confusion .
I have specified the line # in the code.
Exactly even I don't see any $quot in my script infact I know there is
no $quot in the script.

Thanks,
MJ
geek wrote:
> Hi all,
>
> I am getting following error when I try to run the script a part of
> which is shown below.
>
> Error:<PRE>syntax error at sem_reg_test.cgi line 192, near &quot;||
die
> &quot;$0&quot;
>
> Any help will be appreciated.
>
> Thanks,
> MJ
>
>
=========================================================================
> else {
>       open(COURSEINFO,$coursefile)
> line:192       || die "$0:  Could not read course information
($coursefile):
>   $!\n";
>
> #   flock(COURSEINFO, 1);
>
>    while (<COURSEINFO>) {
>       # remove trailing newline
>       chomp;
>
>       # save comments and blank lines
>       if (/^#/ || /^\s*$/) {
>           push(@courses_new, $_);
>           next;
>       }



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

Date: 9 Feb 2005 22:59:57 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Error & quot
Message-Id: <Xns95F8ACEBB3FAcastleamber@130.133.1.4>

geek wrote:

> Hi all,
> 
> I am getting following error when I try to run the script a part of
> which is shown below.
> 
> Error:<PRE>syntax error at sem_reg_test.cgi line 192, near &quot;|| die
> &quot;$0&quot;

And which line is 192?

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Wed, 09 Feb 2005 21:11:35 GMT
From: "new" <news@example.com>
Subject: fetch a manay URL's
Message-Id: <b0vOd.29250$8H2.19038@twister.nyroc.rr.com>

at this time I am using
use LWP::Simple;
and
$tmp = get ('http://example.com');

to get several webpages.
when they are all downloadded I parse the data and display some results

this kinda sucks right now because it waits for on URL to load before
loading the next one is loaded.

can some one point me to a tutorial or something on how to use a call back
function with a timeout option to do this?

any suggestions would be good all I realy want is a way to load all the
URL's at once and know when they are done loading or maybe wait X seconds or
so then move on.

remeber I am really new to perl

Thanks for your help




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

Date: 9 Feb 2005 22:02:07 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: fetch a manay URL's
Message-Id: <Xns95F8A467ADDDFebohlmanomsdevcom@130.133.1.4>

"new" <news@example.com> wrote in
news:b0vOd.29250$8H2.19038@twister.nyroc.rr.com: 

> any suggestions would be good all I realy want is a way to load all
> the URL's at once and know when they are done loading or maybe wait X
> seconds or so then move on.

Look into LWP::Parallel; it was designed for exactly what you want to do.


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

Date: 9 Feb 2005 22:58:03 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: fetch a manay URL's
Message-Id: <Xns95F8AC99C66BCcastleamber@130.133.1.4>

new wrote:

> this kinda sucks right now because it waits for on URL to load before
> loading the next one is loaded.

So it doesn't suck :-D

For sucking in parallel see LWP::Parallel::UserAgent.

(go to CPAN: http://www.cpan.org/ e.g. http://search.cpan.org/search?
mode=all&query=parallel )


-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Wed, 09 Feb 2005 20:58:37 GMT
From: "new" <news@example.com>
Subject: fetching a URL 
Message-Id: <1QuOd.29249$8H2.5450@twister.nyroc.rr.com>

use LWP::Simple;

my $tmp = Get($url);





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

Date: Wed, 09 Feb 2005 15:25:35 -0700
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: Getting a hash into a savable format
Message-Id: <cue2ku$e22$1@news.xmission.com>

John Bokma wrote:
> YYusenet wrote:
  [snip]
> 
> If you want it back in %table:
> 
> %table = %$hashref;
> 

Thank you!  The part that I was unsure about how to do was the %$hashref!

Thank you again,

-- 
k g a b e r t (@at@) x m i s s i o n (.dot.) c o m

* 	After "extensive" research, I noticed
*	that yyusenet@yahoo.com received 12
*	spam e-mail messages after just two
*	posts on usenet groups.  If you want
*	to email me, use the "encrypted"
*	email address at the beginning of my
*	signature.


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

Date: Wed, 09 Feb 2005 15:25:38 -0700
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: Getting a hash into a savable format
Message-Id: <cue2l2$e22$2@news.xmission.com>

J=FCrgen Exner wrote:
> YYusenet wrote:
>=20
>>Data::Dumper seems to dump out a human readable form of the data.  The
>>only problem is, it seems to me that it will be more work to get that
>>data back into the program than if you were to just print out a tab
>>delimited form of the data.
>=20
>=20
> Why instead of guessing don't you just read the first two paragraphs of=
 the=20
> documentation for Data::Dumper?
>=20
> <quote>
>     Given a list of scalars or reference variables, writes out their
>     contents in perl syntax. [...]
>=20
>     The return value can be "eval"ed to get back an identical copy of t=
he
>     original reference structure.
> </quote>
>=20
> jue=20
>=20
>=20
The reason is because I would like to get something a little bit more=20
compact then that.

--=20
k g a b e r t (@at@) x m i s s i o n (.dot.) c o m

* 	After "extensive" research, I noticed
*	that yyusenet@yahoo.com received 12
*	spam e-mail messages after just two
*	posts on usenet groups.  If you want
*	to email me, use the "encrypted"
*	email address at the beginning of my
*	signature.


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

Date: 9 Feb 2005 12:51:04 -0800
From: "noeldamonmiller@gmail.com" <noeldamonmiller@gmail.com>
Subject: Re: Have issues trying to compile Math::Pari on AIX......Please help!
Message-Id: <1107982264.197355.217980@l41g2000cwc.googlegroups.com>

BTNA,



     Did you try cpan? It will help you get any pre-requisites.

type as root 

perl -MCPAN -e shell


hope that helps,

Bigoldrock



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

Date: 9 Feb 2005 12:48:12 -0800
From: "noeldamonmiller@gmail.com" <noeldamonmiller@gmail.com>
Subject: help with an anonymous array of anonymous hashes
Message-Id: <1107982092.501936.312440@c13g2000cwb.googlegroups.com>

All,



     Here's the scenario. There is an anonymous array used to store
netstat information (from a system call) as follows (why? I don't know
a better way to get it):

(@elements has netstat info split to enable the info below to work
correctly)

@connection = {
		    "UID" 		=> "$elements[6]",
		    "PID" 		=> "$elements[8]",
		    "IPadd" 	        => "$elements[4]"
		    };

Now, I can access the values of the elements ie, get the UID # and PID#
as follows

foreach $href ( @connection ) {
     foreach $role ( keys %$href ) {
           print "the monitor href is $href->{$role}\n"
      }
}

with this kind of output:


the monitor href is 11743/kopete
the monitor href is 500
the monitor href is 216.155.193.164:5050
the monitor href is 11169/smbd
the monitor href is 0
the monitor href is 192.168.0.14:1036

so, in summary, as far as I can tell we have:

@connection with hash0, hash1, hash2, etc. each one of them referred to
individually as $href

and %$href with 11743/kopete, 500, 216.155.193.164:5050 (UID,PID,IPadd)

my question is, how do I access each value of these elements
individually? I can do it the cheesy way by doing the foreach loops
above and get for instance an array of IPaddresses:

foreach $href ( @connection ) {
     foreach $role ( keys %$href ) {
          if ($role eq "IPadd") { push @noport_ipadd, $href->{$role}; }

     }
}

What I want to do is something like the pseudo-code below, only
syntactically correct:

foreach $href ( @connection ){ push @noport_ipadd, %$href->$role[2];}


I think I'm missing something with regards to dereferencing this stuff,
but unsure.

Thank you very much for any help.

Bigoldrock



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

Date: 9 Feb 2005 13:03:02 -0800
From: ioneabu@yahoo.com
Subject: installing modules to ActiveState Perl from cpan downloads
Message-Id: <1107982982.191618.44150@c13g2000cwb.googlegroups.com>

I just got one of those keychain usb 64mb memory chips today as a gift,
so I put the ActiveState Perl installation file and html version of
perldocs on it.

Suppose I am at a friend's house telling him about how great Perl is
and he wants it installed.  I then try to run one of my programs and a
needed module is missing.  His internet connection is down.  I have the
needed module install files on my memory stick which were downloaded
from cpan.  Do I have to use ppm to install?  Do they have to be in ppm
format?  What if I install them on my machine and then copy my lib
directory and carry that with me?  As far as compilation, I will
probably only be using them on Windows XP machines anyway.

Thanks!

wana



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

Date: Wed, 09 Feb 2005 15:01:34 -0600
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: memory for regex engine
Message-Id: <OSuOd.40$hj3.1513@news.uswest.net>

Mark wrote:

> Thank you all for your suggestions. And you were all right, too: it was
> not a memory problem -- it just took a while. :) I waited out an entire
> process, and it took aout 20 minutes per regex to complete. Time does
> seem to increase exponentially. I broke down the huge strings in 32K
> chunks (which is possible in this particular case), and now everything is
> up to speed again.

This article may be of interest:

http://www.perl.com/pub/a/2003/09/10/bioinformatics.html


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

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 V10 Issue 7762
***************************************


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