Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Does Perl 5 (or 6?) need another built-in variable for the -F switch?

by Hofmator (Curate)
on Nov 03, 2006 at 10:21 UTC ( [id://582044]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Does Perl 5 (or 6?) need another built-in variable for the -F switch?
in thread Does Perl 5 (or 6?) need another built-in variable for the -F switch?

Well, at least perl should know which command line parameters where used when it was invoked :) and as the proposed hash %^C was supposed to be populated by perl itself, this should work out fine. This hash should then, IMO, include the command line parameters set via PERL5OPT.

Mind you, I have no idea how difficult it would be to patch that into perl, I just said I liked the idea.

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

  • Comment on Re^4: Does Perl 5 (or 6?) need another built-in variable for the -F switch?

Replies are listed 'Best First'.
Re^5: Does Perl 5 (or 6?) need another built-in variable for the -F switch?
by Anonymous Monk on Nov 03, 2006 at 11:53 UTC
    In that case, you rather want an array of pairs instead of a hash. There are switches that can be used multiple times (-M, among others), and some switches interact and their order is relevant (-l and -0 for instance).

      If -M (for example) were used multiple times, the %^C hash would look like this:

      %^C = ( M => [ 'strict', 'Data::Dumper', 'Getopt::Long' ], # ..... );

      Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://582044]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found