[24187] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6379 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 9 14:05:57 2004

Date: Fri, 9 Apr 2004 11: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           Fri, 9 Apr 2004     Volume: 10 Number: 6379

Today's topics:
    Re: "perl -w" vs "use warnings" <Joe.Smith@inwap.com>
    Re: Alternative to AUTOLOAD <jkrugman@yahbitoo.com>
        Archive::Zip Adding files with out directory info (Aqua)
    Re: Archive::Zip Adding files with out directory info <remorse@partners.org>
        CGI.pm for QNX 4.25 (Chilla)
    Re: CPAN.pm can't find libs <jwillmore@remove.adelphia.net>
        Design choice: subclassing or "supplementing" <jkrugman@yahbitoo.com>
        Dublin.pm <doc@RedBrick.DCU.IE.small.carrots>
        how to parse string from  [? <samwun@hgcbroadband.com>
    Re: how to parse string from  [? <jgibson@mail.arc.nasa.gov>
    Re: how to parse string from  [? <noreply@gunnar.cc>
    Re: how to parse string from  [? <samwun@hgcbroadband.com>
    Re: how to parse string from  [? <ittyspam@yahoo.com>
    Re: how to parse string from  [? <samwun@hgcbroadband.com>
    Re: I cann't scale gif with correctly with perlmagick. <tore@aursand.no>
    Re: perl -e and bash <kalinaubears@iinet.net.au>
    Re: problem calling perl script from SOAP server perl s (pj)
    Re: problem calling perl script from SOAP server perl s <tadmc@augustmail.com>
        ssue on Net::LDAP sasl issue on windows 2000. (Durairaj Avasi)
    Re: ssue on Net::LDAP sasl issue on windows 2000. <glex_nospam@qwest.invalid>
    Re: subroutine only returns non zero sums <remorse@partners.org>
    Re: Tough (for me) regex case (Brian McGonigle)
    Re: Tough (for me) regex case <brian.mcgonigle@verizon.net>
    Re: WebExplorer as Perl-CGI <Klein.Matthias@web.de>
    Re: WebExplorer as Perl-CGI <jwillmore@remove.adelphia.net>
    Re: what i am doing wrong here ..  getting  LDAP_STRONG (Durairaj Avasi)
    Re: Win32::OLE / WMEncoderAgent issue <pkent77tea@yahoo.com.tea>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 09 Apr 2004 10:04:42 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: "perl -w" vs "use warnings"
Message-Id: <_yudc.97920$gA5.1309464@attbi_s03>

Jim Cochrane wrote:

> In article <4075da0d$0$24341$58c7af7e@news.kabelfoon.nl>, John Bokma wrote:
>>>>#!/usr/bin/perl -w
>>
>>use warnings;
>>
>>not -w
> 
> 
> Sorry to get off the topic of the thread, but I've been wondering whether
> it's best to include "use warnings" in a module file or just use the -w
> option when the program is run.  So, with that background, I'll ask:
> 
> Why do you suggest the "use warnings" method?

Some modules produce warnings when processed with -w, which affects
all files the compiler processes.  "use warnings;" is file-scoped.
	-Joe


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

Date: Fri, 9 Apr 2004 14:25:29 +0000 (UTC)
From: J Krugman <jkrugman@yahbitoo.com>
Subject: Re: Alternative to AUTOLOAD
Message-Id: <c56bop$qdn$2@reader1.panix.com>



Joe, Anno: Thanks!

jill

-- 
To  s&e^n]d  me  m~a}i]l  r%e*m?o\v[e  bit from my a|d)d:r{e:s]s.



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

Date: 9 Apr 2004 08:57:39 -0700
From: junk@dlink.org (Aqua)
Subject: Archive::Zip Adding files with out directory info
Message-Id: <55d7995c.0404090757.69c7abd5@posting.google.com>

Hello Group,

I would like to add files without directory path

D:\Dir1\subdir\aaa\ccc\1s.txt
D:\Dir1\subdir\aaa\ccc\a34.abc
D:\Dir1\subdir\aaa\ccc\f4.aaa
D:\Dir1\subdir\aaa\ccc\h6.txt
D:\Dir1\subdir\ddd\ccc\14.hi
D:\Dir1\subdir\ddd\ccc\1g6.txt
D:\Dir1\subdir\eee\ccc\24.pp
D:\Dir1\subdir\fff\ccc\3v6.txt

Final zip should contain only files (1s.txt, a34.abc, f4.aaa, h6.txt,
14.hi, 1g6.txt, 24.pp, 3v6.txt).

Archive::Zip
find sub { push @FileArray, $File::Find::name if (!-d) }, "$dir";

foreach loop
use addFile( $FileName) 
addFile is not working if I pass a file with full path.

Actually I am looking for a function similar to
"extractMemberWithoutPaths" but it should add files.

Appreciate any help in this regard

Thanks
Dominic


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

Date: Fri, 09 Apr 2004 13:43:40 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: Archive::Zip Adding files with out directory info
Message-Id: <remorse-51D823.13434009042004@plato.harvard.edu>

In article <55d7995c.0404090757.69c7abd5@posting.google.com>,
 junk@dlink.org (Aqua) wrote:

> Hello Group,
> 
> I would like to add files without directory path
> 
> D:\Dir1\subdir\aaa\ccc\1s.txt
> D:\Dir1\subdir\aaa\ccc\a34.abc
> D:\Dir1\subdir\aaa\ccc\f4.aaa
> D:\Dir1\subdir\aaa\ccc\h6.txt
> D:\Dir1\subdir\ddd\ccc\14.hi
> D:\Dir1\subdir\ddd\ccc\1g6.txt
> D:\Dir1\subdir\eee\ccc\24.pp
> D:\Dir1\subdir\fff\ccc\3v6.txt
> 
> Final zip should contain only files (1s.txt, a34.abc, f4.aaa, h6.txt,
> 14.hi, 1g6.txt, 24.pp, 3v6.txt).

My version of Archive::Zip allows a second parameter to the addFile 
command.  This is the "internal name" of the file, which you can specify 
without the path.

Thus,

#!perl
use strict;
use warnings;

use File::Basename;
use Archive::Zip qw/:ERROR_CODES/;

my $zip = Archive::Zip->new();

my $zip_file = 'D:/Dir1/subdir/aaa/ccc.zip';
my @files = ( 
'D:/Dir1/subdir/aaa/ccc/1s.txt',
'D:/Dir1/subdir/aaa/ccc/a23.abc',
'D:/Dir1/subdir/aaa/ccc/f4.aaa',
'D:/Dir1/subdir/aaa/ccc/h6.txt',
);

foreach my $file (@files) {
   $zip->addFile($file, basename($file));
}

my $status = $zip->writeToFileNamed($zip_file);
if ($status != AZ_OK) {
   die("error when saving zip file '$zip_file'");
}

__END__

Please note, I did not test this, and typed it in.  It is based on code 
that I do have working, but I may have made typos.  This is intended for 
demonstration purposes only.

HTH,
Ricky

-- 
Pukku


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

Date: 9 Apr 2004 08:18:47 -0700
From: jchilla1@hotmail.com (Chilla)
Subject: CGI.pm for QNX 4.25
Message-Id: <348c9941.0404090718.af07963@posting.google.com>

Hi,

Has the above said module been ported to QNX? Has it been tested extensively?

Thank you in advance.


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

Date: Fri, 09 Apr 2004 10:26:28 -0400
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: CPAN.pm can't find libs
Message-Id: <pan.2004.04.09.14.26.24.342547@remove.adelphia.net>

On Thu, 08 Apr 2004 19:16:48 +0000, kj wrote:

> I'm trying to get CPAN.pm to install XML::LibXML for me.  It aborts
> the installation with a message saying that it can't find libxml2,
> even though libxml2.so.2 is in /usr/lib.  I tried running CPAN with
> 
>   $ LIB=/usr/lib perl -MCPAN -e shell
> 
> but I got the same error.  How can I get CPAN to find libxml2?

Do you have xml2-config available?  The reason, if I remember correctly,
that the install is failing is not because you don't have the library -
it's because the command *used* to find the library is in some funky path.

See if you can execute `xml2-config`.  If you can and it reports properly,
then the issue is something else.  But I have a feeling that's the
problem.

HTH

Jim


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

Date: Fri, 9 Apr 2004 14:24:18 +0000 (UTC)
From: J Krugman <jkrugman@yahbitoo.com>
Subject: Design choice: subclassing or "supplementing"
Message-Id: <c56bmi$qdn$1@reader1.panix.com>





I have this class from CPAN (let's call it, creatively enough, Foo)
that suits me fine in almost every respect, except for one workhorse
method (say, bar) that I think could be significantly enhanced.
One possibility would be to create a subclass MyFoo of Foo just
for the purpose of overriding bar.  Alternatively, I could have a
file FooSupplement.pm, in which I do something like

  use strict;
  use warnings;
  package Foo;
  {
    no warnings 'redefine';
    sub bar {
      # raise the bar to perfection 
    }
  }
  1;

Then, instead of using some subclass MyFoo, I use good ol' Foo
followed by "use FooSupplement".

I *suppose* (please correct me if I'm wrong) that this is yet
another one of those choices that boils down to personal preference,
but I'd love to take a very informal poll on what programmers here
would typically prefer to do in such a situation.

TIA,

jill

-- 
To  s&e^n]d  me  m~a}i]l  r%e*m?o\v[e  bit from my a|d)d:r{e:s]s.



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

Date: 09 Apr 2004 16:13:47 GMT
From: Dave O Connor <doc@RedBrick.DCU.IE.small.carrots>
Subject: Dublin.pm
Message-Id: <slrnc7ditr.ppu.doc@carbon.redbrick.dcu.ie>

To whom it may concern,

This is to announce the (re)formation of the Dublin perl Mongers user group,
under the management of myself. Any perl users in the Dublin, Ireland area
(And beyond!) are invited to join. Details, and mailing list information
are available on the (bare-bones!) Dublin.pm website at http://dublin.pm.org.

Although this incarnation is in its initial stages, we hope to arrange f2f
meetings in the near future, and also hope to attend YAPC::Europe as a user
group later this year. More on this onlist.

Any comment, suggestions, questions, etc. are welcome at the address above
(after the removal of several diminuitive vegetables).

Many thanks to Fergal Daly for graciously allowing Dublin.pm to fall to me
to tame, and Dave Cross for getting stuff set up.

        - DoC


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

Date: Sat, 10 Apr 2004 00:51:10 +0800
From: sam <samwun@hgcbroadband.com>
Subject: how to parse string from  [?
Message-Id: <c56lil$1j5h$1@news.hgc.com.hk>

Hi,

I have the following string need to be parsed in perl,
"sshd(pam_unix)[2009]"

I want to extract the first the word up to "[", what is the regular 
expression can do that?
The following regular express does not work:
"m/^([^\[]*)\[.*]$"

Thanks
sam


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

Date: Fri, 9 Apr 2004 10:14:12 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: how to parse string from  [?
Message-Id: <4076d9dd_2@127.0.0.1>

On 2004-04-09 09:51:10 -0700, sam <samwun@hgcbroadband.com> said:

> Hi,
> 
> I have the following string need to be parsed in perl,
> "sshd(pam_unix)[2009]"
> 
> I want to extract the first the word up to "[", what is the regular 
> expression can do that?
> The following regular express does not work:
> "m/^([^\[]*)\[.*]$"
> 
> Thanks
> sam

"does not work" is a little vague. You need to terminate the regular 
expression with another '/'. Except for that, your expression works for 
me. You can simplify it a little by 1) not escaping ']' in the 
character class (it doesn't need it), and 2) not including the 
extraneous '\[.*]$' at the end, unless you are trying to eliminate 
lines that do not match that part.

Please post a complete, working program and tell us what it is doing 
that "does not work".

-- 
Jim Gibson



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

Date: Fri, 09 Apr 2004 19:23:33 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to parse string from  [?
Message-Id: <c56m8r$2p3pbp$1@ID-184292.news.uni-berlin.de>

sam wrote:
> I have the following string need to be parsed in perl,
> "sshd(pam_unix)[2009]"
> 
> I want to extract the first the word up to "[", what is the regular
> expression can do that?
> The following regular express does not work:
> "m/^([^\[]*)\[.*]$"

No? Exactly what did you expect it to do, and what did it do? Please 
post complete code.

(I take for granted that the missing trailing slash is a typo when you 
retyped the code into the message. Don't retype - copy and paste!)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Sat, 10 Apr 2004 01:27:44 +0800
From: sam <samwun@hgcbroadband.com>
Subject: Re: how to parse string from  [?
Message-Id: <c56nn7$1k72$1@news.hgc.com.hk>

Jim Gibson wrote:

> On 2004-04-09 09:51:10 -0700, sam <samwun@hgcbroadband.com> said:
> 
>> Hi,
>>
>> I have the following string need to be parsed in perl,
>> "sshd(pam_unix)[2009]"
>>
>> I want to extract the first the word up to "[", what is the regular 
>> expression can do that?
>> The following regular express does not work:
>> "m/^([^\[]*)\[.*]$"
>>
>> Thanks
>> sam
> 
> 
> "does not work" is a little vague. You need to terminate the regular 
> expression with another '/'. Except for that, your expression works for 
> me. You can simplify it a little by 1) not escaping ']' in the character 
> class (it doesn't need it), and 2) not including the extraneous '\[.*]$' 
> at the end, unless you are trying to eliminate lines that do not match 
> that part.
> 
> Please post a complete, working program and tell us what it is doing 
> that "does not work".
> 

Thanks for your suggestion, here is my simplified perl script:
#!/usr/bin/perl -w
use strict; while (<DATA>) { print "$1\n" if "m/^([^\[]*)\[.*$/"; } __DATA__
sshd(pam_unix)[2009]

Note, there is no "\n" at the end of the "sshd(..)[2009]" string.

thanks
sam


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

Date: Fri, 9 Apr 2004 13:40:53 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: how to parse string from  [?
Message-Id: <20040409133912.E14622@dishwasher.cs.rpi.edu>

On Sat, 10 Apr 2004, sam wrote:

> Jim Gibson wrote:
>
> Thanks for your suggestion, here is my simplified perl script:
> #!/usr/bin/perl -w
> use strict; while (<DATA>) { print "$1\n" if "m/^([^\[]*)\[.*$/"; } __DATA__
> sshd(pam_unix)[2009]
>
> Note, there is no "\n" at the end of the "sshd(..)[2009]" string.
>

Why are you putting quotes around your whole regexp?  You're suddenly
asking if this big long string returns a true value, rather than whether
or not a pattern match succeeds.  Get rid of those quotes.

print "$1\n" if /^([^[]*)/;


Paul Lalli


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

Date: Sat, 10 Apr 2004 01:58:53 +0800
From: sam <samwun@hgcbroadband.com>
Subject: Re: how to parse string from  [?
Message-Id: <c56phl$1l3f$1@news.hgc.com.hk>

Paul Lalli wrote:

> On Sat, 10 Apr 2004, sam wrote:
> 
> 
>>Jim Gibson wrote:
>>
>>Thanks for your suggestion, here is my simplified perl script:
>>#!/usr/bin/perl -w
>>use strict; while (<DATA>) { print "$1\n" if "m/^([^\[]*)\[.*$/"; } __DATA__
>>sshd(pam_unix)[2009]
>>
>>Note, there is no "\n" at the end of the "sshd(..)[2009]" string.
>>
> 
> 
> Why are you putting quotes around your whole regexp?  You're suddenly
> asking if this big long string returns a true value, rather than whether
> or not a pattern match succeeds.  Get rid of those quotes.
> 
> print "$1\n" if /^([^[]*)/;
> 
Thanks, it works now.
sam
> 
> Paul Lalli


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

Date: Fri, 09 Apr 2004 09:36:00 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: I cann't scale gif with correctly with perlmagick.
Message-Id: <pan.2004.04.09.07.29.57.548627@aursand.no>

On Thu, 08 Apr 2004 21:48:25 -0700, kenny wrote:
> Thanks correct my syntax.

You should _always_ copy and paste the actual code.  Don't try to rewrite
the particular code.

> but anyway, after i correct to this also face the same problem. after
> scaling animate gif(multiple image).

As previously said;  I don't know much about ImageMagick (note to myself:
make sure that I know much about ImageMagic a month from now), but are you
sure it supports animated gifs?


-- 
Tore Aursand <tore@aursand.no>
"The pure and simple truth is rarely pure and never simple." -- Oscar
 Wilde


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

Date: Fri, 09 Apr 2004 18:39:30 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: perl -e and bash
Message-Id: <40766264$0$16606$5a62ac22@freenews.iinet.net.au>

Rob Beattie wrote:

> If I applied the following rules:- 
> 
> replace  ' with  " 
> use whatever the original two " enclosed as an argument for qq()
> 
> would that be the case here?
> 

That's right.

Cheers,
Rob

-- 
To reply by email u have to take out the u in kalinaubears.



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

Date: 9 Apr 2004 06:50:28 -0700
From: nsf470@yahoo.com (pj)
Subject: Re: problem calling perl script from SOAP server perl script
Message-Id: <11711ebf.0404090550.6f6bade4@posting.google.com>

nsf470@yahoo.com (pj) wrote in message news:<11711ebf.0404082149.1fe44413@posting.google.com>...
> Hi 
> 
> I am trying to call a perl script from SOAP server side perl script,
> but no luck.
> 
> following is the SOAP server perl script where I call other perl
> script. read_query function writes to a file okay, but does nothing
> for the two system calls after that. Any ideas? thanks in advance
> 
> #!/usr/bin/perl
> 
> use lib '../lib';
> 
> use SOAP::Transport::HTTP;
> 
> SOAP::Transport::HTTP::CGI
>   -> dispatch_to('predictor')
>   -> handle;
> 
> package predictor;
> 
> sub read_query{
>   my $file=$_[0];
>   open (fileOUT, "> dBDataFiles/$file");
> 
>   foreach $line (@_)
>   {
>      print fileOUT "$line";
>   }
>   close (fileOUT);
> 
>   # Problem:: nothing happens for the nest two system commands.
>  
>   system ("/bin/echo hello > dBDataFiles/test");
>   system ("/usr/bin/perl /home/nsf470/out.pl");

The return value of the system calls are 256. Why are they not working ?


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

Date: Fri, 9 Apr 2004 10:12:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: problem calling perl script from SOAP server perl script
Message-Id: <slrnc7dfaf.cg8.tadmc@magna.augustmail.com>

pj <nsf470@yahoo.com> wrote:

> #!/usr/bin/perl


You should ask for all the help you can get:

   use warnings;
   use strict;


> sub read_query{
>   my $file=$_[0];
>   open (fileOUT, "> dBDataFiles/$file");


You should always, yes *always*, check the return value from open():

   open(fileOUT, "> dBDataFiles/$file") or 
      die "could not open 'dBDataFiles/$file'  $!";


>   foreach $line (@_)


Do you _want_ the first iteration to have the same value as what
you put into $file?

Writing the name of the file into the file seems strange to me...


>   {
>      print fileOUT "$line";
                     ^     ^
                     ^     ^

You should avoid useless uses of double quotes:

    print fileOUT $line;


>   return "done"."\n\n";


   return "done\n\n";


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 9 Apr 2004 08:28:33 -0700
From: dash@webdurai.com (Durairaj Avasi)
Subject: ssue on Net::LDAP sasl issue on windows 2000.
Message-Id: <2f872516.0404090728.34b7134f@posting.google.com>

the following is a simple script with tries to bind on a Active
Directory.

This is my program

use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR);
use Authen::SASL;
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);

sub lConnect {
	my $server = shift;
	print " the server name is $server\n";
	my $ldap = Net::LDAP->new($server, port=> 389, version => 3);
	print "=== The error is $@ <====\n";
	return($ldap);
}

my $ldap = &lConnect('111.11.11.1');
my $sasl = Authen::SASL->new(mechanism => 'DIGEST-MD5', password
=>'xyzabc');
my $isBinded = $ldap->bind ('cn=durairaj
avasi,ou=itdev,dc=cow,dc=net', sasl => $sasl, version => 3);#
print "ERROR detected: -> ", ldap_error_name($isBinded->code), " ",
ldap_error_text($isBinded->code);

the above program returns the following::

ERROR detected: -> LDAP_INVALID_CREDENTIALS The wrong password was
supplied or the SASL credentials could not be processed

if do a normal bind like 

$ldab->bind($mydn, password=>$password, version => 3); 

( NOTE without SASL )

i am getting the following error 

ERROR detected: -> LDAP_STRONG_AUTH_REQUIRED The server requires
authentication
be performed with a SASL mechanism


Tested with windows 2000 and windows xp getting the same error msg.
I have installed 8xx-builds on Windows 2000 and windows xp and tested
on both ... i am facing same issue with both the application.

what i am doing wrong here.... some say that i should install
perl-cyrus-sasl-0.02... but i am unable to find that module for 8xx
environment


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

Date: Fri, 09 Apr 2004 12:12:25 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: ssue on Net::LDAP sasl issue on windows 2000.
Message-Id: <ZPAdc.35$sx6.32703@news.uswest.net>

Durairaj Avasi wrote:

> what i am doing wrong here.... some say that i should install
> perl-cyrus-sasl-0.02... but i am unable to find that module for 8xx
> environment

Since this seems to be a very specific issue, possibly you may get more 
help from: perl-ldap@perl.org

Never used what you're trying to do, however a few queries with Google 
turned up the source for cyrus-sasl:

ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/

And simply searching CPAN for "cyrus" found the perl module:

http://search.cpan.org/~adamson/Authen-SASL-Cyrus-0.07/

Hope that helps.


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

Date: Fri, 09 Apr 2004 11:02:23 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: subroutine only returns non zero sums
Message-Id: <remorse-7DC2AC.11022309042004@plato.harvard.edu>

In article <siscr7uzwprg.fsf@tripoli.fmr.com>,
 Uri Guttman <uri.guttman@fmr.com> wrote:

> >>>>> "RM" == Richard Morse <remorse@partners.org> writes:
>   RM> sub addnums {
>   RM>    my $total += $_ foreach @_;
>   RM>    return $total || 0;
>   RM> }
> 
>   RM> I don't think that the return statement would be a problem, but I'm 
>   RM> wondering if the "don't lexicalize variables with statement modifiers" 
>   RM> rule applies here, or only with 'if'/'unless' statement modifiers?
> 
> have you tried it? that is the first rule about asking questions like
> this. you have code and does it work?
> 
> try it with and without my and report any differences. you will find the
> answer you seek.

Now feeling properly chastised (both by Mr. Guttman and Mr. McClellan), 
I have done this test and discovered it will not work.

Ricky

-- 
Pukku


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

Date: 9 Apr 2004 00:17:11 -0700
From: brian.mcgonigle@verizon.net (Brian McGonigle)
Subject: Re: Tough (for me) regex case
Message-Id: <b35725c1.0404082317.2719e5c5@posting.google.com>

Got it!!!

$text = 'The "quick" brown "fox jumped ""over"" the" lazy dog.';

while ($text =~ /"(.*?)"/g) {
  if ($text =~ /"$_("".*?"")/) {
    push @matches, ($1);
    print "FOUND: $1\n";
  }
  elsif ($text =~ /(""$1"")(.*?)"/) {
    push @matches, $1;
    print "FOUND: $1 \n";
  }
  else {
    push @matches, $1;
    print "FOUND: $1\n";
  }
}

print "MATCHES: @matches\n";


Prints...

FOUND: quick
FOUND: fox jumped 
FOUND: ""over"" 
FOUND:  the
MATCHES: quick fox jumped  ""over""  the


"mortb" <moggadah@hotmail.com> wrote in message news:<OBFdpTMGEHA.3064@tk2msftngp13.phx.gbl>...
> ...and
> (?<=")(""|[^"])+(?=")
> 
> gets me...
> 
> (1)    quick
> (2)     brown  (notice the space before)
> (3)    fox jumped ""over"" the
> 
> this got rid of the quotes but introduced the " brown" error
> Perhaps you can live with the quotes....
> 
> /mortb
> 
> "mortb" <moggadah@hotmail.com> wrote in message
> news:OE%232YLMGEHA.2600@TK2MSFTNGP12.phx.gbl...
> > "(""|[^"])+"
> >
> > gets me:
> > (1)     "quick"
> > (2)    "fox jumped ""over"" the"
> >
> > - the | is an OR-operator which means that after " you match either "" or
> > any character except "
> >
> > I've tried to get rid of the initial and ending quotes -- I think it's
> > possible in the same expression -- but I haven't succeeded -- yet.
> > tricky? -- yes!
> >
> > /mortb
> >
> >
> >


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

Date: Fri, 09 Apr 2004 09:26:48 GMT
From: Brian McGonigle <brian.mcgonigle@verizon.net>
Subject: Re: Tough (for me) regex case
Message-Id: <s%tdc.18826$TS3.954@nwrddc02.gnilink.net>

Actually, all you need is the last two expressions. Here it is revised:

#!/usr/bin/perl
 

$text = 'The "quick" brown "fox jumped ""over"" the" lazy dog.';
 

while ($text =~ /"(.*?)"/g) {
   if ($text =~ /".*?(""$1"").*?"/) {
     push @matches, $1;
     print "REGEX 1: $1 \n";
   }
   else {
     push @matches, $1;
     print "REGEX 2: $1\n";
   }
}
 

print "MATCHES: @matches\n";
 

It prints...

REGEX 2: quick
REGEX 2: fox jumped
REGEX 1: ""over""
REGEX 2:  the
MATCHES: quick fox jumped  ""over""  the



Brian McGonigle wrote:
> Got it!!!
> 
> $text = 'The "quick" brown "fox jumped ""over"" the" lazy dog.';
> 
> while ($text =~ /"(.*?)"/g) {
>   if ($text =~ /"$_("".*?"")/) {
>     push @matches, ($1);
>     print "FOUND: $1\n";
>   }
>   elsif ($text =~ /(""$1"")(.*?)"/) {
>     push @matches, $1;
>     print "FOUND: $1 \n";
>   }
>   else {
>     push @matches, $1;
>     print "FOUND: $1\n";
>   }
> }
> 
> print "MATCHES: @matches\n";
> 
> 
> Prints...
> 
> FOUND: quick
> FOUND: fox jumped 
> FOUND: ""over"" 
> FOUND:  the
> MATCHES: quick fox jumped  ""over""  the
> 
> 
> "mortb" <moggadah@hotmail.com> wrote in message news:<OBFdpTMGEHA.3064@tk2msftngp13.phx.gbl>...
> 
>>...and
>>(?<=")(""|[^"])+(?=")
>>
>>gets me...
>>
>>(1)    quick
>>(2)     brown  (notice the space before)
>>(3)    fox jumped ""over"" the
>>
>>this got rid of the quotes but introduced the " brown" error
>>Perhaps you can live with the quotes....
>>
>>/mortb
>>
>>"mortb" <moggadah@hotmail.com> wrote in message
>>news:OE%232YLMGEHA.2600@TK2MSFTNGP12.phx.gbl...
>>
>>>"(""|[^"])+"
>>>
>>>gets me:
>>>(1)     "quick"
>>>(2)    "fox jumped ""over"" the"
>>>
>>>- the | is an OR-operator which means that after " you match either "" or
>>>any character except "
>>>
>>>I've tried to get rid of the initial and ending quotes -- I think it's
>>>possible in the same expression -- but I haven't succeeded -- yet.
>>>tricky? -- yes!
>>>
>>>/mortb
>>>
>>>
>>>



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

Date: Fri, 9 Apr 2004 13:22:24 +0200
From: "Matthias Klein" <Klein.Matthias@web.de>
Subject: Re: WebExplorer as Perl-CGI
Message-Id: <c5610r$2pdv7h$1@ID-228482.news.uni-berlin.de>

Yes, that works for the download-part of my problem.
But I also want users to be able to upload (large) files and I assume that
Apache is not able to perform that task as well, right?
And since my provider permits Perl-CGIs, I was hoping to find someone who
knows such a program.
Thanks

Matthias


"Gregory Toomey" <nospam@bigpond.com> wrote in message
news:2224115.Gnqc2Pqtg9@GMT-hosting-and-pickle-farming...
> Matthias Klein wrote:
>
> > Does anybody know a freeware/opensource Perl-CGI that acts like a
regular
> > file-explorer?
> >
> > The internet project I am working on will be hosted on a regular
> > shared-hosting environment based on Red Hat Linux 7.3 (no root access,
but
> > own perl-cgi permitted).
> >
> > It requires some sort of web-based file-explorer so that users can
upload
> > and download even large files: the user browses to a certain URL, types
in
> > his passwd and can then browse in the existing files on the remote host,
> > download them and upload new ones. That is what I am hoping for...
> >
> > Does anybody know a program like this?
> >
> > Tnx
> >
> > Matthias
>
> No need for Perl - the basic functionality is built into Apache. If you
put
>
> Option +Indexes
>
> into .htaccess in a directory, Apache will allow you to "browse" the
> directory & subdirectoires without the need for cgi.
>
> See: http://httpd.apache.org/docs/mod/core.html#options
> " If a URL which maps to a directory is requested, and the there is no
> DirectoryIndex (e.g., index.html) in that directory, then the server will
> return a formatted listing of the directory."
>
>
> gtoomey




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

Date: Fri, 09 Apr 2004 10:30:09 -0400
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: WebExplorer as Perl-CGI
Message-Id: <pan.2004.04.09.14.30.05.33575@remove.adelphia.net>

On Fri, 09 Apr 2004 13:22:24 +0200, Matthias Klein wrote:

[DON'T TOP POST - it's rude]

> "Gregory Toomey" <nospam@bigpond.com> wrote in message
> news:2224115.Gnqc2Pqtg9@GMT-hosting-and-pickle-farming...
>> Matthias Klein wrote:
>>
>> > Does anybody know a freeware/opensource Perl-CGI that acts like a
> regular
>> > file-explorer?

>> No need for Perl - the basic functionality is built into Apache. If you
> put
>>
>> Option +Indexes
>>
>> into .htaccess in a directory, Apache will allow you to "browse" the
>> directory & subdirectoires without the need for cgi.

> Yes, that works for the download-part of my problem.
> But I also want users to be able to upload (large) files and I assume that
> Apache is not able to perform that task as well, right?
> And since my provider permits Perl-CGIs, I was hoping to find someone who
> knows such a program.

Visit http://freshmeat.net/ for open source software.

HTH

Jim


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

Date: 9 Apr 2004 07:03:40 -0700
From: dash@webdurai.com (Durairaj Avasi)
Subject: Re: what i am doing wrong here ..  getting  LDAP_STRONG_AUTH_NOT_SUPPORTED
Message-Id: <2f872516.0404090603.5e00a3e2@posting.google.com>

Bob Walton <invalid-email@rochester.rr.com> wrote in message news:<4075E81D.4050006@rochester.rr.com>...
> Durairaj Avasi wrote:
> 
> ...
> > what i am doing wrong here... why this drives so grazy... 
> ...
> 
> 
> > my $ldap = &lConnect('$myserver');
> 
> -----------------------^---------^
> 
> Well, one thing you are probably doing wrong is using ' to quote a 
> string you evidently want interpolated.  Interpolation does not occur in 
> '-delimited strings, so you are attempting to connect to the server with 
> the literal name: $myserver .  That probably isn't the real name of your 
> server.  Remove the ' characters -- converting them to " would be a 
> useless use of "'s, which can actually be worse than it sounds (see:
> 
>     perldoc -q quoting
> 
> ).
> 
> You should probably also check the result 
> 
> of your lConnect routine to see if it failed or not.
> 
> If it did fail, you'd never know.  And with that
> server name, it undoubtedly did fail.  But I'm
> surprised you didn't notice the bad server name in
> the results of the print statement in lConnect.
> You *did* provide us with copy/pasted code, right,
> not a retyped version?
> 
> 
> ...

BOB

use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR);
use Authen::SASL;
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);

sub lConnect {
	my $server = shift;
	print " the server name is $server\n";
	my $ldap = Net::LDAP->new($server, port=> 389, version => 3);
	print "=== The error is $@ <====\n";
	return($ldap);
}

my $ldap = &lConnect('111.11.11.1');
my $sasl = Authen::SASL->new(mechanism => 'DIGEST-MD5', password
=>'xyzabc');
my $isBinded = $ldap->bind ('cn=durairaj
avasi,ou=itdev,dc=cow,dc=net', sasl => $sasl, version => 3);#
print "ERROR detected: -> ", ldap_error_name($isBinded->code), " ",
ldap_error_text($isBinded->code);

the above program returns the following::

ERROR detected: -> LDAP_INVALID_CREDENTIALS The wrong password was
supplied or t
he SASL credentials could not be processed

if do a normal bind like 

$ldab->bind($mydn, password=>$password, version => 3); 

( NOTE without SASL )

i am getting the following error 

ERROR detected: -> LDAP_STRONG_AUTH_REQUIRED The server requires
authentication
be performed with a SASL mechanism


Tested with windows 2000 and windows xp getting the same error msg.


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

Date: Fri, 09 Apr 2004 19:03:58 +0100
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Win32::OLE / WMEncoderAgent issue
Message-Id: <pkent77tea-9391DE.19035009042004@pth-usenet-02.plus.net>

In article <c51pds$4of$1@nntp0.reith.bbc.co.uk>,
 simonl@is.bbc.co.uk (Simon Lockhart) wrote:
 ...
> my $encagent = Win32::OLE->new(["boc1enc01", "WMEncAgt.WMEncoderAgent"]);
> my $encoder = 
> $encagent->GetEncoder($encagent->EncoderNamesCollection->item(0));
> 
> my $type = Win32::OLE->QueryObjectType($encoder);
 ...
> Now, from my understanding of the MSDN docs, $encoder should be of type
> IWMEncoder, but QueryObjectType returns undef for it. Is this a bug or
> feature? Is there any way to "cast" the object to an IWMEncoder?


FWIW looking at Real's website it seems that Helix can encode Windows 
Media, and Helix appears to run on Unix :-)

But, one thing you might find useful, if you haven't found it already, 
is the OLE Browser tool that comes with ActivePerl. Start at the perl 
docs index pages which is probably at C:/perl/html/index.html - in the 
lefthand nav under "Windows Specific" there's a link to the OLE Browser. 
Follow that link and you get a list of all the libraries etc. available, 
which you can click on to get details of their classes, methods, 
properties, etc. You might find something there, maybe.

That said, is $encoder actually defined? Is it is, does it do what it's 
supposed to do? I mean might it just be that you have a perfectly valid 
object in $encoder but, for some reason, QueryObjectType() returns undef 
even though the object exists?

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

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


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