Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    URI::Query 0.09

    Download button

    No screenshots available
    Downloads: 112  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Gavin Carr | More programs
    Perl Artistic License / FREE
    August 4th, 2011, 06:26 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    URI::Query description

    Class providing URI query string manipulation

    URI::Query is a Perl module that provides simple URI query string manipulation, allowing you to create and manipulate URI query strings from GET and POST requests in web applications. This is primarily useful for creating links where you wish to preserve some subset of the parameters to the current request, and potentially add or replace others. Given a query string this is doable with regexes, of course, but making sure you get the anchoring and escaping right is tedious and error-prone - this module is simpler.

    SYNOPSIS

     # Constructor - using a GET query string
     $qq = URI::Query->new($query_string);
     # OR Constructor - using a hashref of key => value parameters
     $qq = URI::Query->new($cgi->Vars);
     # OR Constructor - using an array of successive keys and values
     $qq = URI::Query->new(@params);

     # Revert back to the initial constructor state (to do it all again)
     $qq->revert;

     # Remove all occurrences of the given parameters
     $qq->strip('page', 'next');

     # Remove all parameters except the given ones
     $qq->strip_except('pagesize', 'order');

     # Remove all empty/undefined parameters
     $qq->strip_null;

     # Replace all occurrences of the given parameters
     $qq->replace(page => $page, foo => 'bar');

     # Set the argument separator to use for output (default: unescaped '&')
     $qq->separator(';');

     # Output the current query string
     print "$qq"; # OR $qq->stringify;
     # Stringify with explicit argument separator
     $qq->stringify(';');

     # Get a flattened hash/hashref of the current parameters
     # (single item parameters as scalars, multiples as an arrayref)
     my %qq = $qq->hash;

     # Get a non-flattened hash/hashref of the current parameters
     # (parameter => arrayref of values)
     my %qq = $qq->hash_arrayref;

     # Get the current query string as a set of hidden input tags
     print $qq->hidden;



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    URI query | string manipulation | Perl module | URI | query | string

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM