Main > Free Download Search >

Free env software for linux

env

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 96
Env::C 0.06

Env::C 0.06


Env::C is a Get/Set/Unset Environment Variables on the C level. more>>
Env::C is a Get/Set/Unset Environment Variables on the C level.

SYNOPSIS

use Env::C;

my $key = "USER";
$val = Env::C::getenv($key) || ;

Env::C::setenv($key, "foobar", [$override]);
$new_val = Env::C::getenv($key) || ;

Env::C::unsetenv($key);

my $ar_env = Env::C::getallenv();
print join "n", @$ar_env;

This module provides a Perl API for getenv(3), setenv(3) and unsetenv(3). It also can return all the environ variables.

Sometimes Perl invokes modules with underlaying C APIs which rely on certain environment variables to be set, if these variables are set in Perl and the glue code doesnt worry to set them on the C level, these variables might not be seen by the C level. This module shows what really the C level sees.

<<less
Download (0.009MB)
Added: 2006-07-05 License: Perl Artistic License Price:
1206 downloads
Env::Bash 0.04

Env::Bash 0.04


Env::Bash is a Perl extension for accessing _all_ bash environment variables. more>>
Env::Bash is a Perl extension for accessing _all_ bash environment variables.

SYNOPSIS

use Env::Bash;

Standard interface:

my @var = get_env_var( "SORCERER_MIRRORS",
Source => "/etc/sorcery/config", );
print "SORCERER_MIRRORS via get_env_var:n",
join( "n", @var ), "ncount = ", scalar @var, "n";

@var = Env::Bash::SORCERER_MIRRORS
( Source => "/etc/sorcery/config", );
print "SORCERER_MIRRORS via name:n",
join( "n", @var ), "ncount = ", scalar @var, "n";

my @keys = get_env_keys( Source => "/etc/sorcery/config",
SourceOnly => 1, );
print "first 10 keys:n", map { " $_n" } @keys[0..9];
Object oriented interface:
my $be = Env::Bash->new( Source => "/etc/sorcery/config",
Keys => 1, );
my @var = $be->get( "SORCERER_MIRRORS" );
print "SORCERER_MIRRORS via get:n",
join( "n", @var ), "ncount = ", scalar @var, "n";

@var = $be->SORCERER_MIRRORS;
print "SORCERER_MIRRORS via name:n",
join( "n", @var ), "ncount = ", scalar @var, "n";

$be = Env::Bash->new( Keys => 1,);
@var = $be->HOSTTYPE;
print "HOSTTYPE via name:n",
join( "n", @var ), "ncount = ", scalar @var, "n";

if( $be->exists( BASH_VERSINFO ) ) {
print "BASH_VERSINFO =>n ",
join( "n ", $be->BASH_VERSINFO ), "n";
}

my %options = $be->options( [], Keys => 1 );
Tie HASH interface:
my %env = ();
tie %env, "Env::Bash", Source => "/etc/sorcery/config", ForceArray => 1;

my $var = $env{SORCERER_MIRRORS};
print "SORCERER_MIRRORS via tied hash:n",
join( "n", @$var ), "ncount = ", scalar @$var, "n";

$var = $env{HOSTTYPE};
print "HOSTTYPE via tied hash:n",
join( "n", @$var ), "ncount = ", scalar @$var, "n";

while( my( $key, $value ) = each %env ) {
print "$key =>n ", join( "n ", @$value ), "n";
}

<<less
Download (0.014MB)
Added: 2007-04-13 License: Perl Artistic License Price:
926 downloads
Env::Path 0.18

Env::Path 0.18


Env::Path is a Perl module with advanced operations on path variables. more>>
Env::Path is a Perl module with advanced operations on path variables.

SYNOPSIS

use Env::Path;

# basic usage
my $manpath = Env::Path->MANPATH;
$manpath->Append(/opt/samba/man);
for ($manpath->List) { print $_, "n" };

# similar to above using the "implicit object" shorthand
Env::Path->MANPATH;
MANPATH->Append(/opt/samba/man);
for (MANPATH->List) { print $_, "n" };

# one-shot use
Env::Path->PATH->Append(/usr/sbin);

# change instances of /usr/local/bin to an architecture-specific dir
Env::Path->PATH->Replace(/usr/local/bin, "/usr/local/$ENV{PLATFORM}/bin");

# more complex use (different names for same semantics)
my $libpath;
if ($^O =~ /aix/) {
$libpath = Env::Path->LIBPATH;
} else {
$libpath = Env::Path->LD_LIBRARY_PATH;
}
$libpath->Assign(qw(/usr/lib /usr/openwin/lib));
$libpath->Prepend(/usr/ucblib) unless $libpath->Contains(/usr/ucblib);
$libpath->InsertAfter(/usr/ucblib, /xx/yy/zz);
$libpath->Uniqify;
$libpath->DeleteNonexistent;
$libpath->Remove(/usr/local/lib);
print $libpath->Name, ":";
for ($libpath->List) { print " $_" };
print "n";

# simplest usage: bless all existing EVs as Env::Path objects
use Env::Path :all;
my @cats = PATH->Whence(cat*);
print "@catsn";

<<less
Download (0.010MB)
Added: 2007-04-14 License: Perl Artistic License Price:
924 downloads
pam_envfeed 0.4

pam_envfeed 0.4


pam_envfeed is a PAM module that runs an external program, grabs its output, and then defines the environment variables. more>>
pam_envfeed is a PAM module that runs an external program, grabs its output, and then defines the environment variables this program has emitted.

pam_envfeed is especially useful for dynamically setting up a PATH that depends on many circumstances (such as whether the user is root, or whether a directory exists or not).

The module can be used as an auth, account or session module. I guess session is the best place to set environment variables, but YMMV. To do so, put a line like this into /etc/pam.d/system-auth or whatever files are relevant:

session required /lib/security/pam_envfeed.so

When the pam_envfeed module is invoked to set the credentials, do the account management or open the session, it launches the external program /sbin/pam_envfeed by default, however, a different program can be chosen
with an argument to the module.

The program can be a binary as well as a script. Dont forget the execute perms, and the #! line if its a script.

The program has its standard input and standard error connected to /dev/null, the standard output is a pipe connected to the parent process, and no other file descriptors are open.

The program receives four kinds of environment variables:

PAM_*
PAM_RHOST, PAM_RUSER, PAM_SERVICE, PAM_TTY and PAM_USER are defined
to their equivalent in the PAM system. Only those for whom
pam_get_item() successfully returned a non-NULL value are actually
set, so some of these might be unset.

USERINFO_*
Since I found it quite difficult to get the home directory of the
user whose name is contained in a shell variable in bash, I added
password entry lookup into pam_envfeed. If getpwnam() is successful
then data provided by this call is put into USERINFO_UID,
USERINFO_GID, USERINFO_GECOS, USERINFO_HOME and USERINFO_SHELL.
Furthermore the group id is also looked up and the group name is
stored in USERINFO_GROUP if getgrgid() is successful. The users
login name is not duplicated in these variables, use PAM_USER
instead. This whole userinfo lookup can be disabled with the
nouserinfo option, just in case you have troubles with getent/nss
stuff or just dont want pam to use them here.

ENV_*
For all the real environment variables that the pamming process has,
a counterpart with an ENV_ prefix is defined. E.g. if your
authenticating applications has LC_ALL=hu_HU then youll have
ENV_LC_ALL=hu_HU defined.

PAMENV_*
For all the pam environment variables that the pamming process has,
a counterpart with a PAMENV_ prefix is defined. E.g. if pam_env.so
has previously set DISPLAY=kenny:0.0 then youll have
PAMENV_DISPLAY=kenny:0.0 defined.

Example:

This is a very simple example script. It only sets PATH and MAIL to probably their most standard values on Linux systems.

#!/bin/bash

p="$USERINFO_HOME/bin"
if [ "$USERINFO_UID" = "0" ]; then
p="$p:/usr/local/sbin:/sbin:/usr/sbin"
fi
p="$p:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin"
echo -n PATH="$p"
echo -ne 00
echo -n MAIL="/var/mail/$PAM_USER"

See the example subdirectory for a more complex example.

<<less
Download (0.017MB)
Added: 2006-05-16 License: GPL (GNU General Public License) Price:
1256 downloads
Time::Zone 1.16

Time::Zone 1.16


Time::Zone is a miscellaneous timezone manipulations routines. more>>
Time::Zone is a miscellaneous timezone manipulations routines.

SYNOPSIS

use Time::Zone;
print tz2zone();
print tz2zone($ENV{TZ});
print tz2zone($ENV{TZ}, time());
print tz2zone($ENV{TZ}, undef, $isdst);
$offset = tz_local_offset();
$offset = tz_offset($TZ);

This is a collection of miscellaneous timezone manipulation routines.
tz2zone() parses the TZ environment variable and returns a timezone string suitable for inclusion in date-like output. It opionally takes a timezone string, a time, and a is-dst flag.

tz_local_offset() determins the offset from GMT time in seconds. It only does the calculation once.

tz_offset() determines the offset from GMT in seconds of a specified timezone.
tz_name() determines the name of the timezone based on its offset

<<less
Download (0.022MB)
Added: 2006-06-29 License: Perl Artistic License Price:
1214 downloads
CGI::Enurl 1.07

CGI::Enurl 1.07


CGI::Enurl.pm is a Perl module for URL-encoding strings and hashes. more>>
CGI::Enurl.pm is a Perl module for URL-encoding strings and hashes.

SYNOPSIS

use CGI::Enurl;
%hash = (name=>Jenda Krynicky,address=>Nerudova 1016);
print "Location: http://$ENV{SERVER_NAME}/cgi-bin/do.pl?",enurl %hash,"nn";

This is a little module made for CGI scripting. It encodes the parameters to be passed to a CGI. It does nothing more, so its much smaller and loads more quickly.

Functions

enurl STRING
enurl ARRAY
enurl HASH

Encodes the parameter. If the parameter is a single string it encodes it and returns the encoded form.

If it is an array or a reference to an array it encodes all items and returns them joined by &.

If it is a hash it encodes the values and return a querystring in form "key2=encoded_value1&key2=encoded_value2&...".

!!! Please note that a hash in a list context returns a list of all keys and values. This means that if you call enurl(%hash) you will NOT get what you may thing you should. You HAVE to use enurl(%hash) !!!

enURL STRING

Encodes the parameter, this version doesnt encode = and & characters, so you should make sure they are not present in the data.

Notice the difference :

enurl a&b=f o o => a%26b%3Df+o+o
enURL a&b=f o o => a&b=f+o+o

$CGI::Enurl::ParamSeparator

You may specify another character to be used as the parameter separator. Simply set this variable to the character (or string) you want to use.
The default value is &

$CGI::Enurl::KeepUnencoded

This variable contains the characters that should stay unencoded. Please keep in mind that the string will be interpolated into a regexp in a [^...] group!

Any change of this variable will be ignored after the first call to enurl or enURL. (Im using /o switch in the regexp.) So if you want to change the variable you should do it as soon as posible. You may do that even before you "use" the module!

The default value is a-zA-Z 0-9_-@.=

<<less
Download (0.004MB)
Added: 2007-07-19 License: Perl Artistic License Price:
828 downloads
mod_tee

mod_tee


mod_tee serves to clone an document as it is served. more>>
mod_tee serves to "clone" an document as it is served. mod_tee was hacked up as a quick-and-dirty fix when a Site Valet user complained of problems saving a Valet report: mod_tee now serves to enable registered users to request email copies of any report generated.

The current status is "works for us", but it is not of release quality. It is less-than-complete in several respects. Its probably not a good idea to use it operationally unless youre prepared to get your hands dirty fixing any problems, or pay for support.

Configuration

TeeType FILE|PIPE|SMTP [Destination]
Where to send the cloned output:

FILE - save to a destination file. For testing only!
PIPE - pipes output to a destination program with popen.
SMTP - sends cloned output directly to email at a destination mailserver. Implements SMTP handshake with no error checking - so its a dangerous option!

TeeCondition query|cookie|path|header|env|true|false [key] [val]

Defines a condition for mod_tee to be activated for a request. Values true and false are unconditional, while the others define a QUERY_STRING key, a Cookie, a PATH_INFO component, a request header or an environment variable to trigger the tee. Conditional values require a key. If val is defined then key must match it; otherwise any value of key will activate the tee.

TeeHeader key value

Defines an RFC822-style header to be inserted in front of the body of the page.

<<less
Download (0.012MB)
Added: 2006-04-20 License: GPL (GNU General Public License) Price:
1285 downloads
NNML::Server 1.14

NNML::Server 1.14


NNML::Server is a minimal NNTP server. more>>
NNML::Server is a minimal NNTP server.

SYNOPSIS

perl -MNNML::Server -e server
perl -MNNML::Server -e unspool

NNML::Server server implements a minimal NNTP server. It is (hope-) fully conformant to rfc977. In addition the commands XOVER and AUTHINFO are implemented.

Supported commands:

ARTICLE, AUTHINFO, BODY, GROUP, HEAD, HELP, IHAVE, LAST, LIST,
MODE, NEWGROUPS, NEWNEWS, NEXT, POST, QUIT, SLAVE, STAT

XOVER, XHDR, LIST NEWSGROUPS ng-spec

The main reason for writing this was to synchronize my mail directories across different hosts. The Mail directories are MH-Style with a .overview file in each folder and an active file in the base directory. These are maintained by the Emacs Gnus backend NNML. To get started, you can generate/update this files using the overview program. Upon POST and IHAVE commands this files will also be updated.

To start from scratch use:

touch /tmp/active;
perl -MNNML::Server -e server(base => "/tmp", port => 3000)

To export your mh-Mail use:

perl overview -base ~/Mail
perl -MNNML::Server -e server(base => "$ENV{HOME}/Mail", port => 3000)

The command POST and IHAVE honour the Newsgroups header if not overwritten by the X-Nnml-Groups header. Articles will contain an appropriate X-Nnml-Groups header when retrieved by message-id.

When the client submits the SLAVE command, all forther post requests are spooled in $Config-spool> (usually ~/Mail/NNML.spool) for performance reasons. You can process the spooled articles by submitting the XUNSPOOL command or by calling

perl -MNNML::Server -e unspool

Rejected articles will be saven in $Config-bad> (usually ~/Mail/NNML.bad)

<<less
Download (0.023MB)
Added: 2007-04-19 License: Perl Artistic License Price:
919 downloads
Devel::ptkdb 1.1091

Devel::ptkdb 1.1091


Devel::ptkdb is a Perl debugger using a Tk GUI. more>>
Devel::ptkdb is a Perl debugger using a Tk GUI.
ptkdb is a debugger for perl that uses perlTk for a user interface.
Main features:
- Hot Variable Inspection
- Breakpoint Control Panel
- Expression List
- Subroutine Tree
SYNOPSIS
To debug a script using ptkdb invoke perl like this:
perl -d:ptkdb myscript.pl
Usage
perl -d:ptkdb myscript.pl
Code Pane
Line Numbers
Line numbers are presented on the left side of the window.
Lines thathave lines through them are not breakable. Lines that are plain text are breakable. Clicking on these line numbers will insert a breakpoint on that line and change the line number color to $ENV{PTKDB_BRKPT_COLOR} (Defaults to Red). Clicking on the number again will remove the breakpoint. If you disable the breakpoint with the controls on the BrkPt notebook page the color will change to $ENV{PTKDB_DISABLEDBRKPT_COLOR}(Defaults to Green).
Cursor Motion
If you place the cursor over a variable (i.e. $myVar, @myVar, or %myVar) and pause for a second the debugger will evaluate the current value of the variable and pop a balloon up with the evaluated result. This feature is not available with Tk400.
If Data::Dumper(standard with perl5.00502)is available it will be used to format the result. If there is an active selection, the text of that selection will be evaluated.
<<less
Download (0.038MB)
Added: 2007-08-10 License: Perl Artistic License Price:
807 downloads
Devel::tcltkdb 0.81

Devel::tcltkdb 0.81


Devel::tcltkdb is a Perl debugger using a Tk GUI. more>>
Devel::tcltkdb is a Perl debugger using a Tk GUI.
tcltkdb is a debugger for perl that uses perl+Tcl/Tk for a user interface.
Main features:
- Hot Variable Inspection
- Breakpoint Control Panel
- Expression List
- Subroutine Tree
SYNOPSIS
To debug a script using tcltkdb invoke perl like this:
perl -d:tcltkdb myscript.pl
Usage
perl -d:tcltkdb myscript.pl
Code Pane
Line Numbers
Line numbers are presented on the left side of the window. Lines that
have lines through them are not breakable. Lines that are plain text
are breakable. Clicking on these line numbers will insert a
breakpoint on that line and change the line number color to
$ENV{PTKDB_BRKPT_COLOR} (Defaults to Red). Clicking on the number
again will remove the breakpoint. If you disable the breakpoint with
the controls on the BrkPt notebook page the color will change to
$ENV{PTKDB_DISABLEDBRKPT_COLOR}(Defaults to Green).
Cursor Motion
If you place the cursor over a variable (i.e. $myVar, @myVar, or %myVar) and pause for a second the debugger will evaluate the current value of the variable and pop a balloon up with the evaluated result. This feature is not available with Tk400.
If Data::Dumper(standard with perl5.00502)is available it will be used to format the result. If there is an active selection, the text of that selection will be evaluated.
<<less
Download (0.31MB)
Added: 2007-08-10 License: Perl Artistic License Price:
808 downloads
HTML::EP

HTML::EP


HTML::EP is a system for embedding Perl into HTML. more>>
HTML::EP is a system for embedding Perl into HTML.
SYNOPSIS
< html >< head >< title >CGI-Env< /title >< /head >
< ep-comment >
This is an HTML document. You see. Perhaps you wonder about
the unknown HTML tags like ep-comment above? They are part
of the EP system. For example, this comment section will
be removed and you wont see it in your browser.
< /ep-comment >
< ep-perl >
# This is an example of embedding Perl into the page.
# We create a variable called time, containing the current
# time. This variable will be used below.
my $self = $_;
$self->{time} = localtime(time());
; # Return an empty string; result becomes embedded into the
# HTML page
< /ep-perl >
< body >< h1 >The current time< /h1 >
Your HTML::EP system is up and running: The current time is $time$.
< /body >
< /html >
NEWS
HTML::EP does now have a homepage, a CVS repository and a bug tracking system. Try
http://html-ep.sourceforge.net/
Have you ever written a CGI binary? Easy thing, isnt it? Was just fun!
Have you written two CGI binaries? Even easier, but not so much fun.
How about the third, fourth or fifth tool? Sometimes you notice that you are always doing the same:
- Reading and parsing variables
- Formatting output, in particular building tables
- Sending mail out from the page
- Building a database connection, passing CGI input to the database and vice versa
- Talking to HTML designers about realizing their wishes
You see, its soon to become a pain. Of course there are little helpers around, for example the CGI module, the mod_perl suite and lots of it more. Using them make live a lot easier, but not so much as you like. CGI(3). mod_perl(3).
On the other hand, there are tools like PHP or WebHTML. Incredibly easy to use, but not as powerfull as Perl. Why not get the best from both worlds? This is what EP wants to give you, similar to ePerl or HTML::EmbPerl. I personally believe that EP is simpler and better extendible than the latter two. ePerl(1). HTML::EmbPerl(3).
In short, its a single, but extensible program, that scans an HTML document for certain special HTML tags. These tags are replaced by appropriate output generated by the EP. What remains is passed to the browser. Its just like writing HTML for an enhanced browser!
<<less
Download (0.042MB)
Added: 2006-06-15 License: Perl Artistic License Price:
1227 downloads
HTTP::MobileAgent::Vodafone 0.26

HTTP::MobileAgent::Vodafone 0.26


HTTP::MobileAgent::Vodafone is a Perl module with a Vodafone implementation. more>>
HTTP::MobileAgent::Vodafone is a Perl module with a Vodafone implementation.

SYNOPSIS

use HTTP::MobileAgent;

local $ENV{HTTP_USER_AGENT} = "J-PHONE/2.0/J-DN02";
my $agent = HTTP::MobileAgent->new;

printf "Name: %sn", $agent->name; # "J-PHONE"
printf "Version: %sn", $agent->version; # 2.0
printf "Model: %sn", $agent->model; # "J-DN02"
print "Packet is compliant.n" if $agent->packet_compliant; # false

# only availabe in Java compliant
# e.g.) "J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0"
printf "Serial: %sn", $agent->serial_number; # XXXXXXXXXX
printf "Vendor: %sn", $agent->vendor; # SH
printf "Vender Version: %sn", $agent->vendor_version; # "0001a"

my $info = $self->java_info; # hash reference
print map { "$_: $info->{$_}n" } keys %$info;

<<less
Download (0.023MB)
Added: 2007-06-09 License: Perl Artistic License Price:
877 downloads
Seagull-trafgen 1.5.0

Seagull-trafgen 1.5.0


Seagull is a multi-protocol traffic generator test tool. more>>
Seagull project is a multi-protocol traffic generator test tool. Primary aimed at IMS protocols (and thus being the perfect complement to SIPp for IMS testing), Seagull is a powerful traffic generator for functional, load, endurance, stress and performance tests for almost any kind of protocol.
In addition, its openness allows to add the support of a brand new protocol in less than 2 hours - with no programming knowledge. For that, Seagull comes with several protocol families embedded in the source code:
- Binary/TLV (Diameter and many 3GPP and IETF protocols)
- External library (TCAP, SCTP)
- Text (XCAP, HTTP)
Main features:
- Multi-protocol traffic generator
- Protocols of the same family are described in an XML, user editable, dictionary (messages, parameters)
- Existing protocol families: Binary/TLV (Type, Length, Value), Raw binary, Text, external API (first implementation: HP OpenCall SS7)
- Scenarios are described using XML files
- Command line tool with text interface
- Multi-threaded for performances and reliability
- Dynamically adjustable call rate
- Pause and restart of traffic
- Smooth (no new calls then wait for ongoing calls to end) or brutal end
- Scenario display with message counters
- Scenarios have init (executed once), main (repeated for traffic) sections
- Scenarios have default sections for defense in case of unexpected messages
- A scenario can be mono (most cases) or multi-protocol
- Message and parameters checking possible (disabled by default)
- Multiple Seagull instances can be synchronized in the middle of scenario
- Statistics: timer between two messages, call length, call rate, successful calls, failed calls (with reason)
- Protocol decoding and hexadecimal dump
- Trace files with or without timestamps (for performances and automation)
Installation:
To compile Seagull from the source:
- Edit build.conf to fit your needs (default should be OK)
- run "./build.ksh -target clean"
- run "./build.ksh -target all"
- Seagull binaries are in bin/: copy all in /usr/local/bin/
- Add /usr/local/bin in your PATH environment variable
(eg. export "PATH=$PATH:/usr/local/bin")
- Execution environment are in exe-env/XXX-env/, XXX being the protocol
- From there, follow the documentation: http://gull.sourceforge.net/
Enhancements:
- This release adds authentication (MD5/Digest and AKA) for text protocols like HTTP, xcap, and SIP.
- It also adds reconnection in case of LAN failure, configuration parameters for text protocols, two new traffic control actions (pause and resume), and a new protocol family: TLV (Type, Length, Value).
<<less
Download (0.29MB)
Added: 2007-03-08 License: GPL (GNU General Public License) Price:
980 downloads
Template::Plugin::Java::Utils 0.4

Template::Plugin::Java::Utils 0.4


Template::Plugin::Java::Utils is a Perl module with utility functions for Template::Plugin::Java. more>>
Template::Plugin::Java::Utils is a Perl module with utility functions for Template::Plugin::Java.

SYNOPSIS

use Template::Plugin::Java::Utils qw/list of subroutines to import/;

SUBROUTINES

createTemplate

Creates a new Template with reasonable options.

parseOptions

Replaces c_c with cC and nosomething=whatever with something=0 in the keys of a hash.

setOption

Adds to or sets an option in a hash, supports nested arrays and boolean options. The logic here is one of those things that just works the way it is and seems decipherable, but dont mess with it.

parseCmdLine

Parses @ARGV into a hash of options and values, leaving everything else that is most likely a list of files on @ARGV.

sqlType2JavaType( type_name [, precision for numeric types] )

Maps some ANSI SQL data types to the closest Java variable types. The default case is byte[] for unrecognized sql types.

simplifyPath( path )

Remove any dir/../ or /./ or extraneous / from a path, as well as prepending the current directory if necessary.

findPackageDir( directory )

Find package in $ENV{CLASSPATH}.

determinePackage([ optional directory ])

Determine the package of the current or passed-in directory.
isNum( string )

Determines whether a string is a number or not. Uses the more powerful DBI::looks_like_number heuristic if available.

castJavaString( variable_name, target_type )

Casts a java String to another type using the appropriate code.
javaTypeName( javaType )

Transform a java type name to a character string version. In other words, String remains String, but byte[] becomes byteArray.

<<less
Download (0.018MB)
Added: 2007-06-04 License: Perl Artistic License Price:
873 downloads
Mobile::UserAgent 1.05

Mobile::UserAgent 1.05


Mobile::UserAgent is a mobile user agent string parsing class. more>>
Mobile::UserAgent is a mobile user agent string parsing class.

SYNOPSIS

### Print the information parsed from a user-agent string:
use Mobile::UserAgent;
my $useragent = Nokia6600/1.0 (4.09.1) SymbianOS/7.0s Series60/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0;
my $uaobj = new Mobile::UserAgent($useragent);
if ($uaobj->success()) {
print Vendor: . $uaobj->vendor() . "n";
print Model: . $uaobj->model() . "n";
print Version: . $uaobj->version() . "n";
print Series60: . $uaobj->isSeries60() . "n";
print Imode?: . $uaobj->isImode() . "n";
print Mozilla?: . $uaobj->isMozilla() . "n";
print Standard?: . $uaobj->isStandard() . "n";
print Rubbish?: . $uaobj->isRubbish() . "n";
}
else {
print "Not a mobile user-agent: $useragentn";
}


### Determine if the client is a mobile device.
use Mobile::UserAgent ();
use CGI ();

# Check 1: (check if it sends a user-agent profile URL in its headers)
foreach my $name (X_WAP_PROFILE,PROFILE,13_PROFILE,56_PROFILE) {
if (exists($ENV{"HTTP_$name"})) {
print "Client has a user-agent profile header, so its probably a mobile device.n";
last;
}
}

# Check 2: (check if it supports WML):
my $q = new CGI();
if ($q->Accept(text/vnd.wap.wml) == 1) {
print "Client supports WML so its probably a mobile device.n";
}

# Check 3: (check if this class can parse it)
my $uaobj = new Mobile::UserAgent();
if ($uaobj->success()) {
print "Clients user-agent could be parsed, so its a mobile device.n";
}

Parses a mobile user agent string into its basic constituent parts, the most important being vendor and model.

One reason for doing this would be to use this information to lookup vendor-model specific device characteristics in a database. You can use also use user agent profiles to do this (for which Ive developed other classes), but not all mobile phones have these, especially the older types. Another reason would be to detect if the visiting client is a mobile handset.

Only real mobile user-agent strings can be parsed succesfully by this class. Most WAP emulators are not supported because they usually dont use the same user-agent strings as the devices they emulate.

<<less
Download (0.037MB)
Added: 2007-03-22 License: Perl Artistic License Price:
957 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5