| 27 | | WRITEME |
| | 28 | You can pass various command line options to Pugs. |
| | 29 | |
| | 30 | =over |
| | 31 | |
| | 32 | =item C<-e I<program>> |
| | 33 | |
| | 34 | causes Pugs to not look for any program files in the command line options, but |
| | 35 | instead run the one-line program specified. Multiple C<-e> commands work too. |
| | 36 | |
| | 37 | =item C<-n> |
| | 38 | |
| | 39 | causes Pugs to assume the following loop around your program, which makes it |
| | 40 | iterate over filename arguments somewhat like sed -n or awk: |
| | 41 | |
| | 42 | while =<> { |
| | 43 | ...your program here... |
| | 44 | } |
| | 45 | |
| | 46 | =item C<-p> |
| | 47 | |
| | 48 | causes Pugs to assume the following loop around your program, which makes it |
| | 49 | iterate over filename arguments somewhat like sed: |
| | 50 | |
| | 51 | while =<> { |
| | 52 | ...your program here... |
| | 53 | say; |
| | 54 | } |
| | 55 | |
| | 56 | =item C<-c> |
| | 57 | |
| | 58 | causes Pugs to not run the program, but merely check its syntax. |
| | 59 | |
| | 60 | Note that C<BEGIN {...}> and C<CHECK {...}> blocks, as well as C<use Module>, |
| | 61 | are still executed, because these might change the grammar or create new |
| | 62 | operators, etc. So the following is B<not> safe: |
| | 63 | |
| | 64 | pugs -c 'BEGIN { system "evil command" }' |
| | 65 | |
| | 66 | If you want to run a potentially unsafe program safely, see the safemode Pugs |
| | 67 | provides. |
| | 68 | |
| | 69 | =item C<-BI<backend>> |
| | 70 | |
| | 71 | causes Pugs to execute the program using C<I<backend>>. Currently, valid |
| | 72 | backends are C<Pugs>, C<Parrot>, and C<Haskell>. |
| | 73 | |
| | 74 | =item C<-CI<backend>> |
| | 75 | |
| | 76 | causes Pugs to compile the program using C<I<backend>>. Currently, valid |
| | 77 | backends are C<Pugs>, C<Parrot>, and C<Haskell>. |
| | 78 | |
| | 79 | Note that, as with C<-c>, C<BEGIN {...}> and C<CHECK {...}> blocks, as well as |
| | 80 | C<use Module>, are still executed. So don't try to compile potentially unsafe |
| | 81 | code! |
| | 82 | |
| | 83 | =item C<-MI<module>> |
| | 84 | |
| | 85 | causes Pugs to load C<I<module>> before executing your program: |
| | 86 | |
| | 87 | use module; |
| | 88 | ...your code here... |
| | 89 | |
| | 90 | =item C<-h> or C<--help> |
| | 91 | |
| | 92 | outputs a short summary of the available command line options. No programs are |
| | 93 | executed. |
| | 94 | |
| | 95 | =item C<-V> |
| | 96 | |
| | 97 | outputs the version of Pugs you're running and long configuration information. |
| | 98 | |
| | 99 | =item C<-V:I<item>> |
| | 100 | |
| | 101 | outputs short configuration information for C<I<item>>. |
| | 102 | |
| | 103 | $ pugs -V:pugs_version |
| | 104 | pugs_versnum: 6.2.6 |
| | 105 | |
| | 106 | =item C<-v> or C<--version> |
| | 107 | |
| | 108 | outputs the version of Pugs you're running. |
| | 109 | |
| | 110 | =item C<-l>, C<-d>, and C<-w> |
| | 111 | |
| | 112 | are ignored for compatibility with Perl 5. |
| | 113 | |
| | 114 | =back |