Re: how to create a submit button in perl?

2003-06-07 Thread Luinrandir Hernsen

the submit button is part of the  form command in HTML.
I use perl to:
print qq||;

if thats what you are looking for check out your HTML commands for 

Luinrandir


- Original Message - 
From: "Scot Robnett" <[EMAIL PROTECTED]>
To: "Annie" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 5:09 PM
Subject: RE: how to create a submit button in perl?


> 
> perldoc CGI
> 
> 
> 
> 
> -Original Message-
> From: Annie [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 06, 2003 3:57 PM
> To: [EMAIL PROTECTED]
> Subject: how to create a submit button in perl?
> 
> 
> hi i need to create a submit button on one of my web page and i need the
> code to create that in perl?
> can anyone help me!!
> 
> 
> -
> Do you Yahoo!?
> Free online calendar with sync to Outlook(TM).
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



br

2003-06-07 Thread Rob Richardson
Greetings!

I am attempting to use objects to organize a program somewheat
intelligently.  I am running into a problem using the CGI method "br".

My main routine has the following use statements:

use CGI::Carp qw(fatalsToBrowser);
use CGI qw/:standard center *big delete_all/;

It begins writing HTML with the following code:

print 
header(-type=>'text/html',-expires=>'-1d'),
start_html(-title=>'Volunteer Scheduling System',-vlink=>'blue'),
center(p(img({-src=>'cvsr.gif'}),br,strong("Welcome to the Volunteer
Scheduling System $usrvals[1] $usrvals[3]."),br,


There is no problem with this statement.  Note that the CGI method "br"
was used twice.  (At least I think that's what "br" is here.)


In a new module that I wrote, I have the following use statement:

use CGI qw/:standard center *big delete_all *br/;

This module defines an object that knows how to build an HTML string. 
It has a GetHTML() method that returns a string, and it's the
responsibility of the calling routine to send that string to standard
output to build the web page.  The GetHTML() routine uses the following
code to build a string:

$htmlString = p
  (
center
(
  strong
  (
"Train(s) and positions for the day you have selected."
  ) . 
  br . 
  "Click the position you would like to volunteer for." . 
  br . 
  "Positions that are already taken cannot be clicked." . 
  br . 
  "Use the date dropdowns above to change to a different day."
)
  ) . 
  br . 
  "";

In this instance, Perl is complaining that the bareword "br" is not
allowed when "strict subs" is in use.  I don't understand why it's not
allowed here but it is allowed in the other module.  Can somebody
please explain this?

Thanks very much!

RobR


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: br

2003-06-07 Thread Kristofer Hoch
Rob,
  Great going, you are adding the 'use strict;' pragma
to your code.! Bravo.  Now, here is the deal.  Tell
Perl that 'br' is a function by doing either '&br' or
'br();'.  That should do the trick.  You'll notice
that all of your other functions have parenthesis. 
That is why you are not getting the bareword warning
on them.

Kristofer
--- Rob Richardson <[EMAIL PROTECTED]> wrote:
> Greetings!
> 
> I am attempting to use objects to organize a program
> somewheat
> intelligently.  I am running into a problem using
> the CGI method "br".
> 
> My main routine has the following use statements:
> 
> use CGI::Carp qw(fatalsToBrowser);
> use CGI qw/:standard center *big delete_all/;
> 
> It begins writing HTML with the following code:
> 
> print 
>   header(-type=>'text/html',-expires=>'-1d'),
>   start_html(-title=>'Volunteer Scheduling
> System',-vlink=>'blue'),
>   center(p(img({-src=>'cvsr.gif'}),br,strong("Welcome
> to the Volunteer
> Scheduling System $usrvals[1] $usrvals[3]."),br,
> 
> 
> There is no problem with this statement.  Note that
> the CGI method "br"
> was used twice.  (At least I think that's what "br"
> is here.)
> 
> 
> In a new module that I wrote, I have the following
> use statement:
> 
> use CGI qw/:standard center *big delete_all *br/;
> 
> This module defines an object that knows how to
> build an HTML string. 
> It has a GetHTML() method that returns a string, and
> it's the
> responsibility of the calling routine to send that
> string to standard
> output to build the web page.  The GetHTML() routine
> uses the following
> code to build a string:
> 
> $htmlString = p
> (
>   center
>   (
> strong
> (
>   "Train(s) and positions for the day you have
> selected."
>   ) . 
> br . 
> "Click the position you would like to volunteer
> for." . 
> br . 
> "Positions that are already taken cannot be
> clicked." . 
> br . 
> "Use the date dropdowns above to change to a
> different day."
>   )
> ) . 
> br . 
> "";
> 
> In this instance, Perl is complaining that the
> bareword "br" is not
> allowed when "strict subs" is in use.  I don't
> understand why it's not
> allowed here but it is allowed in the other module. 
> Can somebody
> please explain this?
> 
> Thanks very much!
> 
> RobR
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


=
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d s+:++ a C++ UL++ US+ P+++ L++ 
W+++ w PS PE t++ b+ G e r+++ z
--END GEEK CODE BLOCK--

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: br -- problem caused by "Package"?

2003-06-07 Thread Dave K
Rob,
>
> I tried another program to illustrate the "br" problem.  Here is the
> entire program:
>
Not really - the packages  ScheduleDay and Train are missing
> #!/usr/bin/perl
>
> use warnings;
> use strict;
> use CGI qw/:standard center *big delete_all/;
>
> use ScheduleDay;
> use Train;
>
> package Brtest;

Try instead:
my $testString = CGI::br;

HTH



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: br -- problem caused by "Package"?

2003-06-07 Thread Rob Richardson
Kristofer and everybody else,

"br" is successfully used without parentheses in the first snippet I
posted.  I don't believe that parentheses are required for subroutine
calls that don't have arguments, although I suppose I should use them
since I'm mainly a C++ programmer and so I should be as consistent as
possible between the two languages.

I tried another program to illustrate the "br" problem.  Here is the
entire program:

#!/usr/bin/perl

use warnings;
use strict;
use CGI qw/:standard center *big delete_all/;

use ScheduleDay;
use Train;

package Brtest;

my $testString = br;


When I compile this, I get the following error:

Bareword "br" not allowed while "strict subs" in use at brtest.pm line
12.

When I comment the "package Brtest;" line, I don't get the error.

What is happening?

Thanks again!

Rob

P.S.  I am cross-posting this to the [EMAIL PROTECTED] list because
this is looking as though it's not a CGI issue.

P.P.S. to any list administrator who may read this:  Whenever I click
"Reply", the original sender is automatically put into my "To:" box,
but "[EMAIL PROTECTED]" is not.  The same is true for the
"[EMAIL PROTECTED]" list.  Can that be changed?


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: br -- problem caused by "Package"? -- my bad

2003-06-07 Thread Rob Richardson
Greetings again!

I could of course be wrong...

I just found that I had "use warnings" and "use strict" commented out
in the module that compiled!

Excuse me for a while while I track down a hundred or so violations
that uncommenting them uncovered.

RobR

--- Rob Richardson <[EMAIL PROTECTED]> wrote:
> Kristofer and everybody else,
> 
> "br" is successfully used without parentheses in the first snippet I
> posted.  I don't believe that parentheses are required for subroutine
> calls that don't have arguments, although I suppose I should use them
> since I'm mainly a C++ programmer and so I should be as consistent as
> possible between the two languages.


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



More subroutine confusion

2003-06-07 Thread Rob Richardson
Dave,

Your response dovetails nicely with my next question.  The module I'm
working in begins as follows:

use warnings;
use strict;
use CGI qw/:standard center strong *big delete_all/;

After putting parentheses after my calls to "br", the program compiled
and started running.  It barfed, though, at the following line:

$htmlString = p(center(strong("There are not any trains running on this
day.Use the date dropdowns above to select a different day.")));

It complained that $Schedule::strong was undefined.  As you
illustrated, changing "strong" to "CGI::strong" fixed that problem, and
it proceeded to complain about "$Schedule::center" being undefined.  

I had thought that the "use CGI" line would tell Perl enough about
those functions that I wouldn't have to qualify them.  What do I have
to do to avoid putting the package name before every subroutine that
doesn't come from the package I'm developing?  For a complicated
program, I would imagine qualifying every subroutine call would get
very cumbersome!

Thanks once again!

RobR

P.S.  In the little test program, if I leave the semicolon off the last
line, it compiles.  If I put it on, it complains about the "br"
bareword.  I'm using IndigoPerl.

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More subroutine confusion

2003-06-07 Thread Dave K
Rob,
> Your response dovetails nicely with my next question.  The module I'm
> working in begins as follows:
>
> use warnings;
> use strict;
> use CGI qw/:standard center strong *big delete_all/;

Because the code you have included does not specifically say so I have to
guess that:

package NotShown;

follows somewhere below. I cannot begin to guess the structure you have
choosen for your application - but one (very possibly bone headed) though
comes to mind.
If the NotShown package writes html and you want to do so in the CGI style
inside a function I might be tempted to:

sub writeHTML {
useCGI qw/:standard center strong *big delete_all/;
...
}
(I think I hear a noise off in the distance. It seems to be the sound of
several module authors gathering stones. Please don't hurt me - I'm only a
beginner)
> I had thought that the "use CGI" line would tell Perl enough about
> those functions that I wouldn't have to qualify them.  What do I have
> to do to avoid putting the package name before every subroutine that
> doesn't come from the package I'm developing?  For a complicated
> program, I would imagine qualifying every subroutine call would get
> very cumbersome!

I think the issue has to do with where you use the
package
assertion and where you
use CGI;

Visit the perl/site/lib directory of your install. Open any number of .pm
files and note the package assertion happens at the top of the file so that
use d and require d files are in the package namespace.

There is a bird chirping in my head. He is telling me a wheel may be being
reinvented. There is nothing wrong with that but every time he sings I
discover a module that does all I want (and usually more). I have an urge to
suggest HTML/Mason (but I'm not really sure why)
HTH



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: br -- problem caused by "Package"?

2003-06-07 Thread Charles K. Clarkson
Rob Richardson <[EMAIL PROTECTED]> wrote:
: 
: Here is the entire program:
: 
: #!/usr/bin/perl
: 
: use warnings;
: use strict;
: use CGI qw/:standard center *big delete_all/;

All the above functions from CGI.pm are imported
to 'main'. They are available as, for example,
'main::br' which can be written as 'br' or 'br()'.

: use ScheduleDay;
: use Train;
: 
: package Brtest;

We have left package main and are now in package
'Brtest'.

: my $testString = br;

There is no subroutine defined as 'br' which is
shorthand for 'Brtest::br'. So 'br' must be a bareword
which is not allowed under strict.


HTH,

Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]