Skip Menu |

This queue is for tickets about the URI-ParseSearchString CPAN distribution.

Report information
The Basics
Id: 71838
Status: open
Priority: 0/
Queue: URI-ParseSearchString

People
Owner: Nobody in particular
Requestors: njh [...] bandsman.co.uk
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 3.442
Fixed in: (no value)



Subject: Having to pass ref to every call
Why do I have to pass $ref to *each* call: my $uparse = new URI::ParseSearchString(); my $ref = 'http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search'; my $query_terms = $uparse->se_term( $ref ); my $canonical = $uparse->se_name( $ref ); my $hostname = $uparse->se_host( $ref ); It would be far neater to do this: my $uparse = URI::ParseSearchString->new(ref => 'http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search'); my $query_terms = $uparse->se_term(); my $canonical = $uparse->se_name(); my $hostname = $uparse->se_host();
I see your point but on the other hand, surely instantiating a new object for every query string you have is not the ideal case either :-) On Fri Oct 21 11:04:55 2011, njh@bandsman.co.uk wrote: Show quoted text
> Why do I have to pass $ref to *each* call: > > my $uparse = new URI::ParseSearchString(); > my $ref = > 'http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search'; > > my $query_terms = $uparse->se_term( $ref ); > my $canonical = $uparse->se_name( $ref ); > my $hostname = $uparse->se_host( $ref ); > > It would be far neater to do this: > > my $uparse = URI::ParseSearchString->new(ref => > 'http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search'); > > my $query_terms = $uparse->se_term(); > my $canonical = $uparse->se_name(); > my $hostname = $uparse->se_host();
On Fri Nov 04 13:26:07 2011, SDEN wrote: Show quoted text
> I see your point but on the other hand, surely instantiating a new > object for every query string > you have is not the ideal case either :-)
If it’s not really object-oriented then, why don’t you provide exportable functions? Show quoted text
> > On Fri Oct 21 11:04:55 2011, njh@bandsman.co.uk wrote:
> > Why do I have to pass $ref to *each* call: > > > > my $uparse = new URI::ParseSearchString(); > > my $ref = > >
> 'http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search';
> > > > my $query_terms = $uparse->se_term( $ref ); > > my $canonical = $uparse->se_name( $ref ); > > my $hostname = $uparse->se_host( $ref ); > > > > It would be far neater to do this: > > > > my $uparse = URI::ParseSearchString->new(ref => > >
> 'http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search');
> > > > my $query_terms = $uparse->se_term(); > > my $canonical = $uparse->se_name(); > > my $hostname = $uparse->se_host();
>