[31616] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2875 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 15 06:09:55 2010

Date: Mon, 15 Mar 2010 03: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           Mon, 15 Mar 2010     Volume: 11 Number: 2875

Today's topics:
        Best Perl compiler, IDE for Win XP, 32bit <FW3006@sbcglobal.net>
    Re: Best Perl compiler, IDE for Win XP, 32bit <FW3006@sbcglobal.net>
    Re: Best Perl compiler, IDE for Win XP, 32bit <ben@morrow.me.uk>
    Re: Best Perl compiler, IDE for Win XP, 32bit <pp@ockham.be>
    Re: Best Perl compiler, IDE for Win XP, 32bit <bart.lateur@telenet.be>
        Fast way to fill memory <newsojo@web.de>
    Re: Renaming an Uploaded Picture File <courses@shaw.ca>
    Re: Renaming an Uploaded Picture File <tadmc@seesig.invalid>
    Re: Renaming an Uploaded Picture File <jurgenex@hotmail.com>
    Re: Renaming an Uploaded Picture File <courses@shaw.ca>
    Re: Renaming an Uploaded Picture File <jurgenex@hotmail.com>
    Re: Web Based Perl Courses <usenet05@drabble.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 14 Mar 2010 14:07:50 -0700 (PDT)
From: 2007 <FW3006@sbcglobal.net>
Subject: Best Perl compiler, IDE for Win XP, 32bit
Message-Id: <1d4ab7b1-d843-43b1-bc9c-b6f8b492df86@u15g2000prd.googlegroups.com>

I am looking for Perl compiler and possibly an IDE.

I have used Active Perl before and was fine with it.  I was searching
online and there was a recommendation for an IDE too.  Then there
seems other IDEs too (Open Perl IDE  and Eclipse IDE - which one?).

So too many to choose from - any guidance?

http://www.cpan.org/ports/index.html#win32
http://www.activestate.com/activeperl/downloads/


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

Date: Sun, 14 Mar 2010 14:12:05 -0700 (PDT)
From: 2007 <FW3006@sbcglobal.net>
Subject: Re: Best Perl compiler, IDE for Win XP, 32bit
Message-Id: <74acc4a3-8418-42d4-af0e-89316722c2ba@t34g2000prm.googlegroups.com>

On Mar 14, 2:07=A0pm, 2007 <FW3...@sbcglobal.net> wrote:
> I am looking for Perl compiler and possibly an IDE.
>
> I have used Active Perl before and was fine with it. =A0I was searching
> online and there was a recommendation for an IDE too. =A0Then there
> seems other IDEs too (Open Perl IDE =A0and Eclipse IDE - which one?).
>
> So too many to choose from - any guidance?
>
> http://www.cpan.org/ports/index.html#win32http://www.activestate.com/acti=
veperl/downloads/

Also there is http://codepad.org/
But I found that it won't take an input from me.


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

Date: Sun, 14 Mar 2010 22:26:15 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Best Perl compiler, IDE for Win XP, 32bit
Message-Id: <7d4077-noe.ln1@osiris.mauzo.dyndns.org>


Quoth 2007 <FW3006@sbcglobal.net>:
> I am looking for Perl compiler and possibly an IDE.
> 
> I have used Active Perl before and was fine with it.  I was searching
> online and there was a recommendation for an IDE too.  Then there
> seems other IDEs too (Open Perl IDE  and Eclipse IDE - which one?).
> 
> So too many to choose from - any guidance?

Padre is supposed to be very good nowadays. (I haven't used it myself,
but I'm not an IDE person.)

Ben



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

Date: Sun, 14 Mar 2010 20:23:25 -0700 (PDT)
From: Pradeep <pp@ockham.be>
Subject: Re: Best Perl compiler, IDE for Win XP, 32bit
Message-Id: <fe4e68a9-1cc3-4bfd-9052-387763a9d201@u15g2000prd.googlegroups.com>

On Mar 15, 3:26=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth 2007 <FW3...@sbcglobal.net>:
>
> > I am looking for Perl compiler and possibly an IDE.
>
> > I have used Active Perl before and was fine with it. =A0I was searching
> > online and there was a recommendation for an IDE too. =A0Then there
> > seems other IDEs too (Open Perl IDE =A0and Eclipse IDE - which one?).
>
> > So too many to choose from - any guidance?
>
> Padre is supposed to be very good nowadays. (I haven't used it myself,
> but I'm not an IDE person.)
>
> Ben

Padre is progressing fine for final release and I hope it will have
great future. I have tried many, but currently I am using Geany.

Pradeep


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

Date: Mon, 15 Mar 2010 09:36:07 +0100
From: Bart Lateur <bart.lateur@telenet.be>
Subject: Re: Best Perl compiler, IDE for Win XP, 32bit
Message-Id: <t6srp5ljb5e1c6ignc2ror666qpiektrnj@4ax.com>

2007 wrote:

>I am looking for Perl compiler and possibly an IDE.

Perl doesn't have a compiler, so that gives me a clue on your expertise
level...

>I have used Active Perl before and was fine with it.  I was searching
>online and there was a recommendation for an IDE too.  Then there
>seems other IDEs too (Open Perl IDE  and Eclipse IDE - which one?).
>
>So too many to choose from - any guidance?
>
>http://www.cpan.org/ports/index.html#win32
>http://www.activestate.com/activeperl/downloads/

Tell you what: since you apparently inquire about perl for Windows, why
don't you install the brand new Strawberry Perl Pro? 


http://perlbuzz.com/2010/03/announcing-strawberry-perl-professional.html

-- 
	Bart.


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

Date: 15 Mar 2010 09:22:36 GMT
From: Oliver 'ojo' Bedford <newsojo@web.de>
Subject: Fast way to fill memory
Message-Id: <4b9dfc5c$0$7622$9b4e6d93@newsspool1.arcor-online.net>

Hi!

For testing purposes I would like to fill chunks of memory (say 20M) with
arbitrary data (say bytes with values 1,2,...255,1,...).

What would be the fastest method?

Oliver



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

Date: Sat, 13 Mar 2010 21:48:01 -0800
From: "Doug H" <courses@shaw.ca>
Subject: Re: Renaming an Uploaded Picture File
Message-Id: <EL_mn.28982$bx3.6511@newsfe13.iad>

Thanks for the reply, jue.

I removed the concatenation (although they were in the text book I have been 
using about Perl) in the line

my $newfilename="/d4/d8/pscc.shawbiz.ca/html/pic".$picnum.".jpg";

to get

my $newfilename="/d4/d8/pscc.shawbiz.ca/html/pic$picnum.jpg";

The rename would still not work but when I again commented out the rename 
statement, the value of $newfilename showed correctly. I then added the "or 
die "Cannot rename the file '$oldfilename' to '$newfilename': $!"; to the 
rename statement. It did not work.

In both cases when I say 'not work', I mean that I get a "Internal Server 
Error" message when I try to run the program rather than a web page 
generated by my Perl script. Can I assume that this means that the version 
of Perl provided by my Internet service provider does not handle what I am 
trying to do? Did I leave something out, perhaps in the "use" statement?

Any ideas?

Thanks you again.



"Doug H" <courses@shaw.ca> wrote in message 
news:53Smn.32025$sx5.23766@newsfe16.iad...
>I am a fairly new Perl programmer so am hoping that my problem is just a 
>simple
> mistake that someone can easily help me with.
>
> I have a short Perl script that gets some information from a form on a web 
> page
> and then uploads a picture file to the web site. This part works fine. My 
> problem
> occurs when I try to rename the file that was just uploaded. My coding is 
> as
> follows:
>
> #!/usr/local/bin/perl -wT
> use CGI;
> #get info about file to upload
> $upload_dir = "/d4/d8/pscc.shawbiz.ca/html/";
> $query = new CGI;  $filename = $query->param("uploadfile");
> #get other information to process
> $picnum= $query->param("picnum");
> $pcomm= $query->param("pcomm");
> $wpage= $query->param("wpage");
> #do the uploading
> $filename =~ s/.*[\/\\](.*)/$1/;
> $upload_filehandle = $query->upload("uploadfile");
> open UPLOADFILE, ">$upload_dir/$filename";
> while ( <$upload_filehandle> )
> {
> print UPLOADFILE;
> }
> close UPLOADFILE;
> #rename the uploaded file
> my $newfilename="/d4/d8/pscc.shawbiz.ca/html/bunnysredone.jpg";
> rename ("/d4/d8/pscc.shawbiz.ca/html/bunnys.jpg",$newfilename);
> ....
> etc (the rest just shows a web page showing the results)
>
> In the above the renaming of the uploaded file works. It renames
> the picture file from 'bunnys.jpg' to 'bunnysredone.jpg'. What I
> need, though, is to have the new picture name created from
> the picture number that was uploaded (the value of $picnum). So
> I replaced the line for $newfilename to be
>
> my $newfilename="/d4/d8/pscc.shawbiz.ca/html/pic".$picnum.".jpg";
>
> With this change, the renaming no longer works. If I comment out
> the actual rename line of code and display the value of $newfilename
> in the output, it shows exactly what I would have expected it to
> be
>  eg
>      /d4/d8/pscc.shawbiz.ca/html/pic5.jpg
>
> where the 5 represents the current value for $picnum.
>
> I do not see what I am doing wrong. Can anyone help?  When I get
> this working I would also like to use the same technique to set
> the value of the old name in the rename line.
>
> Thank you.
>
> 




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

Date: Sun, 14 Mar 2010 00:18:53 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Renaming an Uploaded Picture File
Message-Id: <slrnhpovn2.ob0.tadmc@tadbox.sbcglobal.net>


[ Please learn how to properly compose a followup message.
  Please do not top-post.
]


Doug H <courses@shaw.ca> wrote:

> I then added the "or 
> die "Cannot rename the file '$oldfilename' to '$newfilename': $!"; to the 
                                                                ^^
                                                                ^^
The $! variable contains an error message.


> rename statement. It did not work.
>
> In both cases when I say 'not work', I mean that I get a "Internal Server 
> Error" message when I try to run the program 


Then you should look for the error message that was put into
the server's error log.


>> #!/usr/local/bin/perl -wT


Do you know what the -T switch does?

    perldoc perlrun

describes perl's command line switches.

    forces "taint" checks to be turned on so you can test them.  Ordinarily
    these checks are done only when running setuid or setgid.  It's a
    good idea to turn them on explicitly for programs that run on behalf
    of someone else whom you might not necessarily trust, such as CGI
    programs or any internet servers you might write in Perl.  See
    L<perlsec> for details.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


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

Date: Sat, 13 Mar 2010 23:07:48 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Renaming an Uploaded Picture File
Message-Id: <ej2pp5p33i99muuvbdt61g4fgtgugknd9f@4ax.com>

"Doug H" <courses@shaw.ca> wrote:
>In both cases when I say 'not work', I mean that I get a "Internal Server 
>Error" message when I try to run the program rather than a web page 
>generated by my Perl script.

Dahhh, would have been nice to know this tidbit of information from the
beginning, please see "perldoc -q 500".

Oh, and did you check the server log for the message that was generated
by the die() statement?

jue


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

Date: Sun, 14 Mar 2010 22:11:17 -0700
From: "Doug H" <courses@shaw.ca>
Subject: Re: Renaming an Uploaded Picture File
Message-Id: <7jjnn.46164$Dv7.12533@newsfe17.iad>

Thanks to both repliers.

After refering to my ISP web pages about using Perl I discovered that one 
needs to use

use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

to have errors display. I tried this and it worked--I got statement errors 
in the script I was trying. However I could not figure out what the errors 
actually meant. The statements looked okay to me. Then I had to go to do 
something else and then this evening when I got back to trying it I could 
not even get these error messages to show!  Very discouraging. I do not even 
know whether using the above line means that I do not have to use the "use 
CGI;" line as well.

In any case I think I will just have to start from scratch and try to get 
something to run and show errors if I have them in statements.

You said

> Dahhh, would have been nice to know this tidbit of information from the
> beginning, please see "perldoc -q 500".

How does one refer to "perldoc -q 500"?  Sorry. I have programmed in octal 
(in 1958 before there were languages), Fortran, Basic, Visual Basic, COBOL, 
PL1 but am new to Perl and the book I have been using to learn it, seems to 
disagree with some of the coding I find on the web. It makes it all very 
exasperating.

Doug




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

Date: Sun, 14 Mar 2010 23:31:17 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Renaming an Uploaded Picture File
Message-Id: <ukjrp55t7g9t62uur1je7gb46aeqc1m0k7@4ax.com>

"Doug H" <courses@shaw.ca> wrote:
>After refering to my ISP web pages about using Perl I discovered that one 
>needs to use
>
>use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
>
>to have errors display. 

That is not quite correct. Normally error messages will be sent to
STDERR and thus be displayed on the terminal together with STDOUT.
However because in a web server environment there is no terminal
anything sent to STDERR is being redirect to the error log where it can
be examined later at your convenience.

The above import shortcuts that method and instead -besides other
things- redirects the error messages from STDERR to STDOUT, thus
including them in the regular response from the CGI program to the web
server.

>[...] I could not even get these error messages to show!  

Did you check the web server's error log?

>Very discouraging. I do not even 
>know whether using the above line means that I do not have to use the "use 
>CGI;" line as well.

CGI and CGI::Carp are two totally different modules.

>> Dahhh, would have been nice to know this tidbit of information from the
>> beginning, please see "perldoc -q 500".
>
>How does one refer to "perldoc -q 500"?  Sorry. I have programmed in octal 

perldoc is _the_ standard reference for any Perl command, function,
tool, module, you name it. It is automatically installed as part of any
(correctly) installed Perl installation and you just call it.  

Use
	perldoc perldoc
to find out more about the program itself and 
	perldoc perl
for a top level overview of what information is available. Some helpful
option are
	perltoc: display table of content
	-q : search the FAQ
	-f : display the documentation of a specific function
	ModuleName: display the documentation for module ModuleName
	perlop: display list and documentation of all operators in Perl
	perlsyn: syntax definition for Perl

There are numerous other documents available, like a reference tutorial,
reference documentation, several OO manuals, regular expression tutorial
and manual, and and and.

As for "perldoc -q 500" just type that command in at your command line.

> am new to Perl and the book I have been using to learn it, seems to 
>disagree with some of the coding I find on the web. It makes it all very 
>exasperating.

There are quite a few poorly written books and many, many examples of
really bad code out there. If you really want to know how something is
supposed to work then check out perldoc. It is the ultimate although not
always easiest to read reference. And it is always up to date and always
matching the version of Perl that you installed.

jue


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

Date: Sun, 14 Mar 2010 19:12:28 GMT
From: Graham Drabble <usenet05@drabble.me.uk>
Subject: Re: Web Based Perl Courses
Message-Id: <Xns9D3BC364E17DBgrahamdrabblelineone@drabble.me.uk>

On 11 Mar 2010 "Uri Guttman" <uri@StemSystems.com> wrote in
news:87pr3avh2q.fsf@quad.sysarch.com: 

>>>>>> "GD" == Graham Drabble <usenet05@drabble.me.uk> writes:
> 
>  GD> I've been asked to find some basic / intermediate Perl
>  courses for a GD> colleague. We've already got Learning Perl and
>  Programming Perl on the GD> bookshelf but I've been asked to get
>  a Web course that they can follow. 
> 
>  GD> I know that many people here have a very low opinion of many
>  of GD> them and having reviewed a couple I agree. What's the
>  consensus on GD> the best (least worst!) ones?
> 
> almost all the web tutorials suck donkey eggs. 
> 
> but the o'reilly school of technology (yes, the publisher) has
> just released their perl level 1 class and are planning something
> like 5-6 levels. these come with continuing education credits from
> a real university as well. i recommend them as i know the author
> well (peter scott) and he is very good at perl training. there are
> current discounts on the course so tell your colleague about them.

Thanks. Not sure I'll get the boss to actually spend money but we can 
try.

-- 
Graham Drabble
http://www.drabble.me.uk/


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

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:

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

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 2875
***************************************


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