[24177] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6369 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 6 18:05:53 2004

Date: Tue, 6 Apr 2004 15: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           Tue, 6 Apr 2004     Volume: 10 Number: 6369

Today's topics:
        add blank lines after word MAC (sed/awk or perl??) (NNTP)
    Re: add blank lines after word MAC (sed/awk or perl??) (Kenny McCormack)
    Re: add blank lines after word MAC (sed/awk or perl??) <ittyspam@yahoo.com>
    Re: add blank lines after word MAC (sed/awk or perl??) <lallip@dishwasher.cs.rpi.edu>
        Cannot get file to be read. (Lalo Salvalus)
    Re: Cannot get file to be read. <ittyspam@yahoo.com>
    Re: Cannot get file to be read. <tore@aursand.no>
        change meta tag description in all htm documents includ <tamara@agencija.com>
    Re: command line <h.c.rosielle@chello.nl>
    Re: command line <h.c.rosielle@chello.nl>
    Re: command line <uri.guttman@fmr.com>
        Help me with my form please. (David Baker)
    Re: Help me with my form please. <ittyspam@yahoo.com>
        Help needed:: Openldap issue - -  LDAP_OPERATIONS_ERROR (Durairaj Avasi)
        Help needed:: Openldap issue - -  LDAP_OPERATIONS_ERROR (Durairaj Avasi)
    Re: Help needed:: Openldap issue - -  LDAP_OPERATIONS_E <vetro@online.no>
        Mime::Lite and smtp authentification <dreamer@cox.net>
        More NET::LDAP questions (Steve The Geek)
        Open GUI transcript window <bxb7668@somewhere.nocom>
    Re: Open GUI transcript window <ittyspam@yahoo.com>
    Re: Perl and Internet Explorer (akaliel)
    Re: Perl and Internet Explorer <matthew.garrish@sympatico.ca>
        Perl Version Issue? (Jason Crowther)
    Re: Perl Version Issue? <tore@aursand.no>
    Re: Perl Version Issue? <kirk@strauser.com>
    Re: Perl Version Issue? <vetro@online.no>
    Re: real, simple sample OOP intro text??!! <geoffacox@dontspamblueyonder.co.uk>
    Re: real, simple sample OOP intro text??!! <dha@panix.com>
    Re: script <gnari@simnet.is>
    Re: simple scratch variable parsing (Grant)
    Re: striptag <gnari@simnet.is>
    Re: Tough (for me) regex case <remorse@partners.org>
    Re: Unknown function <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 6 Apr 2004 08:48:53 -0700
From: news8080@yahoo.com (NNTP)
Subject: add blank lines after word MAC (sed/awk or perl??)
Message-Id: <110fc16.0404060748.4752f092@posting.google.com>

I have a file with the following data

192.168.60.161 DOMAINNAME-POWER       03U
192.168.60.161 DOMAINNAME-TEMP        1eU
192.168.60.161 MAC 00-xy-zz-07-bd-8a
192.168.60.179 DOMAINNAME-abacdf      00U
192.168.60.179 DOMAINNAME             00U
192.168.60.179 DOMAINNAME-abacdf      20U
192.168.60.179 DOMAINNAME             1eU
192.168.60.179 MAC 00-xy-8b-1c-08-c7
192.168.60.198 DOMAINNAME-abcd        00U
192.168.60.198 DOMAINNAME             1cU
192.168.60.198 DOMAINNAME             00U
192.168.60.198 DOMAINNAME-abcd        20U
192.168.60.198 DOMAINNAME             1bU
192.168.60.198 DOMAINNAME             1eU
192.168.60.198 DOMAINNAME             1dU
192.168.60.198 MAC 00-zz-aa-bb-8f-35


what I want to do is add blank line after MAC entry for each IP. I am
confortable with awk/sed but can't seem to fig. this out.

do I need perl? or can sed/awk do this?


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

Date: Tue, 06 Apr 2004 15:53:11 GMT
From: gazelle@yin.interaccess.com (Kenny McCormack)
Subject: Re: add blank lines after word MAC (sed/awk or perl??)
Message-Id: <c4uk5g$gca$1@yin.interaccess.com>

In article <110fc16.0404060748.4752f092@posting.google.com>,
NNTP <news8080@yahoo.com> wrote:
>I have a file with the following data
>
>192.168.60.161 DOMAINNAME-POWER       03U
>192.168.60.161 DOMAINNAME-TEMP        1eU
>192.168.60.161 MAC 00-xy-zz-07-bd-8a
>192.168.60.179 DOMAINNAME-abacdf      00U
>192.168.60.179 DOMAINNAME             00U
 ...
>what I want to do is add blank line after MAC entry for each IP. I am
>confortable with awk/sed but can't seem to fig. this out.
>
>do I need perl? or can sed/awk do this?

I don't understand the reference to this mythical language called sed/awk.
Wouldn't it make just as much sense to ask if it could be done in
Fortran/Python?

Anyway, in AWK (2 liner):

1
/MAC/ {print ""}



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

Date: Tue, 6 Apr 2004 12:14:52 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: add blank lines after word MAC (sed/awk or perl??)
Message-Id: <20040406121135.W29551@dishwasher.cs.rpi.edu>

On Tue, 6 Apr 2004, Kenny McCormack wrote:

> In article <110fc16.0404060748.4752f092@posting.google.com>,
> NNTP <news8080@yahoo.com> wrote:
> >I have a file with the following data
> >
> >192.168.60.161 DOMAINNAME-POWER       03U
> >192.168.60.161 DOMAINNAME-TEMP        1eU
> >192.168.60.161 MAC 00-xy-zz-07-bd-8a
> >192.168.60.179 DOMAINNAME-abacdf      00U
> >192.168.60.179 DOMAINNAME             00U
> ...
> >what I want to do is add blank line after MAC entry for each IP. I am
> >confortable with awk/sed but can't seem to fig. this out.
> >
> >do I need perl? or can sed/awk do this?
>
> I don't understand the reference to this mythical language called sed/awk.
> Wouldn't it make just as much sense to ask if it could be done in
> Fortran/Python?
>
> Anyway, in AWK (2 liner):
>
> 1
> /MAC/ {print ""}

In Perl (1 liner):

perl -pi -e's/.*MAC.*/$1\n/'  file.txt

or:

perl -pi -e'$_ .="\n" if /MAC/' file.txt

Paul Lalli


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

Date: Tue, 6 Apr 2004 12:19:15 -0400
From: Paul Lalli <lallip@dishwasher.cs.rpi.edu>
Subject: Re: add blank lines after word MAC (sed/awk or perl??)
Message-Id: <20040406121825.S29551@dishwasher.cs.rpi.edu>

On Tue, 6 Apr 2004, Paul Lalli wrote:

> On Tue, 6 Apr 2004, Kenny McCormack wrote:
>
> > In article <110fc16.0404060748.4752f092@posting.google.com>,
> > NNTP <news8080@yahoo.com> wrote:
> > >I have a file with the following data
> > >
> > >192.168.60.161 DOMAINNAME-POWER       03U
> > >192.168.60.161 DOMAINNAME-TEMP        1eU
> > >192.168.60.161 MAC 00-xy-zz-07-bd-8a
> > >192.168.60.179 DOMAINNAME-abacdf      00U
> > >192.168.60.179 DOMAINNAME             00U
> > ...
> > >what I want to do is add blank line after MAC entry for each IP. I am
> > >confortable with awk/sed but can't seem to fig. this out.
> > >
> > >do I need perl? or can sed/awk do this?
> >
> > I don't understand the reference to this mythical language called sed/awk.
> > Wouldn't it make just as much sense to ask if it could be done in
> > Fortran/Python?
> >
> > Anyway, in AWK (2 liner):
> >
> > 1
> > /MAC/ {print ""}
>
> In Perl (1 liner):
>
> perl -pi -e's/.*MAC.*/$1\n/'  file.txt
oops
  perl -pi -e's/(.*MAC.*)/$1\n/' file.txt

>
> or:
>
> perl -pi -e'$_ .="\n" if /MAC/' file.txt
>
> Paul Lalli
>


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

Date: 6 Apr 2004 09:02:08 -0700
From: lalosal@hotmail.com (Lalo Salvalus)
Subject: Cannot get file to be read.
Message-Id: <2a6fb1fd.0404060802.12b177fe@posting.google.com>

I have a simple script that I can't get to read a file and am not sure
why.

Here's the script:
=============================================
use Getopt::Std;
getopts('d:hi:f:');

my @lines;

if ($opt_f) { readFile($opt_f)};

sub readFile {
	my $filein = pop;
	open (FIN, '<  $filein'  ) || die "cannot open file $filein,  $!\n";
	while ( <FIN> ) {
		push @lines;
	}
} # readFile

print "\@lines is @lines\n";
=============================================

When I run this from the command line I get "The system cannot find
the file specified." no matter if I have a copy of the file in the
same dir as the script, or if I specify a full path (with either
backslashes, forward slashes, or double back slashes), or if I specify
a relative path (with either backslashes, forward slashes, or double
back slashes):

C:\Perl>perl -w Test.pl -f myfile.txt
cannot open file myfile.txt,  The system cannot find the file
specified.

I'm running ActivePerl 5.8.3 build 809 on Windows 2000.

All help is appreciated.

thanks,

Lalo


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

Date: Tue, 6 Apr 2004 12:10:44 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Cannot get file to be read.
Message-Id: <20040406120941.X29551@dishwasher.cs.rpi.edu>

On Tue, 6 Apr 2004, Lalo Salvalus wrote:

> I have a simple script that I can't get to read a file and am not sure
> why.
>
> Here's the script:
> =============================================
> use Getopt::Std;
> getopts('d:hi:f:');
>
> my @lines;
>
> if ($opt_f) { readFile($opt_f)};
>
> sub readFile {
> 	my $filein = pop;
> 	open (FIN, '<  $filein'  ) || die "cannot open file $filein,  $!\n";
                  ^^^        ^^^


> 	while ( <FIN> ) {
> 		push @lines;
> 	}
> } # readFile
>
> print "\@lines is @lines\n";
> =============================================


Single quotes do not interpolate variable names.  You're trying to open a
file literally named '$filein'.  Change the ' to ".

Paul Lalli



>
> When I run this from the command line I get "The system cannot find
> the file specified." no matter if I have a copy of the file in the
> same dir as the script, or if I specify a full path (with either
> backslashes, forward slashes, or double back slashes), or if I specify
> a relative path (with either backslashes, forward slashes, or double
> back slashes):
>
> C:\Perl>perl -w Test.pl -f myfile.txt
> cannot open file myfile.txt,  The system cannot find the file
> specified.
>
> I'm running ActivePerl 5.8.3 build 809 on Windows 2000.
>
> All help is appreciated.
>
> thanks,
>
> Lalo
>


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

Date: Tue, 06 Apr 2004 18:53:53 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Cannot get file to be read.
Message-Id: <pan.2004.04.06.16.52.40.934023@aursand.no>

On Tue, 06 Apr 2004 09:02:08 -0700, Lalo Salvalus wrote:
> sub readFile {
> 	my $filein = pop;
> 	open (FIN, '<  $filein'  ) || die "cannot open file $filein,  $!\n";
> 	while ( <FIN> ) {
> 		push @lines;
> 	}
> } # readFile

1. Single quotes aren't interpolated;  In the code above, you're trying to
open a file named '$filein'.

2. Why do you use 'pop' instead of 'shift' to get the input argument?

3. Why don't you close the file after reading it?  And why do you iterate
over the lines in the file when the only thing you do is push'ing the
lines into an array?

  my $lines = readFile( $opt_f );

  sub readFile {
      my $filein = shift;

      open( FIN, '<', $filein ) or die "$!\n";
      my @lines = <FIN>; # Beware of large files, though
      close( FIN );

      return \@lines;
  }


-- 
Tore Aursand <tore@aursand.no>
"I didn't have time to write a short letter, so I wrote a long one
 instead." -- Mark Twain


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

Date: Tue, 6 Apr 2004 22:30:13 +0200
From: "Tamara" <tamara@agencija.com>
Subject: change meta tag description in all htm documents including all files in subdirectories
Message-Id: <c4v3ve$2es$1@ls219.htnet.hr>

How can I change meta tag description in all htm documents including all
files in subdirectories, with using perl on Windows XP?
E.g. new meta tag is "New meta tag", and I want change it in all htm file
including htm files in subdirectories.





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

Date: Tue, 06 Apr 2004 19:01:52 GMT
From: "Cor Rosielle" <h.c.rosielle@chello.nl>
Subject: Re: command line
Message-Id: <A8Dcc.133651$pN4.29568@amsnews03.chello.com>

Watch the sequence of your options. This doesn't work:
perl -ew "print 'hello'"
but this does:
perl -we "print 'hello'"

Cor
"luc" <anonymous@disneyland.com> wrote in message
news:6yxcc.61968$2S4.4164712@phobos.telenet-ops.be...
> I am trying to understand perls command line in dos(xp). I would simple
want
> to send hello to the screen. I've tried things like: perl -ew "print
> \"hello\";"
> perl -ew "print 'hello';"
> What are perls rules here in the dos command line? Is there any
> site/tutorial on this subject?
>
>




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

Date: Tue, 06 Apr 2004 19:04:37 GMT
From: "Cor Rosielle" <h.c.rosielle@chello.nl>
Subject: Re: command line
Message-Id: <9bDcc.133655$pN4.76124@amsnews03.chello.com>

Watch the sequence of your options. This doesn't work:
perl -ew "print 'hello'"
but this does:
perl -we "print 'hello'"

Cor
"luc" <anonymous@disneyland.com> wrote in message
news:6yxcc.61968$2S4.4164712@phobos.telenet-ops.be...
> I am trying to understand perls command line in dos(xp). I would simple
want
> to send hello to the screen. I've tried things like: perl -ew "print
> \"hello\";"
> perl -ew "print 'hello';"
> What are perls rules here in the dos command line? Is there any
> site/tutorial on this subject?
>
>




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

Date: 06 Apr 2004 15:42:00 -0400
From: Uri Guttman <uri.guttman@fmr.com>
Subject: Re: command line
Message-Id: <sisc8yh8yjuf.fsf@tripoli.fmr.com>

>>>>> "CR" == Cor Rosielle <h.c.rosielle@chello.nl> writes:

  CR> Watch the sequence of your options. This doesn't work:
  CR> perl -ew "print 'hello'"

well, -e take the next arg as the code so that would be 'w'. what else
is new?

uri


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

Date: 6 Apr 2004 11:56:57 -0700
From: davidbaker@canoemail.com (David Baker)
Subject: Help me with my form please.
Message-Id: <279d0b35.0404061056.13a64c2a@posting.google.com>

I am a total newbie, and have no idea what I am doing.  I have created
a html form, and am tring to pass some variable to a perl script to
make it update a guest book.  When ever I press submit on my form, I
get a "HTTP 500 - Internal server error".  I checked and the server is
working fine.  Here is my code.  If anyone has any idea's I really
appreciated it.


#!/user/bin/perl

if($ENV{'REQUEST_METHOD'} eq 'GET')
   {
   $in_string= $ENV{'QUERY_STRING'};
   }
elsif ($ENV{'REQUEST_METHOD'} eq 'POST')
   {
   read(STDIN, $in_string, $ENV{'CONTENT_LENGTH'});
   }

@an_array = split('&', $in_string);

$array_length = @an_array;

for($i=0; $i<$array_length; $i++)
   {
   ($var_name, $value) = split('=', $an_array[$i]);
      $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-f0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.|\n)*-->//g;
      $var_name =~ tr/+/ /;
   $var_name =~ s/%([a-fA-F0-9][a-fA-F0-9]/pack("C", hex($1))/eg;
   $var_name =~ s/<!--(.|\n)*-->//g;

     $in_vars{$var_name} = $value;
   }



open (LOG, ">>../LOG.txt");
print LOG ("Name: $in_vars{'username'}\nEmail Address:
$in_vars{'email'}\nWeb site: $in_vars{'website'}\nHow you found this

site: $in_vars{'R1'}\nYou said: {'Comment'}\n\n----\n\n");
close (LOG);


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

Date: Tue, 6 Apr 2004 15:21:16 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Help me with my form please.
Message-Id: <20040406151612.W29551@dishwasher.cs.rpi.edu>

On Tue, 6 Apr 2004, David Baker wrote:

> I am a total newbie, and have no idea what I am doing.  I have created
> a html form, and am tring to pass some variable to a perl script to
> make it update a guest book.  When ever I press submit on my form, I
> get a "HTTP 500 - Internal server error".  I checked and the server is
> working fine.  Here is my code.  If anyone has any idea's I really
> appreciated it.
>
>
> #!/user/bin/perl
     ^^^^

This is probably not what you want.  Unless your system is very different
from most, you want
#!/usr/bin/perl

Add these three lines to your script, right after the first line
use strict;
use warnings;
use CGI qw(:standard);

The entirety of this next section of this program is ancient and should
not be used.  Delete the bookmark to whatever site gave you this code.

>
> if($ENV{'REQUEST_METHOD'} eq 'GET')
>    {
>    $in_string= $ENV{'QUERY_STRING'};
>    }
> elsif ($ENV{'REQUEST_METHOD'} eq 'POST')
>    {
>    read(STDIN, $in_string, $ENV{'CONTENT_LENGTH'});
>    }
>
> @an_array = split('&', $in_string);
>
> $array_length = @an_array;
>
> for($i=0; $i<$array_length; $i++)
>    {
>    ($var_name, $value) = split('=', $an_array[$i]);
>       $value =~ tr/+/ /;
>    $value =~ s/%([a-fA-F0-9][a-fA-f0-9])/pack("C", hex($1))/eg;
>    $value =~ s/<!--(.|\n)*-->//g;
>       $var_name =~ tr/+/ /;
>    $var_name =~ s/%([a-fA-F0-9][a-fA-F0-9]/pack("C", hex($1))/eg;
>    $var_name =~ s/<!--(.|\n)*-->//g;
>
>      $in_vars{$var_name} = $value;
>    }

All of that should go away.

Read up on CGI.pm by typing
perldoc CGI
on the command line, or by going to
http://www.perldoc.com/perl5.6/lib/CGI.html

That will tell you about the param() function, and how to get your form
elements.

Paul Lalli

>
> open (LOG, ">>../LOG.txt");
> print LOG ("Name: $in_vars{'username'}\nEmail Address:
> $in_vars{'email'}\nWeb site: $in_vars{'website'}\nHow you found this
>
> site: $in_vars{'R1'}\nYou said: {'Comment'}\n\n----\n\n");
> close (LOG);
>


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

Date: 6 Apr 2004 08:15:45 -0700
From: dash@webdurai.com (Durairaj Avasi)
Subject: Help needed:: Openldap issue - -  LDAP_OPERATIONS_ERROR Server encountered
Message-Id: <2f872516.0404060715.4966368f@posting.google.com>

Hello all:::

Need your hand on this... 

#!/usr/bin/perl -w
use Net::LDAP;
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);
my $ldap = Net::LDAP->new('xy.webdurai.net', port=> 389) or die "$@";

	my @args  = (
            base     => 'DC=xy',
            scope    => "subtree",
            filter   =>
'(&(objectClass=user)(objectCategory=Person))',
            attrs    => ["distinguishedName", "Home-MDB",
"postalAddress", "l","st", "postalcode"]
	);
	my $mesg = $ldap->search( @args );
	if ($mesg->code) {
			print "ERROR detected: -> ", ldap_error_name($mesg->code), " ",
ldap_error_text($mesg->code);
			warn  "ERROR - not LDAP_SUCCESS";
		 	#last;
		}
	my $total = $mesg->count;
	print " the total is $total";

OUTPUT IS:
==========
ERROR detected: -> LDAP_OPERATIONS_ERROR Server encountered
ERROR - not LDAP_SUCCESS at u.pl line 15, <DATA> line 424.

NOTE::
=======

why i am getting LDAP_OPERATIONS_ERROR?

i am running under activeperl/perl-ldap/windows 2000

this is just simple search...  do i have to bind it?

i thought i don't need to bind for search!!

thanks in advance.

Durairaj K. Avasi


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

Date: 6 Apr 2004 08:36:46 -0700
From: dash@webdurai.com (Durairaj Avasi)
Subject: Help needed:: Openldap issue - -  LDAP_OPERATIONS_ERROR Server encountered
Message-Id: <2f872516.0404060736.2151cad1@posting.google.com>

#!/usr/bin/perl -w
use Net::LDAP;
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);
my $ldap = Net::LDAP->new('xy.webdurai.net', port=> 389) or die "$@";

        my @args  = (
            base     => 'DC=xy',
            scope    => "subtree",
            filter   =>
'(&(objectClass=user)(objectCategory=Person))',
            attrs    => ["distinguishedName", "Home-MDB",
"postalAddress", "l","st", "postalcode"]
        );
        my $mesg = $ldap->search( @args );
        if ($mesg->code) {
                        print "ERROR detected: -> ",
ldap_error_name($mesg->code), " ",
ldap_error_text($mesg->code);
                        warn  "ERROR - not LDAP_SUCCESS";
                         #last;
                }
        my $total = $mesg->count;
        print " the total is $total";

OUTPUT IS:
==========
ERROR detected: -> LDAP_OPERATIONS_ERROR Server encountered
ERROR - not LDAP_SUCCESS at u.pl line 15, <DATA> line 424.

NOTE::
=======

why i am getting LDAP_OPERATIONS_ERROR?

i am running under activeperl/perl-ldap/windows 2000

this is just simple search...  do i have to bind it?

i thought i don't need to bind for search!!

thanks in advance.

Durairaj K. Avasi


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

Date: Tue, 06 Apr 2004 20:46:47 +0200
From: Vetle Roeim <vetro@online.no>
Subject: Re: Help needed:: Openldap issue - -  LDAP_OPERATIONS_ERROR Server encountered
Message-Id: <m34qrxkkq0.fsf@quimby.dirtyhack.org>

* Durairaj Avasi
[...]
> this is just simple search...  do i have to bind it?
>
> i thought i don't need to bind for search!!

  Try binding. You can do an anonymous bind by calling bind w/o any
  parameters.


[...]
-- 
#!/usr/bin/vr


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

Date: Tue, 06 Apr 2004 22:36:10 +0200
From: Fred <dreamer@cox.net>
Subject: Mime::Lite and smtp authentification
Message-Id: <LoydnZ8mcv4gie7dRVn2ig@giganews.com>

I have been using a sendmail script based on Mime::Lite for years. Now I 
have to switch to a server which requires smtp authentification, and I 
cannot find any information about how to do that.
If smtp.mail authorisation is not possible with Mime::Lite, which other 
module can be used instead?

-- Fred


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

Date: 6 Apr 2004 13:12:56 -0700
From: slkleine@hotmail.com (Steve The Geek)
Subject: More NET::LDAP questions
Message-Id: <863f122c.0404061212.208cbb@posting.google.com>

I have the script running to plow through out AD structure and pull
out all the disabled accounts.

I've also got the damnedable thing parsing the logon script for
userhome drive mappings, getting the last logon date, and highlighting
the user's distinguished name.

According to MS, an LDAP query of
(useraccountcontrol:1.2.840.113556.1.4.803:=2) should pull up all
expired accounts. From the LDP utility in the Windows 2000 resource
kit, it works.

What I get in perl is:

  I/O Error   at SearchViaLdapForExpiredAccounts-modified.pl line 45

I've had to pull out the combinations that work, but damn...



Here's the relevant (working) code section:

$mesg = $ldap->search( # find all objects with "accountDisabled" set
                        base   => 'DC=workplace,DC=com',
                        filter => '(|(useraccountcontrol=2)
                                   (useraccountcontrol=514)
                                   (useraccountcontrol=18)
                                   (useraccountcontrol=34)
                                   (useraccountcontrol=52)
                                   (useraccountcontrol=66)
                                   (useraccountcontrol=84)
                                   (useraccountcontrol=136)
                                   (useraccountcontrol=514)
                                   (useraccountcontrol=532)
                                   (useraccountcontrol=584)
                                   (useraccountcontrol=668)
                                   (useraccountcontrol=65538)
                                   (useraccountcontrol=65556)
                                   (useraccountcontrol=65608)
                                   (useraccountcontrol=65692)
                                   (useraccountcontrol=66360)
                                   (useraccountcontrol=8388610)
                                   (useraccountcontrol=8388628)
                                   (useraccountcontrol=8388680)
                                   (useraccountcontrol=8388764)
                                   (useraccountcontrol=8389432)
                                   (useraccountcontrol=8455792))',
                        attrs => ['memberof',
                                  'samaccountname',
                                  'homedirectory',
                                  'name',
                                  'distinguishedname',
                                  'lastlogon']
                        );

print $mesg->count," enteries found.\n";

$mesg->code && die $mesg->error;

<end code section>

Any thoughts of why the easier 1.2.840.113556.1.4.803:=2 won't work?

Thanks!

Steve the (**** MS) Geek


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

Date: Tue, 6 Apr 2004 19:01:50 GMT
From: "bxb7668" <bxb7668@somewhere.nocom>
Subject: Open GUI transcript window
Message-Id: <HvrJJ2.8LC@news.boeing.com>

I have been given a requirement for a perl script that runs on both
Windows and UNIX (AIX) from both the command line (UNIX) and the
Windows Start menu. It can take a long time to run, so they also want
it to write intermediate status messages. For the command line I just
write to STDOUT. No problem. But in the Windows GUI environment they
want a text window to open and the status message dynamically written
to it and show up as they are written, not when the entire process is
complete.  Can this be done, and if so, how?  We're using Perl 5.6.1.
Brian




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

Date: Tue, 6 Apr 2004 15:28:56 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Open GUI transcript window
Message-Id: <20040406152611.J29551@dishwasher.cs.rpi.edu>

On Tue, 6 Apr 2004, bxb7668 wrote:

> I have been given a requirement for a perl script that runs on both
> Windows and UNIX (AIX) from both the command line (UNIX) and the
> Windows Start menu. It can take a long time to run, so they also want
> it to write intermediate status messages. For the command line I just
> write to STDOUT. No problem. But in the Windows GUI environment they
> want a text window to open and the status message dynamically written
> to it and show up as they are written, not when the entire process is
> complete.  Can this be done, and if so, how?  We're using Perl 5.6.1.
> Brian

Is there anything wrong with the CMD.exe window that normally comes up
when you write to STDOUT?  If Windows is configured to associate .pl or
 .plx files with the Perl interpreter, and you click that perl script from
the Start menu, any prints to STDOUT will show up in the black command
line window.

If this is not acceptable, for some reason, and the requirement is for
something more like a Notepad-style window, then you're delving into the
world of Perl/Tk.  You might want to ask in comp.lang.perl.tk instead.

Paul Lalli


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

Date: 6 Apr 2004 12:54:03 -0700
From: akaliel@streamflo.com (akaliel)
Subject: Re: Perl and Internet Explorer
Message-Id: <7123bc57.0404061154.595341a@posting.google.com>

> Not sure if it will make any difference to IE, but might be worth a try. And
> if it does work but blows up Netscape you could always detect the browser
> type and send the appropriate header.
> 
> Matt

That's the MIME type I'm using that managed to get it to partially
work.  Right clicking on the link will allow me to save it as a .ppt
by default.  However, left clicking on the link does nothing
whatsoever.  If I right click and say "Open in New Window" then just
after the new window launches, it crashes.


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

Date: Tue, 6 Apr 2004 17:44:30 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Perl and Internet Explorer
Message-Id: <1xFcc.4987$BF2.609573@news20.bellglobal.com>


"akaliel" <akaliel@streamflo.com> wrote in message
news:7123bc57.0404061154.595341a@posting.google.com...
> > Not sure if it will make any difference to IE, but might be worth a try.
And
> > if it does work but blows up Netscape you could always detect the
browser
> > type and send the appropriate header.
> >
> > Matt
>
> That's the MIME type I'm using that managed to get it to partially
> work.  Right clicking on the link will allow me to save it as a .ppt
> by default.  However, left clicking on the link does nothing
> whatsoever.  If I right click and say "Open in New Window" then just
> after the new window launches, it crashes.

I assume you've already tried the following http header to specify a default
filename?

Content-Disposition: attachment; filename=[FILENAME]

If so, then I'm out of ideas...

Matt




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

Date: 6 Apr 2004 08:57:08 -0700
From: jason@purplewire.com (Jason Crowther)
Subject: Perl Version Issue?
Message-Id: <37a16639.0404060757.7a31d78d@posting.google.com>

I've stumbled across a little strangeness when we had to do an
emergency upgrade from perl 5.6.0 to perl 5.8.0.

I have some code that works fine under 5.6.0 but goes down in flames
in 5.8.0.  the error I'm getting is "Can't find label...".

I can replicate this issue with two simple files:


test.pl:
#!/usr/bin/perl
print "test 1\n";
goto SKIP;
print "test 2\n";
SKIP:
print "test 3\n";
1;

caller.pl:
#!/usr/bin/perl
require 'test.pl';
exit 0;


here's what you get when you run these on 5.6.0:

$ ./test.pl 
test 1
test 3
$ ./caller.pl
test 1
test 3

here's what happens on 5.8.0:

$ ./test.pl 
test 1
test 3
$ ./caller.pl 
test 1
Can't find label SKIP at test.pl line 5.
Compilation failed in require at ./caller.pl line 2.


I'm not sure what could be causing the problem.  is this a bug or new
default perl behavior?  I couldn't find any relavent previous posts.

thanks for any help!

ps. I know that goto's are evil to begin with!  I'm slowly but surely
working the goto's out this historical code...  ;-)


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

Date: Tue, 06 Apr 2004 18:53:52 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Perl Version Issue?
Message-Id: <pan.2004.04.06.16.48.47.784058@aursand.no>

On Tue, 06 Apr 2004 08:57:08 -0700, Jason Crowther wrote:
> I've stumbled across a little strangeness when we had to do an emergency
> upgrade from perl 5.6.0 to perl 5.8.0.
> [...]

I had no problem running the code posted on Perl 5.8.2.  Seems like it
must be a bug of some sort...?


-- 
Tore Aursand <tore@aursand.no>


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

Date: Tue, 06 Apr 2004 18:30:07 GMT
From: Kirk Strauser <kirk@strauser.com>
Subject: Re: Perl Version Issue?
Message-Id: <87d66lyna6.fsf@strauser.com>

=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 2004-04-06T15:57:08Z, jason@purplewire.com (Jason Crowther) writes:

> #!/usr/bin/perl

You forgot the "-w" and "use strict;".  Add those and see if it gives you
additional warnings.
=2D --=20
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAcvam5sRg+Y0CpvERAlmBAJ9hCdjaM5y9dYxsWoIP4P0ZSKxk1wCdHhQB
mrfN09uRfxEU4wrqEvYca7s=3D
=3DTyVP
=2D----END PGP SIGNATURE-----


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

Date: Tue, 06 Apr 2004 20:48:30 +0200
From: Vetle Roeim <vetro@online.no>
Subject: Re: Perl Version Issue?
Message-Id: <m3y8p9j62p.fsf@quimby.dirtyhack.org>

* Kirk Strauser
> At 2004-04-06T15:57:08Z, jason@purplewire.com (Jason Crowther) writes:
>
>> #!/usr/bin/perl
>
> You forgot the "-w" and "use strict;". 

  Or "use warnings".

[...]
-- 
#!/usr/bin/vr


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

Date: Tue, 06 Apr 2004 19:53:18 GMT
From: Geoff Cox <geoffacox@dontspamblueyonder.co.uk>
Subject: Re: real, simple sample OOP intro text??!!
Message-Id: <ng26701m8tmpi4mtiib8tuu50u1dvs67b0@4ax.com>

On 6 Apr 2004 08:39:38 GMT, "Tassilo v. Parseval"
<tassilo.parseval@rwth-aachen.de> wrote:


>Good. One thing you have to be careful with: When you use global
>variables to keep track of the current state (like in which tag the
>parser currently is), you need to reset them for each file.
>
>That can be conveniently done by overriding the parse*() methods in your
>parser subclass:
>
>    package MyParser;
>    use base qw/HTML::Parser/;
>    
>    my $in_heading;
>    my $p;
>
>    # and possibly the same for parse() and parse_chunk()
>    # if you use those
>    sub parse_file {
>	my $self = shift;
>	($in_heading, $p) = (0, 0);
>	$self->SUPER::parse_file(@_);
>    }
>
>    sub start {
>     ...
>    }
>    ...
>    
>SUPER is a metapackage specifier. Since HTML::Parser::parse_file() is
>overridden, it is no longer called when doing
>
>    $parser->parse_file(...);
>
>In order to call it nonetheless after the resetting is done, this line
>
>    $self->SUPER::parse_file(@_);
>
>refers to the superclass' parse_file() method. Using SUPER::method() is
>a common way to call the original inherited method even when it has been
>overridden by the subclass.
>
>Once have you overridden these methods thusly, you no longer have to
>worry when calling
>
>    $parser->parse_file("file.html");
>
>because this method will now take care of resetting any global
>variables.

Thanks Tassilo - will tale note...

Cheers

Geoff





>Tassilo



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

Date: Tue, 6 Apr 2004 21:00:18 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: real, simple sample OOP intro text??!!
Message-Id: <slrnc766j1.l91.dha@panix2.panix.com>

In article <x77jwvh08q.fsf@mail.sysarch.com>, Uri Guttman wrote:
>>>>>> "TvP" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:
> 
>  TvP> Also sprach Uri Guttman:

[snip]

>  TvP> I'd rather suggest he has a look at Randal's "Learning Perl
>  TvP> Objects, References & Modules. And unlike Damian's book, this
>  TvP> one comes with excercises for the reader.
> 
> i would expect that to be good too. i haven't snarfed a copy yet :)

Aha.  Well, if you can push damian's book as a tech reviewer of it, I
can help out here.  :-)  Yes, it's a good book.

Damian's book, although wonderful, is very much an in-depth look at OOP,
whereas Randal's book feels a bit more like an introduction - not wholly
surprising, as it's intended to act sort of as a follow up to Learning Perl.

As a comparison, consider Mastering Regular Expressions - someone who
just wants to learn about using regular expressions doesn't need to read
a rather large portion of the book.  If you want to learn about regexen
in general, however, you probably can't do better. I seem to remember
that someone was working on a book on Perl regexen as such, but afaik
it's not actually available.

If you *really* want to understand all the ins and outs of OOP, get
Damian's book.  If you just want to be able to *use* OOP, Randal's book
might work well for you (although I'd recommend reading damian's at some
point, as it really is quite good).

Also, if examples featuring characters from Gilligan's Island appeals,
Randal's book wins on that score. :-)

> but given the pricing of us books in london, i doubt the OP will get
> much of any discount though i think PORM has a cheaper list price than
> OOP.

Re: pricing - I don't know the reasons for it, but I have always found
the "same price but in sterling" to hold for US vs. UK.  I remember
picking up a copy of Elvis Costello's My Aim Is True (on VINYL, so this
is a *long* time ago :-) in London at one point and it was whatever it
cost here, but in pounds.  So this neither new nor restricted to
computer books.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"That's one of the tragedies of this life:  that the men most in need
of a beating up are always enormous." - John D. Hackensacker III


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

Date: Tue, 6 Apr 2004 17:54:30 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: script
Message-Id: <c4uqq5$u22$1@news.simnet.is>

"Walter Roberson" <roberson@ibd.nrc-cnrc.gc.ca> wrote in message
news:c4su6a$f55$1@canopus.cc.umanitoba.ca...
> In article <6e41ded2.0404051451.7e41e8c4@posting.google.com>,
> Itsd <itsd2001@hotmail.com> wrote:
> :I am looking for script that can do:

[ snip ]

great reply ! :-)

gnari






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

Date: 6 Apr 2004 11:58:25 -0700
From: emailgrant123@yahoo.com (Grant)
Subject: Re: simple scratch variable parsing
Message-Id: <1c9d8b45.0404061058.68df82e1@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc73kqm.q2m.tadmc@magna.augustmail.com>...
> Grant <emailgrant123@yahoo.com> wrote:
> 
> > Hello!  I've got scratch variables like:
> 
> 
> How is a "scratch variable" different from a "variable"?
> 
> 
> > c1
> > sc1
> > sr1
> 
> 
> Those are not variables. Variables in Perl have sigils.
> 
> Those are probably values rather than variables.
> 
> 
> > The letters involved should either be "c", "sc", or "sr", and the
> > number(s) could be any.  This is pulled from the URL, and I'd like to
> > make sure it's formed correctly, so I'd rather not just filter it for
> > letters and filter it for numbers.  It seems like I'd need to check it
> > character by character?  How can I do this?  
> 
> 
>    if ( $scratch =~ /^(c|sc|sr)\d+$/ )
>       { print "valid\n" }
>    else
>       { print "not valid\n" }

Thank you very much Tad!

- Grant


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

Date: Tue, 6 Apr 2004 17:47:13 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: striptag
Message-Id: <c4uqce$u1a$1@news.simnet.is>

"Himanshu Garg" <himanshu@gdit.iiit.net> wrote in message
news:a46e54c7.0404052347.2bea8962@posting.google.com...
> Dan Jacobson <jidanni@jidanni.org> wrote in message
news:<87d66mm44e.fsf@jidanni.org>...
> > This used to strip only the given tags:
> > $ striptag font div < file.html
> > but now it strips all tags. Something must have changed on my system.
Help.
> > $ cat striptag
> > use strict;
> > use HTML::Parser;
> > my $parser = HTML::Parser->new( text_h => [ sub { print
shift; },"dtext" ]);
> > $parser->parse_file(*STDIN);
>
> You probably deleted the code that handles the command line arguments.
> Nowhere do I see special handling of ARGV which in this case is font
> and div.

or more likely, you have another version of the script lying around,
that deals with the tag selection.

gnari





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

Date: Tue, 06 Apr 2004 17:31:40 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: Tough (for me) regex case
Message-Id: <remorse-41C993.17314006042004@plato.harvard.edu>

In article <lt0n60d4k4rv7hukaei12s0tsq2p6btc80@4ax.com>,
 Rob Perkins <rob_perkins@hotmail.com> wrote:

> /(?<!")"(?!")(.*?)(?<!")"(?!")/, on my sample string, produces:
> 
> <>
> "quick"
> "fox jumped ""over"" the"
> </>
> 
> How should I modify the regex to get:
> <>
> quick
> fox jumped ""over"" the
> </> 
> 
> ...in other words, without the quotes as first and last characters in
> the matches?

You could add a second and third pass:
s/^"//;
s/"$//;

HTH,
Ricky

-- 
Pukku


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

Date: Tue, 06 Apr 2004 22:38:15 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Unknown function
Message-Id: <psl470du1b9sad9ugo0215ech8a7b6b55m@4ax.com>

On Mon, 05 Apr 2004 21:50:35 GMT, "John W. Krahn" <krahnj@acm.org>
wrote:

>>   @files = <'logs/*.log'>;
>>            ^            ^
>> 
>> are you sure you didn't mistook them for parens?
>
>You do realize that the single quotes will be included as part of the
>path/file name meaning that you are looking for the directory "'logs"
>with files ending in ".log'"?

D'Oh!


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

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


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