Changeset 7606 for lib

Show
Ignore:
Timestamp:
10/14/05 13:01:26 (3 years ago)
Author:
autrijus
Message:

* Add notes to Perl6::Pugs and pugs::run documentation about

the use of -- to separate pugs options and program options.
Reported by r0nny.

Location:
lib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lib/Perl6/Pugs.pm

    r7515 r7606  
    1717    % pugs -e "{ 'Hello, ', @^x }.('World!').say" 
    1818    Hello, World! 
     19 
     20With Perl 5 embedding support (also note the C<--> in the C<#!> line): 
     21 
     22    #!/usr/bin/pugs -- 
     23    use v6; 
     24    use perl5:DBI; 
     25    my $dbh = DBI.connect('dbi:SQLite:dbname=test.db'); 
     26    $dbh.do("CREATE TABLE Test (Project, Pumpking)"); 
    1927 
    2028=head1 DESCRIPTION 
  • lib/pugs/run.pod

    r7342 r7606  
    2424WRITEME 
    2525 
     26=head2 Flags separation 
     27 
     28Pugs uses C<--> to separate flags of Pugs itself and arguments to the program. 
     29For example, this will print C<--help>: 
     30 
     31    $ pugs -e 'say @ARGS' -- --help 
     32 
     33But this will show the help message of Pugs: 
     34 
     35    $ pugs -e 'say @ARGS' --help 
     36 
     37For the same reason, to use Pugs in the Unix C<#!> line, add an extra C<--> 
     38after it: 
     39 
     40    #!/usr/bin/pugs -- 
     41    say 'Hello, ', @ARGS, '!'; 
     42 
    2643=head2 Command line options 
    2744