Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Perl oddities

by Anonymous Monk
on Mar 02, 2005 at 00:59 UTC ( #435668=note: print w/replies, xml ) Need Help??

in reply to Perl oddities

While I agree with your observations about the odities of -M, -A, and -C, print FH @list makes perfect sense to me. If one was to put a comma between the two, I would expect the filehandle and list to be printed (ie. the glob and the list); especially with the possibility of Filehandles now being assigned to variables ( open my $fh => ''), I'd find it counterintuitive to see perl differentiate between:
print $fh,@list; # ref($fh) = GLOB
print $fh,@list
That'd be some cooky DWIMery, considering, then, that _if_ we wanted to print something like GLOB<0x...>, we'd have to do this:  print "$fh",@list , which would function in a significantly different manner than print $fh,@list . Thus, to me it's a perfectly rational and well thought out syntax.

I still prefer, however,  $fh->print(); . In addition, the workaround to this oddity would be to force the explicit declaring of the filehandle to write to, or the like.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://435668]
[Corion]: ... values to be used. For example, I think for headers, one would want to have various kinds of Content-Encoding headers, but for the get_parameters one would have various kinds of Bobby Tables
[choroba]: What about [metadoc:// Algorithm::Loops]?
[Corion]: choroba: Yeah, but handing off the request to Dancer,Plack, Mojolicious,LWP is easy once I have the data filled into some structure ;))
[choroba]: Algorithm::Loops
[Corion]: choroba: I'm using that to generate the permutations, but I don't know how the user can pass the intended values to my function in a sane way
[Corion]: I have a prototype that permutes the get_parameters, but the values used for the get parameters should be different from the values used for the headers and potentially for parts of the URL
[Corion]: But yes, in general, my approach will be "split the URL into another set of parameters, generate an array of allowed values for each parameter and then NestedLoops() over the set"
[choroba]: hmm... so you need something like bag from Test::Deep, but not for checking, but for generation
[Corion]: This has the dual use of easily requesting sequential URLs and also being suitable for testing
[Corion]: For testing, I want to skip all tests with the same value(s) once one test fails to cut down on the number of failing tests

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-01-17 08:16 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (152 votes). Check out past polls.