Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: string initialization error (cgi101)

by Anonymous Monk
on Dec 21, 2018 at 23:16 UTC ( #1227586=note: print w/replies, xml ) Need Help??


in reply to Re^2: string initialization error
in thread string initialization error

Almost, you pass arguments to subroutines, not work on globals. see cgi101/Re: Object Identifier? (red flags, more subs)
#!/usr/bin/perl -- use strict; use warnings; use CGI; Main( @ARGV ); exit( 0 ); sub Main { my $q = CGI->new; my( $headers, $body ) = loadPage( $q ); print $headers, $body; } sub loadPage { my( $query ) = @_; if( authenticate( $q ) ){ my $page = $q->page || 'default'; return ThisPage( $pms, $q ) if $page eq 'thisone'; return ThatPage( $pms, $q ) if $page eq 'thatone'; return DefaultPage( $pms, $q ); } else { return UnauthorizedPage( $pqms, $q ); } }
...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227586]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2022-07-05 19:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?