[28348] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9712 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 11 11:06:33 2006

Date: Mon, 11 Sep 2006 08:05:08 -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           Mon, 11 Sep 2006     Volume: 10 Number: 9712

Today's topics:
    Re: DLL Call Follies <technopundit@gmail.com>
    Re: exec command issue <bik.mido@tiscalinet.it>
    Re: gah! <1usa@llenroc.ude.invalid>
    Re: gah! <syscjm@gwu.edu>
    Re: Hash slice from a hash reference? <ced@blv-sam-01.ca.boeing.com>
    Re: Hash slice from a hash reference? <bik.mido@tiscalinet.it>
    Re: How to extract all link from web page (loaded in va <bik.mido@tiscalinet.it>
        i need to ssh to remote server using Perl vish.chitnis@gmail.com
    Re: i need to ssh to remote server using Perl <Bpant@mathworks.com>
    Re: i need to ssh to remote server using Perl vish.chitnis@gmail.com
    Re: i need to ssh to remote server using Perl <mritty@gmail.com>
    Re: i need to ssh to remote server using Perl <mritty@gmail.com>
    Re: i need to ssh to remote server using Perl <mritty@gmail.com>
    Re: Integrate Compress::Zlib seamlessly w/no compressio <paul.marquess@btinternet.com>
    Re: Maximum number of sockets <angusma@attglobal.net>
    Re: need to clear cookies in IE using perl Win 32 IE au vish.chitnis@gmail.com
        New release of Config-Model, first draft for Xorg model <domi@komarr.grenoble.hp.com>
        New release of Config-Model, first draft for Xorg model <domi@komarr.grenoble.hp.com>
    Re: PAR and pp <Jakanapes@aol.com>
        regular expression help <eagle_speaks@yahoo.co.uk>
    Re: regular expression help <AaronJSherman@gmail.com>
    Re: regular expression help <bik.mido@tiscalinet.it>
    Re: scalar to method name <ced@blv-sam-01.ca.boeing.com>
    Re: scalar to method name (Randal L. Schwartz)
    Re: scalar to method name <thepoet_nospam@arcor.de>
    Re: scalar to method name anno4000@radom.zrz.tu-berlin.de
    Re: what does underscore stands for ? <bik.mido@tiscalinet.it>
    Re: what does underscore stands for ? <AaronJSherman@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 11 Sep 2006 05:33:51 -0700
From: "Kythe" <technopundit@gmail.com>
Subject: Re: DLL Call Follies
Message-Id: <1157978030.940591.246290@m73g2000cwd.googlegroups.com>

Thanks, Rob.

I think I may have found the trouble -- I may have stupidly omitted an
input argument to the function :(  At the very least, it looks like
one's missing, and that can't be good.

Figures.

It also sucks that I can't post more details about the dll, but it's a
proprietary, third-party library.

Part of my problem is I've never used Win32::API before, and am not
certain that I'm not making basic, foolish mistakes.  But as you said,
I need to spend more time with trial and error on this.

Sisyphus wrote:
> "Kythe" <technopundit@gmail.com> wrote in message
> .
> .
> >
> > And here's the PERL code as it stands now:
> >
> > #!c:\perl\bin\perl.exe
> > $password = 'xxxxxxxx';
> > $cwd = 'C:\\Program Files\\MyDllWorkingDirectory\\';
> > $err_return = 0;
> > $buffersize = 32000;
> >
> > use Win32::API;
> > Win32::API::Struct->typedef('BUFFER', qw(BYTE Buffer[32000])) or die
> > "$!\n";
> > my $buff = Win32::API::Struct->new('BUFFER');
> >
> > $initialize = new
> > Win32::API("mydll.dll","InitializeDataBaseDbSrvr","CCSNP","V");
> > $initialize->Call($cwd,$password,$buff,$buffersize,$err_return);
> >
> > print "$err_return\n";
> >
>
> You should determine just which line of code is producing the error you
> reported. Is it the initial assignment to $buff, the initial assignment to
> $initialize, or the '$initialize->Call()' that's causing the error.
>
> I could be miles off ... but what happens if you rewrite that as:
>
> #!c:\perl\bin\perl.exe
> $password = 'xxxxxxxx';
> $cwd = 'C:\\Program Files\\MyDllWorkingDirectory\\';
> $err_return = 0;
> $buffersize = 32768;
> use Win32::API;
>
> my $buff = " " x $buffersize;
>
> $initialize = new
> Win32::API("mydll.dll","InitializeDataBaseDbSrvr","PPPNN","V"); # or maybe
> "PPPNP" as 3rd arg
> if (not defined $initialize)
>    {die "Failed to import InitializeDataBaseDbSrvr"}
> $initialize->Call($cwd,$password,$buff,$buffersize,$err_return);
>
> print "$err_return\n";
>
> Are you sure that InitializeDataBaseDbSrvr() does not return a value ?
>
> There are some people here who are quite good with Win32::API (though I'm
> not one of them). Be patient and you'll probably get a solution.
> 
> Cheers,
> Rob



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

Date: 11 Sep 2006 13:39:41 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: exec command issue
Message-Id: <0hiag2lu2noaj2tuff8k68m001ejs3rgla@4ax.com>

On Mon, 11 Sep 2006 10:49:13 +0100, "Don Corleone" <don@mastah.com>
wrote:

>Thanks for the information.

Again, *PLEASE* do not top-post!

>I didn't think 3 simple msdos commands would defeat my perl skills. Recorded 
>a macro to do the same in less than 2 mins.

Without any intention of a personal attack, your perl skills seem
quite limited. You may not want to progress further, which is fine of
course, or else I highly recommend reading say the first few chapters
of any introductory perl book or tutorial.

>perl 1 me 0

Do not put it that way: it would be nice if it were a chance to learn
anyway.

Side point: I guess quite everybody here loves Perl. Said this, choose
the right tool for your job: if it fits better a shell script, resort
to the latter with no regret whatsoever!


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Mon, 11 Sep 2006 14:32:37 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: gah!
Message-Id: <Xns983B6B40DEF3Aasu1cornelledu@132.236.56.8>

"Don Corleone" <don@mastah.com> wrote in
news:RdKdnRWayYxyl5jYRVnytw@giganews.com: 

> Subject: gah!

Bah!

*PLONK*

Sinan


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

Date: Mon, 11 Sep 2006 10:54:11 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: gah!
Message-Id: <12gau4kdjfp2g29@corp.supernews.com>

Christian Winter wrote:
> Don Corleone wrote:
> 
>> Thanks for some of the comments.
> 
> 
> Which comments? Those you are going to get?
> Oh, sorry, you are refering to a completely separate thread.
> My fault that I didn't see the connection between "gah!" and
> "exec command issue" at once...
> 
>> In a nutshell this is what i am trying to make the program do:
>>
>> 1. get a directory name (works ok)
>> 2. Get a list of all the tif files in this directory (works ok)
>> 3. perform a msdos file operation on each file returned by 2 above 
>> (doesnt work).
> 
>  >
> 
>> thats it. I dont get why 3 isnt working, any help appreciated.
> 
> 
> Would you have shown us the code (and the _exact_ one, while we
> are at that) you are using, we might be able to help you.
> 
> You still didn't read the posting guidelines to this group that
> Tad recommended to you, did you?
> 
> -Chris

Hell, he hasn't even read the responses to his own posts,
which have repeatedly told him exactly what his problem
is, nor has he read the documentation for the function
he is using, as some of the replies to his post have told
him to do, which would *also* tell him exactly what his
problem is.

-- 
              Christopher Mattern

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


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

Date: Mon, 11 Sep 2006 10:56:14 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Hash slice from a hash reference?
Message-Id: <J5FD1p.HwG@news.boeing.com>

Michele Dondi wrote:
> On Sat, 9 Sep 2006 09:38:02 -0700, "Mark G." <nospam@thanksanyway.org>
> wrote:
> 
>> # This doesn't work
>> @$hashref->{'key01','key03'} = ('val01','val03');
> 
> 
>   #!/usr/bin/perl
>   
>   use strict;
>   use warnings;
>   use Data::Dumper;
>   
>   
>   my %test01 = (key01=>'',key02=>'',key03=>'',key04=>'');
>   
>   ref_slice(\%test01);
>   
>   print Dumper \%test01;
>   
>   sub ref_slice {
>       my $hashref = shift;
>       @{$hashref}{qw/key01 key03/} = (qw/val01 val03/);
>   }
>   
>   __END__
> 
> Note that prefixing with a sigil, i.e. @{$hashref} in this case, is
> one way for dereferencing. The arrow operator is another one. So you
> may think of using the following:
> 
>   $hashref->{qw/key01 key03/} = (qw/val01 val03/);
> 
> However this doesn't work with more than one key, because it is not
> interpreted as a slice, but as an indexing over a multidimensional
> index, which is a now obsolete mechanism relying on C<$;>.
>

Granted, multidimensional hash emulation is seldom used but I've never 
seen any doc reference to it as 'obsolete'. It certainly is still useful
in some cases:

http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/9166b5a50f60dbbc/ed334c1734a2e2ef?lnk=st&q=&rnum=2&hl=en#ed334c1734a2e2ef

Also, at times in DBM app's for speed instead of the slower MLDBM.

-- 
Charles DeRykus



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

Date: 11 Sep 2006 13:35:03 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Hash slice from a hash reference?
Message-Id: <l8iag2960sbss8o6ns5qqbmjbbgkr48s26@4ax.com>

On Mon, 11 Sep 2006 10:56:14 GMT, Charles DeRykus
<ced@blv-sam-01.ca.boeing.com> wrote:

>Granted, multidimensional hash emulation is seldom used but I've never 
>seen any doc reference to it as 'obsolete'. It certainly is still useful
>in some cases:

I thought to have seen "officially" marked it as obsolete, but now I'm
not really sure. However if not officially, de facto it largely is,
now that we have real references. And for the cases in which one
really needs that kind of thing, an explicit join() (or a comparable
mechanism) would nicely fit in. Not to mention that we *will* have
real multidimentional indexing, first or later...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 11 Sep 2006 13:51:50 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to extract all link from web page (loaded in variable $content) to scalar @links?
Message-Id: <8ajag2h0j9jurgvl9o4mnr8lqv9fovskng@4ax.com>

On Mon, 11 Sep 2006 10:47:19 +0200, <maran@homewares.ro> wrote:

>How to extract all link from web page (loaded in variable $content) to
                                                           ^^^^^^^^
                                                           ^^^^^^^^

Not really relevant.

>scalar @links?

scalar @links amounts to the number of elements in @links. What do you
really mean?

Does

  perldoc -q url

help?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 11 Sep 2006 06:25:23 -0700
From: vish.chitnis@gmail.com
Subject: i need to ssh to remote server using Perl
Message-Id: <1157981123.293737.198810@q16g2000cwq.googlegroups.com>

i am trying to connect to remote machine using Perl..here is wht i have
found..in the net
use Net::SSH::Perl;
    my $ssh = Net::SSH::Perl->new($host);
    $ssh->login($user, $pass);
    my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
when i give my hostname and other details, the compilation error i get
is
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
c:/Perl/site/li
b .) at sshperl.pl line 1.
BEGIN failed--compilation aborted at sshperl.pl line 1.
whether i need to install any module for this

thanks
vish



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

Date: Mon, 11 Sep 2006 09:28:57 -0400
From: "Binod Pant" <Bpant@mathworks.com>
Subject: Re: i need to ssh to remote server using Perl
Message-Id: <ee3oap$kvt$1@fred.mathworks.com>

In my ActiveState Perl installation, I see the directory
C:\Perl\site\lib\URI

which has the ssh.pm file.
See if you have this installed. If not, use CPAN to install NET::SSH or any 
other library you require.

normally I do

>> perl -MCPAN -e shell
 cpan> install packagename

that's it!

HTH
Binod.

<vish.chitnis@gmail.com> wrote in message 
news:1157981123.293737.198810@q16g2000cwq.googlegroups.com...
>i am trying to connect to remote machine using Perl..here is wht i have
> found..in the net
> use Net::SSH::Perl;
>    my $ssh = Net::SSH::Perl->new($host);
>    $ssh->login($user, $pass);
>    my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> when i give my hostname and other details, the compilation error i get
> is
> Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
> c:/Perl/site/li
> b .) at sshperl.pl line 1.
> BEGIN failed--compilation aborted at sshperl.pl line 1.
> whether i need to install any module for this
>
> thanks
> vish
> 




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

Date: 11 Sep 2006 06:35:55 -0700
From: vish.chitnis@gmail.com
Subject: Re: i need to ssh to remote server using Perl
Message-Id: <1157981755.388702.54090@h48g2000cwc.googlegroups.com>

hi Binod
thanks for ur quick reply, i have verified that and found that the flie
ssh.pm does exist in the proper location..

still i have to install the package? if yes wht is the package name
shall i give


thanks
vish
Binod Pant wrote:
> In my ActiveState Perl installation, I see the directory
> C:\Perl\site\lib\URI
>
> which has the ssh.pm file.
> See if you have this installed. If not, use CPAN to install NET::SSH or any
> other library you require.
>
> normally I do
>
> >> perl -MCPAN -e shell
>  cpan> install packagename
>
> that's it!
>
> HTH
> Binod.
>
> <vish.chitnis@gmail.com> wrote in message
> news:1157981123.293737.198810@q16g2000cwq.googlegroups.com...
> >i am trying to connect to remote machine using Perl..here is wht i have
> > found..in the net
> > use Net::SSH::Perl;
> >    my $ssh = Net::SSH::Perl->new($host);
> >    $ssh->login($user, $pass);
> >    my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> > when i give my hostname and other details, the compilation error i get
> > is
> > Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
> > c:/Perl/site/li
> > b .) at sshperl.pl line 1.
> > BEGIN failed--compilation aborted at sshperl.pl line 1.
> > whether i need to install any module for this
> >
> > thanks
> > vish
> >



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

Date: 11 Sep 2006 06:38:01 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: i need to ssh to remote server using Perl
Message-Id: <1157981881.177262.70070@h48g2000cwc.googlegroups.com>

vish.chitnis@gmail.com wrote:
> i am trying to connect to remote machine using Perl..here is wht i have
> found..in the net
> use Net::SSH::Perl;
>     my $ssh = Net::SSH::Perl->new($host);
>     $ssh->login($user, $pass);
>     my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
> when i give my hostname and other details, the compilation error i get
> is
> Can't locate Net/SSH/Perl.pm in @INC (@INC contains: c:/Perl/lib
> c:/Perl/site/li
> b .) at sshperl.pl line 1.
> BEGIN failed--compilation aborted at sshperl.pl line 1.
> whether i need to install any module for this

Yes, you do.  Net::SSH::Perl is not a built-in module.  Use the ppm
program that came with your installation of ActivePerl to find it.  If
it doesn't exist in a ppm repository, you'll have to build it using
CPAN.  I strongly suggest in that case that you read:
perldoc perlmodinstall

Paul Lalli



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

Date: 11 Sep 2006 06:38:59 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: i need to ssh to remote server using Perl
Message-Id: <1157981938.943811.215210@e3g2000cwe.googlegroups.com>

Binod Pant wrote:
> In my ActiveState Perl installation, I see the directory
> C:\Perl\site\lib\URI
>
> which has the ssh.pm file.

I'm confused as to what you think URI::ssh has to do with
Net::SSH::Perl

Paul Lalli



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

Date: 11 Sep 2006 06:40:10 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: i need to ssh to remote server using Perl
Message-Id: <1157982010.515248.111210@i42g2000cwa.googlegroups.com>

vish.chit...@gmail.com wrote:
> hi Binod
> thanks for ur quick reply, i have verified that and found that the flie
> ssh.pm does exist in the proper location..

URI::ssh has *nothing* to do with Net::SSH::Perl.

> still i have to install the package?

Yes.

> if yes wht is the package name shall i give

The package you're trying to use is the package you need to install.
Net::SSH::Perl

Paul Lalli



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

Date: Mon, 11 Sep 2006 12:55:35 +0100
From: Paul Marquess <paul.marquess@btinternet.com>
Subject: Re: Integrate Compress::Zlib seamlessly w/no compression?
Message-Id: <45054eb7$0$11539$4d4eb98e@read.news.uk.uu.net>

Brian McCauley wrote:

> 
> A. Sinan Unur wrote:
>> peter.j.torelli@gmail.com wrote in news:1157745641.539097.116200
>> @d34g2000cwd.googlegroups.com:
>>
>> > Since the read/write/close methods for the object are not the same as
>> > an uncompressed filehandle, I can't just use a different open method
>> > for the same variable.  Instead I end up having to use open() and a
>> > pipe to gzip if compression is desired so that the same filehandle can
>> > be used without a ton of conditionals in the code.
>> >
>> > So the simple question is: how do I turn off all compression and
>> > headers when I use gzopen() and just write a plain text file?

There is no way to suppress the gzip header with the gzopen interface, even
when you use Z_NO_COMPRESSION.

>> But, that is the wrong question to ask. You can just write two dispatcher
>> class that have the identical interface, and hide the different
>> implementations of read/write/close methods behind these objects'
>> interfaces.
> 
> Or write a very thin shim that presents an interface like
> Compress::Zlib's read/write/close but just passes them strait through
> and use one of these objects instead.
> 
> Of course you could just us IO::Zib which gives Compress::Zlib a more
> filehandle-like interface.
> 
> There's also PerlIO::gzip but I don't know if this uses zlib or an
> external gzip process.

IO::Zlib or PerlIO::gzip are the best approaches to use at the moment.

  if (want compressed file) {
      $fh = IO::Zlib->new($filename, "wb9");
  }
  else {
      $fh = open ">$filename";
  }

  die "error ... error"
    unless $fh;

If you want to get into manipulating the gzip header, you could use
IO::Compress::Gzip, but that's still beta code.

Paul



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

Date: Mon, 11 Sep 2006 10:53:45 -0400
From: "A Ma" <angusma@attglobal.net>
Subject: Re: Maximum number of sockets
Message-Id: <4505787e@kcnews01>

"Brian McCauley" <nobull67@gmail.com> wrote in message 
news:1157788042.580214.9880@d34g2000cwd.googlegroups.com...
>
> A. Sinan Unur wrote:
>> "A Ma" <angusma@attglobal.net> wrote in news:4501aead$1@kcnews01:
>>
>> > I am using ActiveState Perl under Windows. The default maximum number 
>> > of
>> > sockets that I can open is 64. I found the parameter PERL_FD_SETSIZE in
>> > c:\perl\lib\core\sys\socket.h. I changed that number but it did not 
>> > take
>> > effect. Is there something else I need to change? Do I need to 
>> > recompile
>> > anything?
>>
>> That parameter is a reflection of the value obtained from the system, not
>> the determinant of the system's behavior.
>
> You'd think so wouldn't you. But (in C) that's not the case with
> FD_SETSIZE. The underlying select() is capable of coping with arbitrary
> sized fdsets, the macro FD_SETSIZE just determines how such space is
> allocated when you create an fdset.
>
> You can just change FD_SETSIZE, recompile your program and it will can
> have more sockets (I have actually done this in C on Windows).
>
>> Changing that value is the same
>> thing as spray painting a highway speed limit sign: It is not going to
>> change the rules.
>
> Not quite. In this case I suspect it does change the rules, but you
> need to make sure that everyone who needs to know the new rule has read
> the sign.  So I'm gussing you need to rebuild perl.
>

I suspect I have to recompile Perl but I am using ActiveState Perl and I 
don't have the source. So I am not sure how I can do that. Any further 
suggestions would be helpful. 




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

Date: 11 Sep 2006 06:17:38 -0700
From: vish.chitnis@gmail.com
Subject: Re: need to clear cookies in IE using perl Win 32 IE automation
Message-Id: <1157980658.135821.321300@p79g2000cwp.googlegroups.com>

thanks matt...i tried doing this..and the way i tried is using the
system commands in DOS to clease browser cookies..

system ('del /q /s /f "C:\Documents and Settings\user\Local
Settings\Temporary Internet Files\*.*"');
but i saw only few of the cache is getting deleted and not all the
files..any idea how do i clear the entire cache folder..
thanks
vish

Matt Garrish wrote:
> vish.chitnis@gmail.com wrote:
>
> > hi there,
> >
> > i am beginer in perl and i need to clear IE cookies and temporary
> > internet files before i call goto URl to access my application url. how
> > can i clear cookies and temp internet files?
> >
>
> I have no idea what calling goto URI is, but the fastest way I can
> think of to clear the cache would be to just delete everything in
>
> C:\Documents and Settings\<<current user>>\Local Settings\Temporary
> Internet Files
>
> where the current user obviously is you. First choices would just be to
> shell out and do a del from your script or use File::Find to traverse
> the directory and delete files as you go.
>
> If the location is variable, you can always get the cache directories
> from the registry in
> HKLM\Software\MIcrosoft\Windows\CurrentVersion\Internet Settings\Cache
> (on XP anyway).
> 
> Matt



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

Date: Mon, 11 Sep 2006 12:08:04 GMT
From: Dominique Dumont <domi@komarr.grenoble.hp.com>
Subject: New release of Config-Model, first draft for Xorg model
Message-Id: <J5FJDp.Hor@zorch.sf-bay.org>


Hello

I'm happy to announce the new release of the Config::Model [1] perl
module (v0.602) .

This version provide some modifications necessary to provide a
configuration model for Xorg.

I'm still working in this Xorg configuration model. You can view the
first files directly on CVS [2]. 

Currently, I have:
- a model for InputDevice Files and Modules section of xorg.conf
- a preliminary parser for xorg.conf

You may have noticed that progress is quite slow. I sure could use
some help in providing a working configuration model for Xorg.

Other changes of Config-Model are:
        * config-model: added -help and -man options to command line

        * Model.pm (load): model file now must return an array ref and not
        invoke Model methods. See t/big_model.pm for an example
        (load): can load model file for model class that contain '::'. In
        this case the model file is searched in a sub-directory just like
        a perl class (E.g Model::Foo -> Model/Foo.pm)

        * HashId.pm (create_default): can initialise children nodes while
        creating default keys. (Necessary to be able to write a
        configuration model for Xorg)

        * AnyId.pm (move): new method


You can download this package from CPAN [3] or sourceforge [4].

Cheers

[1] http://config-model.sourceforge.net/
[2] http://config-model.cvs.sourceforge.net/config-model/xorg/
[3] http://search.cpan.org/dist/Config-Model/
[4] http://sourceforge.net/project/showfiles.php?group_id=155650

-- 
Dominique Dumont 
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner




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

Date: Mon, 11 Sep 2006 12:08:04 GMT
From: Dominique Dumont <domi@komarr.grenoble.hp.com>
Subject: New release of Config-Model, first draft for Xorg model
Message-Id: <J5FJDv.Hr1@zorch.sf-bay.org>


Hello

I'm happy to announce the new release of the Config::Model [1] perl
module (v0.602) .

This version provide some modifications necessary to provide a
configuration model for Xorg.

I'm still working in this Xorg configuration model. You can view the
first files directly on CVS [2]. 

Currently, I have:
- a model for InputDevice Files and Modules section of xorg.conf
- a preliminary parser for xorg.conf

You may have noticed that progress is quite slow. I sure could use
some help in providing a working configuration model for Xorg.

Other changes of Config-Model are:
        * config-model: added -help and -man options to command line

        * Model.pm (load): model file now must return an array ref and not
        invoke Model methods. See t/big_model.pm for an example
        (load): can load model file for model class that contain '::'. In
        this case the model file is searched in a sub-directory just like
        a perl class (E.g Model::Foo -> Model/Foo.pm)

        * HashId.pm (create_default): can initialise children nodes while
        creating default keys. (Necessary to be able to write a
        configuration model for Xorg)

        * AnyId.pm (move): new method


You can download this package from CPAN [3] or sourceforge [4].

Cheers

[1] http://config-model.sourceforge.net/
[2] http://config-model.cvs.sourceforge.net/config-model/xorg/
[3] http://search.cpan.org/dist/Config-Model/
[4] http://sourceforge.net/project/showfiles.php?group_id=155650

-- 
Dominique Dumont 
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner




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

Date: 11 Sep 2006 07:35:42 -0700
From: "Jakanapes" <Jakanapes@aol.com>
Subject: Re: PAR and pp
Message-Id: <1157985342.895081.95310@d34g2000cwd.googlegroups.com>


smueller@cpan.org wrote:
> Jakanapes schrieb:
> > I'm a relative newbie to perl and I'm having some trouble creating a
> > standalone executable using PAR.
> >
> > I'm using Activeperl 5.8.8.819 and tried using PAR .952, however from
> > the command line, I'm getting "'pp' is not recognized as an internal or
> > external command..."
> >
> > On my previous machine, I had Activeperl 5.8.7 and PAR installed and
> > the pp command worked fine.
> >
> >
> > What might I be missing?
>
> Make sure you have PAR installed correctly. To verify that there is a
> PAR.pm at all, you can run this:
>
> perl -MPAR -e "print PAR->VERSION.qq{\n};"
>
> It should print 0.952 if you have the most current version of PAR.
>
> Now for the pp utility that comes with PAR. As another poster
> suggested, try searching your hard drive for pp.bat. Perhaps also try
> pp.pl or just pp.
> If it's found, try adding the directory that contains it to your PATH
> enviromnent variable.
>
> Moreover, it might be a little problematic to install PAR via ppm. In
> particular, if you want to do that, I suggest installing not from the
> ActiveState default repository but from the bribes.org ppm repository
> which is very good at staying up to date.
>
> For more details, please have a look at the PAR homepage at
> http://par.perl.org
>
> Best regards,
> Steffen M=FCller


I did get 0.952 from the MPAR command, but I can't find pp.bat
anywhere.  Thanks for the help....



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

Date: 11 Sep 2006 06:47:59 -0700
From: "eagle_speaks" <eagle_speaks@yahoo.co.uk>
Subject: regular expression help
Message-Id: <1157982479.001021.137820@h48g2000cwc.googlegroups.com>

Hi,
 I have the following data . From this I need to select the patern
matching

2.3.6 or 1.3.10  and nothing else.

-------------------
wedfsd
 communicationsAlarm linkSetFailure -MMN:SSNC L989
 2.3.6 signLinkTp
seffdLorgjh9890
------------------

I have tried various combinations but not getting much near

This expr
[([:digit:]\.[:digit:]\.[:digit:])*]*

is selecting this and everything else

so also is

\<[([:digit:]\.[:digit:]\.[:digit:])?]\>*

Can someone help me in in giving a expression which selects the pattern

digit.digit.digit

Thanks in advance



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

Date: 11 Sep 2006 06:57:41 -0700
From: "Aaron Sherman" <AaronJSherman@gmail.com>
Subject: Re: regular expression help
Message-Id: <1157983061.447872.126230@b28g2000cwb.googlegroups.com>


eagle_speaks wrote:
>
> 2.3.6 or 1.3.10  and nothing else.

 (2\.\3\.6|1\.3\.10)

You may or may not want a "\b" before and/or after that.

> I have tried various combinations but not getting much near
>
> This expr
> [([:digit:]\.[:digit:]\.[:digit:])*]*

This is wrong, but I think I understand what you were trying to do.
First off, you said you wanted to match nothing but the above numbers.
Did you mean that you wanted to match any triplet of dot-separated
integers instead? That would be:

 \d+\.\d+\.\d+

Again, with or without "\b" around it for requiring word-boundaries (to
avoid "Kernel2.6.17" for example).

Your mistakes above are:

1. POSIX named character ranges.

These cause untold problems for people because the nested brackets seem
to cause people's heads to fall out.

2. You are enclosing the entire match in brackets.

Your expression matches any number of the characters: "().0-9*" which
is decidedly not what you wanted.



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

Date: 11 Sep 2006 16:08:01 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: regular expression help
Message-Id: <46rag2lcde8j41erkck175fn287rf02esd@4ax.com>

On 11 Sep 2006 06:47:59 -0700, "eagle_speaks"
<eagle_speaks@yahoo.co.uk> wrote:

>This expr
>[([:digit:]\.[:digit:]\.[:digit:])*]*
 ^                                 ^
 ^ 1                               ^ 2

>is selecting this and everything else

1. Square parentheses do *not* do grouping;
2. * means match *zero* or more occurrencies of all this;
3. Consider using \d instead of [[:digit:]].

You may want something like

  \d+\.\d+\.\d+

or some improvement thereof: e.g. you may put limits on the length
digit sequences and add checks for word boundaries.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Mon, 11 Sep 2006 11:49:38 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: scalar to method name
Message-Id: <J5FFIq.J63@news.boeing.com>

Randal L. Schwartz wrote:
>>>>>> "anno4000" == anno4000  <anno4000@radom.zrz.tu-berlin.de> writes:
> 
> anno4000> That's true, but how is it relevant?  The expression contains three
> anno4000> variables, each of which could be user-determined and have malicious
> anno4000> content.  Just how malicious it could get can't be determined
> anno4000> without knowing which subs and methods exist in the environment and
> anno4000> also which freedom, if any, the user has in determining the
> anno4000> variables.
> 
> anno4000> Why does $method need special attention?
> 
> Because Perl got a black eye because SOAP::Lite permitted an exploit
> permitting anyone to run any command they chose if they had implemented *any*
> web service with SOAP::Lite.  Ouch.  And this was the vector.
> ...
>

(RPC::XML was similarly afflicted and was also patched)

I see an URL (unfortunately 404) in a recent SOAP::Lite version:

   # check to avoid security vulnerability:
   Protected->Unprotected::method(@parameters)
   # see for more details: http://www.phrack.org/phrack/58/p58-0x09   <--
   die "Denied access to method ($method_name)\n"
         unless $method_name =~ /^\w+$/;

Anyone know if the details are still available somewhere...

-- 
Charles DeRykus


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

Date: 11 Sep 2006 05:03:52 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: anno4000@radom.zrz.tu-berlin.de
Subject: Re: scalar to method name
Message-Id: <86zmd6boev.fsf@blue.stonehenge.com>

>>>>> "anno4000" == anno4000  <anno4000@radom.zrz.tu-berlin.de> writes:

>> $obj's class you have to check $method before the call. 
>> 
>> OTOH, calling a method with unchecked arguments is not inherently
>> unsafe: The method can (and should) check the arguments. 

anno4000> I isn't always immediately obvious what is safe.  Take $obj in the
anno4000> expression above.  If what the user can put there is always an object
anno4000> of an expected class, all is fine.  If the user has a way to put an
anno4000> arbitrary string there, methods in unexpected classes can be called
anno4000> (as class methods).

No, what we keep saying (and perhaps you keep missing) is that even if $obj is
an expected object, $method can be an *ARBITRARY SUBROUTINE NAME*, defined
ANYWHERE IN THE GLOBALS.

That is, given:

        $y = "Foo::Bar";
        $x->$y(@z);

You will get a call to Foo::Bar($x, @z) (unless Foo::Bar doesn't exist).  The
class of $x does not need to have anything to do with Foo::Bar.

This means that it's not enough to know that $x is a trusted object.  The
string $y also must be vetted.  This is the hole that was exploited, because
most people don't get this (perhaps even you since you seem to keep thinking
it's no big deal).

If that was clear to you already, your messages in response did not
acknowledge this danger.  If that *wasn't* clear to you, I hope you now see
the danger that even people of reasonable intelligence didn't see this one
coming.

print "Just another Perl hacker,"; # the original

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
Posted via a free Usenet account from http://www.teranews.com
Warning: Do not use Ultimate-Anonymity
They are worthless spammers that are running a scam.



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

Date: Mon, 11 Sep 2006 14:48:53 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: scalar to method name
Message-Id: <45055b35$0$18487$9b4e6d93@newsspool3.arcor-online.net>

Charles DeRykus wrote:
> I see an URL (unfortunately 404) in a recent SOAP::Lite version:
> 
>   # check to avoid security vulnerability:
>   Protected->Unprotected::method(@parameters)
>   # see for more details: http://www.phrack.org/phrack/58/p58-0x09   <--

You can find an archive at http://artofhacking.com/files/phrack/

-Chris


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

Date: 11 Sep 2006 13:09:19 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: scalar to method name
Message-Id: <4ml5fvF6jfk6U1@news.dfncis.de>

Randal L. Schwartz <merlyn@stonehenge.com> wrote in comp.lang.perl.misc:
> >>>>> "anno4000" == anno4000  <anno4000@radom.zrz.tu-berlin.de> writes:
> 
> >> $obj's class you have to check $method before the call. 
> >> 
> >> OTOH, calling a method with unchecked arguments is not inherently
> >> unsafe: The method can (and should) check the arguments. 
> 
> anno4000> I isn't always immediately obvious what is safe.  Take $obj in the
> anno4000> expression above.  If what the user can put there is always an object
> anno4000> of an expected class, all is fine.  If the user has a way to put an
> anno4000> arbitrary string there, methods in unexpected classes can be called
> anno4000> (as class methods).
> 
> No, what we keep saying (and perhaps you keep missing) is that even if $obj is
> an expected object, $method can be an *ARBITRARY SUBROUTINE NAME*, defined
> ANYWHERE IN THE GLOBALS.

Yes, I'm quite aware of that.  I use "$obj->Class::meth()" quite a bit.
My point (if I may call it that) is that other parts of the expression
can be (or definitely are) sensitive too.

In the snippet

    $obj->$method( @args)

clearly $method is the most sensitive variable.  However, as pointed
out elsewhere, if the user has a way to deposit an arbitrary class
name (instead of a blessed object) into $obj (or an object blessed into
an unexpected class), unexpected code could be called too, though not
as freely as through $method.

> If that was clear to you already, your messages in response did not
> acknowledge this danger. If that *wasn't* clear to you, I hope you now see
> the danger that even people of reasonable intelligence didn't see this one
> coming.

Given in isolation the danger is easy to spot.  That's why I didn't
think an explicit acknowledgement was necessary.  It's harder when
(say) $object has been copied and handed around a lot so only taint
knows that it may be suspect, and also when the critical line is one
of a few thousand.

Anno


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

Date: 11 Sep 2006 13:48:52 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: what does underscore stands for ?
Message-Id: <r7jag2d90qvlamegb807pngm7p57m7doem@4ax.com>

On 11 Sep 2006 01:26:28 -0700, "alpha_beta_release"
<youknows@gmail.com> wrote:

>What i found is that if we provide this '_' to the second (and
>subsequent) file test operations (-M, -f etc), the result returned is
>from the first test operation. Am i correct?

Yes you are, with the exceptions explained in the same document.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 11 Sep 2006 07:09:16 -0700
From: "Aaron Sherman" <AaronJSherman@gmail.com>
Subject: Re: what does underscore stands for ?
Message-Id: <1157983756.546771.293810@i42g2000cwa.googlegroups.com>


alpha_beta_release wrote:

>         -f $somefile;
>         -M _ ;          # use the result of above operation

> Actually i found this in Dir::Purge.pm, makes me wonder for while. It's
> no very clear at first. Anyway thanks Michele for the pointer.

It's clear if you understand the idioms of Perl, and not if you don't,
much the way casting to a function pointer looks like line noise in C
unless you understand that this is a common idiom, recognize it and
move on. The only difference is that Perl's idioms tend to hold more
semantic weight in fewer symbols.

_ in Perl is the sort of all-around tool meaning "default" or "supplied
input". It has different contexts:

 _ - stat-operation default (last stat block)
 $_ - Default value stored to and read from by many operations. Also
used as a temporary
 @_ - Parameter list to a subroutine

Personally, I've always thought _ should also be a label, such that
"next _" would always select the outermost loop, similar to the way
"next" without a parameter selects the innermost.



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

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 9712
***************************************


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