Is my understating correct for use "CGI qw(:standard)" vs. "use CGI"?
I'm using the function "redirect('http://www.example.com')" in my script. When I use "use CGI" instead of "use CGI qw(:standard);" I get the following error:
Software error:
Undefined subroutine &main::redirect called at upload.pl line 109, <fh
+00001C%3A\Program Files\Java\j2re1.4.2_06\javaws\javalogo52x88.gif> l
+ine 20.
For help, please send mail to the webmaster (webmaster@example.com), g
+iving this error message and the time and date of the error.
When I use use "use CGI qw(:standard);" the function works.
My understanding is that "use CGI" is for Object Oriented programming. And "use CGI qw(:standard);" is for Function Oriented programming.
Using "use CGI" I'd have to do:
use CGI;
my $q = new CGI;
$q->redirect('http://www.example.com')
Using "use CGI qw(:standard);
" I'm importing the
function for Function Oriented programming.
use CGI qw(:standard);
redirect('http://www.example.com');
Is my understating correct for use "CGI qw(:standard)" vs. "use CGI"?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.