Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cgi development environment

7 views
Skip to first unread message

Chris Stinemetz

unread,
Sep 18, 2012, 8:34:06 AM9/18/12
to beginn...@perl.org
Hello list,

I am very interested in cgi scripting. I have only used php for web
development in the past.
Would someone please let me know of any good tutorials to get windows
based web development environment set up and get my feet wet?

Thank you in advance,

Chris

Mark Haney

unread,
Sep 18, 2012, 8:46:36 AM9/18/12
to beginn...@perl.org
Is there any particular reason it has to be Windows based? Not that I
think it matters, but perl works okay on windows, but it's not a
platform combo I would recommend.

Would you consider learning it in a VM in Linux?

Otherwise I can get you setup in windows with Perl if you like. I had
to write up a setup sheet when I was working on a project.



--

Mark Haney
Software Developer/Consultant
AB Emblem
ma...@abemblem.com
Linux marius.homelinux.org 3.5.1-1.fc17.x86_64 GNU/Linux

David Christensen

unread,
Sep 18, 2012, 9:19:32 AM9/18/12
to beginn...@perl.org
On 09/18/12 05:34, Chris Stinemetz wrote:
> I am very interested in cgi scripting. I have only used php for web
> development in the past.
> Would someone please let me know of any good tutorials to get windows
> based web development environment set up and get my feet wet?

http://www.google.com/search?q=windows+cgi+howto

http://www.cgi101.com/book/

http://www.cgi101.com/book/connect/winxp.html


HTH,

David

Shaun Fryer

unread,
Sep 18, 2012, 10:13:26 AM9/18/12
to beginn...@perl.org
Native Win32 Perl: http://strawberryperl.com/
Win32 Linux compat layer: http://www.cygwin.com/
Free virtualization env: https://www.virtualbox.org/
Perl Win32 API bindings: https://www.google.ca/search?q=perl+win32+ole
--
Shaun Fryer
----------------------------------------------------------
perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
52959394107588899482799210587992861082757785799222
----------------------------------------------------------
> --
> To unsubscribe, e-mail: beginners-cg...@perl.org
> For additional commands, e-mail: beginners...@perl.org
> http://learn.perl.org/
>
>

Chris Stinemetz

unread,
Sep 18, 2012, 7:53:23 PM9/18/12
to Mark Haney, beginn...@perl.org
On Tue, Sep 18, 2012 at 5:46 AM, Mark Haney <ma...@abemblem.com> wrote:
> On 09/18/2012 08:34 AM, Chris Stinemetz wrote:
>>
>> Hello list,
>>
>> I am very interested in cgi scripting. I have only used php for web
>> development in the past.
>> Would someone please let me know of any good tutorials to get windows
>> based web development environment set up and get my feet wet?
>>
>> Thank you in advance,
>>
>> Chris
>>
>
> Is there any particular reason it has to be Windows based? Not that I think
> it matters, but perl works okay on windows, but it's not a platform combo I
> would recommend.
>
> Would you consider learning it in a VM in Linux?
>
> Otherwise I can get you setup in windows with Perl if you like. I had to
> write up a setup sheet when I was working on a project.
>

I'm not against using VM to set-up a linux box. If you have a write up
I would like to see it.

Thank you,

Chris

Shaun Fryer

unread,
Sep 19, 2012, 1:02:46 AM9/19/12
to Chris Stinemetz, Mark Haney, beginn...@perl.org
If you're running Windows and have a decent amount of RAM, try
installing vbox and then you should be able to find/follow
instructions online to load/install any of the freely available linux
iso's downloadable from the distro's website. I'd recommend either
Ubuntu or Mint, though your preference may vary. It's generally pretty
straight forward.
--
Shaun Fryer
----------------------------------------------------------
perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
52959394107588899482799210587992861082757785799222
----------------------------------------------------------


Mike Flannigan

unread,
Sep 19, 2012, 9:32:58 AM9/19/12
to beginn...@perl.org, chrisst...@gmail.com

These are some materials I use:
http://cpan.uwinnipeg.ca/htdocs/CGI.pm/CGI.html
http://www.cookwood.com/perl/examples/overview.html

I'm not sure those are the best sources for getting
up and running. If not, I can help you with that
too. First thing I would do is install Perl. Either
ActiveState, or Strawberry Perl. I use ActiveState.
I think CGI comes automatically, but if not install
that too with 'ppm'. Get back to me if you need
help with that.


Mike


On 9/18/2012 8:34 AM, beginners-cg...@perl.org wrote:
> Subject:
> cgi development environment
> From:
> Chris Stinemetz <chrisst...@gmail.com>
> Date:
> 9/18/2012 8:34 AM
>
> To:

David Dorward

unread,
Sep 19, 2012, 6:38:32 AM9/19/12
to beginn...@perl.org
On 18 Sep 2012, at 13:34, Chris Stinemetz <chrisst...@gmail.com> wrote:
> I am very interested in cgi scripting. I have only used php for web
> development in the past.

CGI or Perl? For a long time CGI with Perl was a popular combination so there are a lot of documents which conflate the two.

It is possible to do CGI programming in PHP (which you already know), but PSGI[1] is the flavour du jour for server side web programming with Perl.

CGI is still a plausible option though. It has the benefit of simplicity (but isn't the most efficient option).

[1] http://plackperl.org/


--
David Dorward
http://dorward.me.uk

Chris Stinemetz

unread,
Sep 19, 2012, 10:48:16 PM9/19/12
to David Dorward, beginn...@perl.org
I have my Perl cgi development environment all set-up. I actually
wound up setting up an instance through Amazon AWS.
Very cool service by Amazon.

I am having issues with my first script and have hopes someone may be
able to explain to me whey it isn't working correctly.

The error is coming form line 11 and the error is:

Premature end of script headers: test2.cgi
Bareword "left" not allowed while "strict subs" in use at
/usr/lib/cgi-bin/test2.cgi line 7.
Execution of /usr/lib/cgi-bin/test2.cgi aborted due to compilation errors.
Premature end of script headers: test2.cgi


1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use CGI;
5
6 my $q = CGI->new;
7 print $q->header(-type=>'text/html'),
8 $q->start_html('hello world'), # start the HTML
9 $q->h1({-align=>right},'hello world'), # level 1 header
10 $q->h1({-align=>left});
11 $q->h1('some','contents');
12 $q->end_html; # end the HTML

Thank you in advance,

-Chris

Mike Williams

unread,
Sep 19, 2012, 11:44:53 PM9/19/12
to beginn...@perl.org
On Wed, Sep 19, 2012 at 10:48 PM, Chris Stinemetz
<chrisst...@gmail.com>wrote:


> am having issues with my first script and have hopes someone may be
> able to explain to me whey it isn't working correctly.
>
> The error is coming form line 11 and the error is:
>
> Premature end of script headers: test2.cgi
> Bareword "left" not allowed while "strict subs" in use at
>

The error message is a major clue. Try quotes around "left"


> /usr/lib/cgi-bin/test2.cgi line 7.
> Execution of /usr/lib/cgi-bin/test2.cgi aborted due to compilation errors.
> Premature end of script headers: test2.cgi
>
>
> 1 #!/usr/bin/perl
> 2 use warnings;
> 3 use strict;
> 4 use CGI;
> 5
> 6 my $q = CGI->new;
> 7 print $q->header(-type=>'text/html'),
> 8 $q->start_html('hello world'), # start the HTML
> 9 $q->h1({-align=>right},'hello world'), # level 1 header
> 10 $q->h1({-align=>left});
> 11 $q->h1('some','contents');
> 12 $q->end_html; # end the HTML
>
>
You have a couple other issues. Since you have one print statement, spread
over multiple lines, the semi-colons on lines 10 and 11 are bugs. They
should be commas. The semi-colons terminate the statement resulting in
syntax errors.

Mike

Chris Stinemetz

unread,
Sep 19, 2012, 11:54:21 PM9/19/12
to Mike Williams, beginn...@perl.org
>>
> You have a couple other issues. Since you have one print statement, spread
> over multiple lines, the semi-colons on lines 10 and 11 are bugs. They
> should be commas. The semi-colons terminate the statement resulting in
> syntax errors.
>
> Mike

Thank you. That fixed it.

-Chris

Shaun Fryer

unread,
Sep 20, 2012, 12:49:17 AM9/20/12
to Chris Stinemetz, Mike Williams, beginn...@perl.org
Also check out http://search.cpan.org/~lds/CGI.pm-3.08/CGI/Carp.pm
--
Shaun Fryer
----------------------------------------------------------
perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
52959394107588899482799210587992861082757785799222
----------------------------------------------------------


0 new messages