|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: Re: Re: Re: Re: Re: Re: NO PERL 6by BrowserUk (Pope) |
| on Dec 10, 2002 at 14:59 UTC ( #218795=note: print w/ replies, xml ) | Need Help?? |
|
Yup. Thats exactly the conflict I came across. I'm sure there is a very good reason for having an undelimited/space delimited optional first parameter, but it has always struck me as weird. It would be entirely feasible (I think) to check the first parameter to print and determine if it is a filehandle (either a direct or discuised one) and act appropriately? I guess that in the case of a discuised one, this would mean that if you really wanted to print out the stringyfied version of $fh to standard out you might need to disabiguate the handle to prevent it be used as the target. Maybe print "$fh", 'other stuff'; or print +$fh "other stuff";. This seems like a rare enough occurance for the additional syntax to not be a problem. I reasise that print $fh, 'stuff';<code> is slightly more verbose that <code>print $fh 'stuff';, but I nearly always have to go back and remove the extra comma that I type by habit when I get the "No comma allowed after filehandle ..." msg as it stands. I'm not sure that there is any conflict with sort? Isn't the comma only optional if the first parameter to these calls is a bare block or subname? In which case, this would never be ambigous. I see (now you've mentioned it) that exec can be used with ``indirect object'' syntax, which is another conflict, but I see that you can also use exec { $shell } arg-list; instead of exec $shell arglist;. Is there any situation where the former would act differently to the later? If not, would the deprecation of that latter be a bad thing? Please note: I am only asking questions for my own curiosity. I am quite happy to leave the decisions to those with the knowledge and power to make them.
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
In Section
Meditations
|
|
||||||||||||||||||||