CGI-Portable
view release on metacpan or search on metacpan
demos/animals/DemoPanda.pm view on Meta::CPAN
sub main {
my ($class, $globals) = @_;
$globals->set_page_body( <<__endquote );
<P>Food: @{[$globals->pref( 'food' )]}
<BR>Color: @{[$globals->pref( 'color' )]}
<BR>Size: @{[$globals->pref( 'size' )]}</P>
<P>Now let's look at some files; take your pick:
__endquote
$globals->navigate_url_path( $globals->pref( 'file_reader' ) );
foreach my $frag (@{$globals->pref( 'files' )}) {
my $url = $globals->url_as_string( $frag );
$globals->append_page_body( "<BR><A HREF=\"$url\">$frag</A>" );
}
$globals->append_page_body( "</P>" );
}
1;
lib/CGI/Portable.pm view on Meta::CPAN
sub main {
my ($class, $globals) = @_;
$globals->set_page_body( <<__endquote );
<p>Food: @{[$globals->pref( 'food' )]}
<br />Color: @{[$globals->pref( 'color' )]}
<br />Size: @{[$globals->pref( 'size' )]}</p>
<p>Now let's look at some files; take your pick:
__endquote
$globals->navigate_url_path( $globals->pref( 'file_reader' ) );
foreach my $frag (@{$globals->pref( 'files' )}) {
my $url = $globals->url_as_string( $frag );
$globals->append_page_body( "<br /><a href=\"$url\">$frag</a>" );
}
$globals->append_page_body( "</p>" );
}
1;
=head1 DESCRIPTION
The CGI::Portable class is a framework intended to support complex web
applications that are easily portable across servers because common
lib/CGI/Portable.pm view on Meta::CPAN
=head2 physical_filename( CHANGE_VECTOR[, WANT_TRAILER] )
This method uses CHANGE_VECTOR to derive a new path in the real file-system
relative to the current one and returns it as a string. If WANT_TRAILER is true
then the string has a path delimiter appended; otherwise, there is none.
=head2 add_virtual_filename_error( UNIQUE_PART, FILENAME[, REASON] )
This message constructs a new error message using its arguments and appends it to
the error list. You can call this after doing a file operation that failed where
UNIQUE_PART is a sentence fragment like "open" or "read from" and FILENAME is the
relative portion of the file name. The new message looks like
"can't [UNIQUE_PART] file '[FILEPATH]': $!" where FILEPATH is defined as the
return value of "virtual_filename( FILENAME )". If the optional argument REASON
is defined then its value is used in place of $!, so you can use this method for
errors relating to a file where $! wouldn't have an appropriate value.
=head2 add_physical_filename_error( UNIQUE_PART, FILENAME[, REASON] )
This message constructs a new error message using its arguments and appends it to
the error list. You can call this after doing a file operation that failed where
UNIQUE_PART is a sentence fragment like "open" or "read from" and FILENAME is the
relative portion of the file name. The new message looks like
"can't [UNIQUE_PART] file '[FILEPATH]': $!" where FILEPATH is defined as the
return value of "physical_filename( FILENAME )". If the optional argument REASON
is defined then its value is used in place of $!, so you can use this method for
errors relating to a file where $! wouldn't have an appropriate value.
=cut
######################################################################
lib/DemoUsage.pm view on Meta::CPAN
if( $ref_filename =~ m|$ident|i ) {
push( @ref_norm, $t_rfo );
push( @ref_sear, $t_rfo );
push( @ref_keyw, $t_rfo );
push( @ref_disc, $referer );
last SWITCH;
}
}
# else check if the referring domain is a search engine
foreach my $dom_frag (keys %{$rh_engines}) {
if( ".$domain." =~ m|[/\.]$dom_frag\.|i ) { # CHANGED THIS LINE 0-43
my $se_query = CGI::MultiValuedHash->new( 1, $query );
my @se_keywords;
my $kwpn = $rh_engines->{$dom_frag};
my @kwpn = ref($kwpn) eq 'ARRAY' ? @{$kwpn} : $kwpn;
foreach my $query_param (@kwpn) {
push( @se_keywords, split( /\s+/,
$se_query->fetch_value( $query_param ) ) );
}
foreach my $kw (@se_keywords) {
$kw =~ s/^[^a-zA-Z0-9]+//; # remove framing junk
$kw =~ s/[^a-zA-Z0-9]+$//;
$kw = lc( $kw ); # ADDED THIS LINE 0-43
( run in 2.342 seconds using v1.01-cache-2.11-cpan-364913b4093 )