[29246] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 490 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 7 11:10:14 2007

Date: Thu, 7 Jun 2007 08:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 7 Jun 2007     Volume: 11 Number: 490

Today's topics:
        Can't find par loader at C:/Perl/site/lib/PAR/Packer.pm  osoeder@gmx.de
        clone PerlMagick functionality in POGL for a GPU? <guba@vi-anec.de>
    Re: clone PerlMagick functionality in POGL for a GPU? <mgjv@tradingpost.com.au>
    Re: clone PerlMagick functionality in POGL for a GPU? <bugbear@trim_papermule.co.uk_trim>
    Re: Computer List (Pls hlp!) <shmh@bigpond.net.au>
    Re: FAQ 8.49 How do I add a directory to my include pat <baxter.brad@gmail.com>
    Re: LWP to fill in forms: "Cookies are not Enabled on y <baxter.brad@gmail.com>
    Re: LWP to fill in forms: "Cookies are not Enabled on y <kiwi509@gmail.com>
    Re: Obtain Filename and Lineno of the Function Caller <ilias@lazaridis.com>
        Querying for a registry string VALUE AutoEndTasks  <shmh@bigpond.net.au>
    Re: Re-entrant code ??? <jurgenex@hotmail.com>
        Sorting  keith@bytebrothers.co.uk
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 07 Jun 2007 07:58:49 -0700
From:  osoeder@gmx.de
Subject: Can't find par loader at C:/Perl/site/lib/PAR/Packer.pm line 101.
Message-Id: <1181228329.860050.158430@w5g2000hsg.googlegroups.com>

Hello, I plan to compile some of my Perl scripts to .exe.

I followed this instruction:
http://www.expertsrt.com/tutorials/Matt/perlPAR.html

I could compile all new modules, but as soon as I type the command:

C:\temp>pp clip.exe clip.pl

it will show this output:

Can't find par loader at C:/Perl/site/lib/PAR/Packer.pm line 101.

Here is an extract around line 101 of Packer.pm

sub set_options {
    my ($self, %opt) = @_;

    $self->{options} = \%opt;
    $self->_translate_options($self->{options});

    $self->{parl} ||= $self->_can_run("parl$Config{_exe}")
      or die("Can't find par loader");
    $self->{dynperl} ||=
      $Config{useshrplib} && ($Config{useshrplib} ne 'false');
    $self->{script_name} = $opt{script_name} || $0;
}

Thanks for you help

Oliver



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

Date: Thu, 07 Jun 2007 03:12:09 -0700
From:  "guba@vi-anec.de" <guba@vi-anec.de>
Subject: clone PerlMagick functionality in POGL for a GPU?
Message-Id: <1181211129.643996.292260@q69g2000hsb.googlegroups.com>

Hello,

I have made some programs with ImageMagick/PerlMagick
for image processing: batch composing of images from
several source images, up to 4000x4000 pixel. Because
IM is using only the CPU I am wondering how I could
port this functionality to a much faster GPU.

[The PerlMagick methods I used are:
Append, Blur, Clone, Composite(In, Over, CopyOpacity),
Crop, Draw, Flip, Flop, Get(columns, rows), Read,
Rescale or Zoom, Roll, Rotate, Set(size, matte, page),
Write.]

Recently I read something about Core Image in OSX 10.4
http://developer.apple.com/macosx/coreimage.html
and the CIKernel Language that is a derivative of the
more general purpose OpenGL Shading Language
using only things that are relevant for 2D image processing.
So I began reading about OpenGL and I found POGL,
an opensource Perl OpenGL module:
http://graphcomp.com/pogl.cgi?v=0111s1m1

Might this be a (easy?) way to clone the functionality
that I needed in IM for a GPU? Thank you for hints!

Guenter



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

Date: Thu, 7 Jun 2007 21:34:25 +1000
From: Martien verbruggen <mgjv@tradingpost.com.au>
Subject: Re: clone PerlMagick functionality in POGL for a GPU?
Message-Id: <slrnf6fra1.nu3.mgjv@martien.heliotrope.home>

On Thu, 07 Jun 2007 03:12:09 -0700,
	guba@vi-anec.de <guba@vi-anec.de> wrote:
> Hello,
>
> I have made some programs with ImageMagick/PerlMagick
> for image processing: batch composing of images from
> several source images, up to 4000x4000 pixel. Because
> IM is using only the CPU I am wondering how I could
> port this functionality to a much faster GPU.

As this would require changes to the core functionality in the
ImageMagick libraries, and not to the Perl parts of it, you should
probably consider discussing this with the imageMagick developers. They
can be found on the Discourse server, or the mailing lists, both
mentioned at www.imagemagick.org (follow the User Community link).

Martien
-- 
                        | Yes; Windows is great for running &
Martien Verbruggen      | developing viruses, for instance.  It's also
                        | very popular, but then again, so is the
                        | common cold. -- Dave Hinz


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

Date: Thu, 07 Jun 2007 12:43:02 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: clone PerlMagick functionality in POGL for a GPU?
Message-Id: <4667ef46$0$8749$ed2619ec@ptn-nntp-reader02.plus.net>

guba@vi-anec.de wrote:
> Hello,
> 
> I have made some programs with ImageMagick/PerlMagick
> for image processing: batch composing of images from
> several source images, up to 4000x4000 pixel. Because
> IM is using only the CPU I am wondering how I could
> port this functionality to a much faster GPU.

Imagemagick is rather slow for large images, due to
it's memory use (and lack of sophticated memory strategy).

It's wonderfully versatile and complete (I use it a lot),
and is truly excellent for screen/HTML size images.

Rather less good for larger images, I'm afraid,
so finding an alternative might be good in your circumstances.

Of course, none of this has anything to do with perl ;-)

   BugBear


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

Date: Thu, 07 Jun 2007 12:13:54 GMT
From: "SimonH" <shmh@bigpond.net.au>
Subject: Re: Computer List (Pls hlp!)
Message-Id: <6ES9i.9858$wH4.7348@news-server.bigpond.net.au>

Kevin youre a champion!

THANKS SO MUCH FOR YOUR HELP really appreciate it mate. Thank you!!

Simon

"Kevin Sproule" <kevinsproule@hotmail.com> wrote in message 
news:5Bq9i.450069$6P2.307481@newsfe16.phx...
>
> "SimonH" <shmh@bigpond.net.au> wrote in message 
> news:st88i.7674$wH4.5892@news-server.bigpond.net.au...
>> Hi guys hope you can help me with a perl script.
>>
>> We are running multiple platforms - NT and XP.
>> I have a computer list in computers.txt
>> Each system has a local administrator account, let's say it is
>> <computername>\administrator, with password 'password'.
>>
>> What I need to do is to:
>> 1) Determine if the system is NT or XP
>> 2) If it is NT, then connect by <computername>\administrator, with 
>> password
>> 'password', then write a line to an output file called output.txt the 
>> status
>> of the browser service. So the format of the output.txt would be 
>> something
>> like:
>> <computername>, operatingsystem, servicename, status
>> 3) If it is XP, then connect by <domain1>\simon, with password 'simtest',
>> then write a line to an output file called output.txt with the same 4
>> columns as 2).
>> 4) While the script is running, a status of 'connecting to <computername>
>> would be great.
>>
>> Any help greatly appreciated.
>>
>> Simon
>>
>
> Simon,
>
> This may get you started:
>
> #!/perl/bin/perl.exe -w
>
> use Win32::Service;
>
> my ($hostName, $serviceName, %status);
>
> my %statusCode = (1 => 'STOPPED', 2 => 'START_PENDING',
>                  3 => 'STOP_PENDING', 4 => 'RUNNING',
>                  5 => 'CONTINUE_PENDING',6 => 'PAUSE_PENDING',
>                  7 => 'PAUSED', 8 => 'ERROR');
>
> $hostName = 't23-kevin';      # server name or IP address
> $serviceName = 'w3svc';       # short name of service
>
> Win32::Service::GetStatus($hostName, $serviceName, \%status);
>
> print $statusCode{$status{"CurrentState"}}, "\n";
>
>
> Test:
> C:\pl>perl webcheck.pl
> STOPPED
>
> C:\pl>net start w3svc
> The World Wide Web Publishing service is starting.
> The World Wide Web Publishing service was started successfully.
>
>
> C:\pl>perl webcheck.pl
> RUNNING
>
> C:\pl>
>
>
> Kevin Sproule
> 




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

Date: Thu, 07 Jun 2007 13:20:23 -0000
From:  Brad Baxter <baxter.brad@gmail.com>
Subject: Re: FAQ 8.49 How do I add a directory to my include path (@INC) at runtime?
Message-Id: <1181222423.284810.52310@p77g2000hsh.googlegroups.com>

On Jun 6, 9:03 pm, PerlFAQ Server <b...@stonehenge.com> wrote:
> 8.49: How do I add a directory to my include path (@INC) at runtime?
>
>     Here are the suggested ways of modifying your include path:
>
>             the PERLLIB environment variable
>             the PERL5LIB environment variable
>             the perl -Idir command line flag
>             the use lib pragma, as in
>                     use lib "$ENV{HOME}/myown_perllib";
>
>     The latter is particularly useful because it knows about machine
>     dependent architectures. The lib.pm pragmatic module was first included
>     with the 5.002 release of Perl.

Pedantic nit:

s/latter/last/;

'Latter' refers to the second of two.

But I might say, "The last way is ...", or, "The last example is ...",
or, 'The "use lib" example is ...'.

--
Brad



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

Date: Thu, 07 Jun 2007 13:32:44 -0000
From:  Brad Baxter <baxter.brad@gmail.com>
Subject: Re: LWP to fill in forms: "Cookies are not Enabled on your Browser"
Message-Id: <1181223164.375889.227240@q75g2000hsh.googlegroups.com>

On Jun 7, 12:47 am, Kyri <kiwi...@gmail.com> wrote:
> Hi Everyone,
>
> I'm writing a program that fills in the username and password field onwww.facebook.com/login.phpand hits submit.
> The forms fill out correctly and the button is hit correctly.
> However, I get an error page when my program tries to log in.  It has
> the message:
>
> "Cookies are not enabled on your browser. Please adjust this in your
> security preferences before continuing."
>
> Here is that portion of my code:
>
> # Author: Kyri Baker
> # 2007/06/05
>
> use Tk;
> use LWP;
> use HTTP::Cookies;
> use POSIX;
> use strict;
> require Tk::DialogBox;
> require LWP::UserAgent;
>
> my $ua = LWP::UserAgent->new;
> $ua->cookie_jar( HTTP::Cookies->new() );
> $ua->timeout(10);
> $ua->env_proxy;
> $ua->agent('Mozilla/5.0');
>
> my $email='kiwi...@gmail.com';
> my $pass='MY_PASSWORD';
> my $action = 'Login';
> my $response = $ua->post('http://www.facebook.com/login.php',['email'=>
> $email, 'pass'=>$pass, 'doquicklogin'=>$action]);
>
> print $response->content;
>
> --------
> Any input at all would be great, I'm just getting into Perl.  :c)

The cookie jar needs a file, e.g.,

my $cjar = "/tmp/bmb_lwpcookies.txt";  # yours will be different
my $ua = LWP::UserAgent->new(cookie_jar=>{file=>$cjar,autosave=>1});

But I haven't tested your script to see if this is the actual/only
problem.

--
Brad



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

Date: Thu, 07 Jun 2007 14:19:20 -0000
From:  Kyri <kiwi509@gmail.com>
Subject: Re: LWP to fill in forms: "Cookies are not Enabled on your Browser"
Message-Id: <1181225960.324570.324720@g4g2000hsf.googlegroups.com>

On Jun 7, 7:32 am, Brad Baxter <baxter.b...@gmail.com> wrote:
> On Jun 7, 12:47 am, Kyri <kiwi...@gmail.com> wrote:
>
>
>
> > Hi Everyone,
>
> > I'm writing a program that fills in the username and password field onwww.facebook.com/login.phpandhits submit.
> > The forms fill out correctly and the button is hit correctly.
> > However, I get an error page when my program tries to log in.  It has
> > the message:
>
> > "Cookies are not enabled on your browser. Please adjust this in your
> > security preferences before continuing."
>
> > Here is that portion of my code:
>
> > # Author: Kyri Baker
> > # 2007/06/05
>
> > use Tk;
> > use LWP;
> > use HTTP::Cookies;
> > use POSIX;
> > use strict;
> > require Tk::DialogBox;
> > require LWP::UserAgent;
>
> > my $ua = LWP::UserAgent->new;
> > $ua->cookie_jar( HTTP::Cookies->new() );
> > $ua->timeout(10);
> > $ua->env_proxy;
> > $ua->agent('Mozilla/5.0');
>
> > my $email='kiwi...@gmail.com';
> > my $pass='MY_PASSWORD';
> > my $action = 'Login';
> > my $response = $ua->post('http://www.facebook.com/login.php',['email'=>
> > $email, 'pass'=>$pass, 'doquicklogin'=>$action]);
>
> > print $response->content;
>
> > --------
> > Any input at all would be great, I'm just getting into Perl.  :c)
>
> The cookie jar needs a file, e.g.,
>
> my $cjar = "/tmp/bmb_lwpcookies.txt";  # yours will be different
> my $ua = LWP::UserAgent->new(cookie_jar=>{file=>$cjar,autosave=>1});
>
> But I haven't tested your script to see if this is the actual/only
> problem.
>
> --
> Brad

Ah...thank you.  This is a very ignorant question, but I currently
have cookies.txt as a blank text file and my program errors saying
"cookies.txt does not seem to contain cookies" - Am I supposed to be
sending my browser cookies?!



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

Date: Thu, 07 Jun 2007 11:06:19 -0000
From:  Ilias Lazaridis <ilias@lazaridis.com>
Subject: Re: Obtain Filename and Lineno of the Function Caller
Message-Id: <1181214379.606699.245660@w5g2000hsg.googlegroups.com>

thanks for the concise replies.

everything works nice.

summarized here:

http://dev.lazaridis.com/lang/ticket/11

 .



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

Date: Thu, 07 Jun 2007 12:11:52 GMT
From: "SimonH" <shmh@bigpond.net.au>
Subject: Querying for a registry string VALUE AutoEndTasks 
Message-Id: <cCS9i.9854$wH4.6189@news-server.bigpond.net.au>

Hi guys would love your help.

I have the following....

=================================================================
#use Win32::Process;
use Win32::Registry;
open (INPUT,"machines.txt") or die "cant open machine.txt";
@computers = <INPUT>;

      while (<INPUT>){
            chomp;
            push @computers, $_;
                         }
       foreach $computer(@computers) {
                          print "Connecting to ....... $computer\n";
      $rc = system ("net use \\\\$computer\\ipc\$ /user:domain\\user 
password> NUL");
         if ($rc ==0){                # If the connection succeeds
               print "Connected to $computer\n";
               QueryAutoEndTasksReg;
         print " AutoEndTasks = $AutoValue\n";
                  }
      elsif (!rc ==0) {                                                # If 
the connection fails......
            print "Failed to connect to $computer\n\n";
      }
}

sub QueryAutoEndTasksReg {
    $p = '.DEFAULT\Control Panel\Desktop';
    Win32::RegOpenKeyEx(&HKEY_USERS,$p,&NULL,&KEY_ALL_ACCESS,$hkey);
    Win32::RegQueryValueEx($hkey,"AutoEndTasks",&NULL,$type,$AutoValue);
#    Win32::RegCloseKey($hkey);

  }

================================================================= Output at 
the moment is this...

C:\Test>test.pl
Connecting to ....... machine1

The command completed successfully.

Connected to machine1

 AutoEndTasks =
Connecting to ....... machine2

System error 53 has occurred.

The network path was not found.

Failed to connect ot machine2


Connecting to ....... machine3

The command completed successfully.

Connected to machine3

 AutoEndTasks =

C:\Test>

=====================================================

What Im trying to do is query the following registry string VALUE 
AutoEndTasks on all systems in a machine.txt file...

HKEY_USERS\.DEFAULT\Control Panel\Desktop\AutoEndTasks

I have a feeling I have the format wrong in my sub..

sub QueryAutoEndTasksReg {
    $p = '.DEFAULT\Control Panel\Desktop';
    Win32::RegOpenKeyEx(&HKEY_USERS,$p,&NULL,&KEY_ALL_ACCESS,$hkey);
    Win32::RegQueryValueEx($hkey,"AutoEndTasks",&NULL,$type,$AutoValue); 
#Im not sure if I have this correct.
#    Win32::RegCloseKey($hkey);

  }


If someone could offer some advice, that would be great.

Thank you.

S





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

Date: Thu, 07 Jun 2007 09:36:10 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Re-entrant code ???
Message-Id: <ekQ9i.7062$UD4.6110@trndny07>

Joe Smith wrote:
> tyjb wrote:
>>    system("perl ojob.pl");
>
> The system() call returns a single value: 0 for success and nonzero if
> the other program returned some sort of error.

You are greatly mistaken. I suggest you re-read the third paragraph of the 
documentation of system().

> When ojob.pl invoked via system(), it can _NOT_ affect any variables
> in the parent program.  That's not how values are passed from one
> script to another.

This of course is quite true.

jue 




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

Date: Thu, 07 Jun 2007 01:44:35 -0700
From:  keith@bytebrothers.co.uk
Subject: Sorting
Message-Id: <1181205875.760848.151830@q69g2000hsb.googlegroups.com>


Hello,

I've had a search through CPAN, and have not been able to find an
answer yet, but I would like to know if there is something like
File::Sort which will allow me to specify that there is one or more
header records at the start of the input which should be untouched by
the sort.  Does anyone know of such a module (or an easy way to do
this using File::Sort!)

Thx,
k



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

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


Administrivia:

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

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

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

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

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


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


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